00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkRegionOfInterestImageFilter_h
00018 #define __itkRegionOfInterestImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkSmartPointer.h"
00022
00023 namespace itk
00024 {
00025
00045 template <class TInputImage, class TOutputImage>
00046 class ITK_EXPORT RegionOfInterestImageFilter:
00047 public ImageToImageFilter<TInputImage,TOutputImage>
00048 {
00049 public:
00051 typedef RegionOfInterestImageFilter Self;
00052 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00053 typedef SmartPointer<Self> Pointer;
00054 typedef SmartPointer<const Self> ConstPointer;
00055 typedef typename Superclass::InputImageRegionType InputImageRegionType;
00056
00058 itkNewMacro(Self);
00059
00061 itkTypeMacro(RegionOfInterestImageFilter, ImageToImageFilter);
00062
00064 typedef typename TInputImage::RegionType RegionType;
00065 typedef typename TInputImage::IndexType IndexType;
00066 typedef typename TInputImage::SizeType SizeType;
00067
00069 typedef typename TOutputImage::PixelType OutputImagePixelType;
00070 typedef typename TInputImage::PixelType InputImagePixelType;
00071
00073 itkSetMacro(RegionOfInterest, RegionType);
00074 itkGetMacro(RegionOfInterest, RegionType);
00076
00078 itkStaticConstMacro(ImageDimension, unsigned int,
00079 TInputImage::ImageDimension);
00080 itkStaticConstMacro(OutputImageDimension, unsigned int,
00081 TOutputImage::ImageDimension);
00083
00084 #ifdef ITK_USE_CONCEPT_CHECKING
00085
00086 itkConceptMacro(SameDimensionCheck,
00087 (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00088 itkConceptMacro(InputConvertibleToOutputCheck,
00089 (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
00090
00092 #endif
00093
00094 protected:
00095 RegionOfInterestImageFilter();
00096 ~RegionOfInterestImageFilter() {};
00097 void PrintSelf(std::ostream& os, Indent indent) const;
00098
00099
00100 virtual void GenerateInputRequestedRegion();
00101 virtual void EnlargeOutputRequestedRegion(DataObject *output);
00102
00111 virtual void GenerateOutputInformation();
00112
00113
00123 void ThreadedGenerateData(const RegionType& outputRegionForThread,
00124 int threadId );
00125
00126 private:
00127 RegionOfInterestImageFilter(const Self&);
00128 void operator=(const Self&);
00129
00130 RegionType m_RegionOfInterest;
00131 };
00132
00133
00134 }
00135
00136 #ifndef ITK_MANUAL_INSTANTIATION
00137 #include "itkRegionOfInterestImageFilter.txx"
00138 #endif
00139
00140 #endif
00141