ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkNormalizeToConstantImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkNormalizeToConstantImageFilter_h
00019 #define __itkNormalizeToConstantImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkConceptChecking.h"
00023 
00024 namespace itk {
00025 
00054 template<class TInputImage, class TOutputImage>
00055 class ITK_EXPORT NormalizeToConstantImageFilter :
00056     public ImageToImageFilter<TInputImage, TOutputImage>
00057 {
00058 public:
00060   typedef NormalizeToConstantImageFilter Self;
00061 
00062   typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00063 
00064   typedef SmartPointer<Self>        Pointer;
00065   typedef SmartPointer<const Self>  ConstPointer;
00066 
00068   typedef TInputImage                              InputImageType;
00069   typedef TOutputImage                             OutputImageType;
00070   typedef typename InputImageType::Pointer         InputImagePointer;
00071   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00072   typedef typename InputImageType::PixelType       InputImagePixelType;
00073   typedef typename OutputImageType::Pointer        OutputImagePointer;
00074   typedef typename OutputImageType::ConstPointer   OutputImageConstPointer;
00075   typedef typename OutputImageType::PixelType      OutputImagePixelType;
00076   typedef typename InputImageType::RegionType      RegionType;
00077   typedef typename InputImageType::IndexType       IndexType;
00078   typedef typename InputImageType::SizeType        SizeType;
00079 
00080   typedef typename NumericTraits<InputImagePixelType>::RealType RealType;
00081 
00083   itkStaticConstMacro(InputImageDimension, unsigned int,
00084                       TInputImage::ImageDimension);
00085   itkStaticConstMacro(OutputImageDimension, unsigned int,
00086                       TOutputImage::ImageDimension);
00087   itkStaticConstMacro(ImageDimension, unsigned int,
00088                       TOutputImage::ImageDimension);
00090 
00092   itkNewMacro(Self);
00093 
00095   itkTypeMacro(NormalizeToConstantImageFilter, ImageToImageFilter);
00096 
00098   itkSetMacro(Constant, RealType);
00099   itkGetConstMacro(Constant, RealType);
00101 
00102 #ifdef ITK_USE_CONCEPT_CHECKING
00103 
00104   itkConceptMacro(InputHasPixelTraitsCheck,
00105     (Concept::HasPixelTraits<InputImagePixelType>));
00106   itkConceptMacro(InputHasNumericTraitsCheck,
00107     (Concept::HasNumericTraits<InputImagePixelType>));
00108 
00110 #endif
00111 
00112 protected:
00113   NormalizeToConstantImageFilter();
00114   virtual ~NormalizeToConstantImageFilter() {};
00115   void PrintSelf(std::ostream& os, Indent indent) const;
00116 
00117   void GenerateInputRequestedRegion();
00118 
00119   void GenerateData();
00120 
00121 
00122 private:
00123   NormalizeToConstantImageFilter(const Self&); //purposely not implemented
00124   void operator=(const Self&);                 //purposely not implemented
00125 
00126   RealType m_Constant;
00127 
00128 }; // end of class
00129 } // end namespace itk
00130 
00131 #ifndef ITK_MANUAL_INSTANTIATION
00132 #include "itkNormalizeToConstantImageFilter.hxx"
00133 #endif
00134 
00135 #endif
00136