00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkShiftScaleImageFilter_h
00018 #define __itkShiftScaleImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkArray.h"
00022
00023 namespace itk
00024 {
00025
00037 template <class TInputImage, class TOutputImage>
00038 class ITK_EXPORT ShiftScaleImageFilter:
00039 public ImageToImageFilter<TInputImage,TOutputImage>
00040 {
00041 public:
00043 typedef ShiftScaleImageFilter Self;
00044 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00045 typedef SmartPointer<Self> Pointer;
00046 typedef SmartPointer<const Self> ConstPointer;
00047
00049 itkNewMacro(Self);
00050
00052 typedef typename TInputImage::RegionType InputImageRegionType;
00053 typedef typename TOutputImage::RegionType OutputImageRegionType;
00054
00056 typedef typename TInputImage::Pointer InputImagePointer;
00057 typedef typename TOutputImage::Pointer OutputImagePointer;
00058
00060 typedef typename TInputImage::PixelType InputImagePixelType;
00061 typedef typename TOutputImage::PixelType OutputImagePixelType;
00062
00064 typedef typename TInputImage::IndexType InputImageIndexType;
00065 typedef typename TInputImage::SizeType InputImageSizeType;
00066 typedef typename TInputImage::OffsetType InputImageOffsetType;
00067 typedef typename TOutputImage::IndexType OutputImageIndexType;
00068 typedef typename TOutputImage::SizeType OutputImageSizeType;
00069 typedef typename TOutputImage::OffsetType OutputImageOffsetType;
00070
00072 typedef typename NumericTraits<OutputImagePixelType>::RealType RealType;
00073
00075 itkStaticConstMacro(ImageDimension, unsigned int,
00076 TInputImage::ImageDimension );
00077
00079 itkTypeMacro(ShiftScaleImageFilter, ImageToImageFilter);
00080
00082 itkSetMacro(Shift,RealType);
00083 itkGetConstMacro(Shift,RealType);
00085
00087 itkSetMacro(Scale,RealType);
00088 itkGetConstMacro(Scale,RealType);
00090
00092 itkGetConstMacro(UnderflowCount,long);
00093 itkGetConstMacro(OverflowCount,long);
00095
00096 #ifdef ITK_USE_CONCEPT_CHECKING
00097
00098 itkConceptMacro(OutputHasNumericTraitsCheck,
00099 (Concept::HasNumericTraits<OutputImagePixelType>));
00100 itkConceptMacro(InputPlusRealTypeCheck,
00101 (Concept::AdditiveOperators<InputImagePixelType, RealType, RealType>));
00102 itkConceptMacro(RealTypeMultiplyOperatorCheck,
00103 (Concept::MultiplyOperator<RealType>));
00104
00106 #endif
00107
00108 protected:
00109 ShiftScaleImageFilter();
00110 ~ShiftScaleImageFilter();
00111 void PrintSelf(std::ostream& os, Indent indent) const;
00112
00114 void BeforeThreadedGenerateData ();
00115
00117 void AfterThreadedGenerateData ();
00118
00120 void ThreadedGenerateData (const OutputImageRegionType&
00121 outputRegionForThread,
00122 int threadId);
00123 private:
00124 ShiftScaleImageFilter(const Self&);
00125 void operator=(const Self&);
00127
00128 RealType m_Shift;
00129 RealType m_Scale;
00130
00131 long m_UnderflowCount;
00132 long m_OverflowCount;
00133
00134 Array<long> m_ThreadUnderflow;
00135 Array<long> m_ThreadOverflow;
00136 };
00137
00138
00139 }
00140
00141 #ifndef ITK_MANUAL_INSTANTIATION
00142 #include "itkShiftScaleImageFilter.txx"
00143 #endif
00144
00145 #endif
00146