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
00047 template <class TInputImage, class TOutputImage>
00048 class ITK_EXPORT RegionOfInterestImageFilter:
00049 public ImageToImageFilter<TInputImage,TOutputImage>
00050 {
00051 public:
00053 typedef RegionOfInterestImageFilter Self;
00054 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00055 typedef SmartPointer<Self> Pointer;
00056 typedef SmartPointer<const Self> ConstPointer;
00057 typedef typename Superclass::InputImageRegionType InputImageRegionType;
00058
00060 itkNewMacro(Self);
00061
00063 itkTypeMacro(RegionOfInterestImageFilter, ImageToImageFilter);
00064
00066 typedef typename TInputImage::RegionType RegionType;
00067 typedef typename TInputImage::IndexType IndexType;
00068 typedef typename TInputImage::SizeType SizeType;
00069
00071 typedef typename TOutputImage::PixelType OutputImagePixelType;
00072 typedef typename TInputImage::PixelType InputImagePixelType;
00073
00075 itkSetMacro(RegionOfInterest, RegionType);
00076 itkGetConstMacro(RegionOfInterest, RegionType);
00078
00080 itkStaticConstMacro(ImageDimension, unsigned int,
00081 TInputImage::ImageDimension);
00082 itkStaticConstMacro(OutputImageDimension, unsigned int,
00083 TOutputImage::ImageDimension);
00085
00086 #ifdef ITK_USE_CONCEPT_CHECKING
00087
00088 itkConceptMacro(SameDimensionCheck,
00089 (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00090 itkConceptMacro(InputConvertibleToOutputCheck,
00091 (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
00092
00094 #endif
00095
00096 protected:
00097 RegionOfInterestImageFilter();
00098 ~RegionOfInterestImageFilter() {};
00099 void PrintSelf(std::ostream& os, Indent indent) const;
00100
00101
00102 virtual void GenerateInputRequestedRegion();
00103 virtual void EnlargeOutputRequestedRegion(DataObject *output);
00104
00113 virtual void GenerateOutputInformation();
00114
00115
00125 void ThreadedGenerateData(const RegionType& outputRegionForThread,
00126 int threadId );
00127
00128 private:
00129 RegionOfInterestImageFilter(const Self&);
00130 void operator=(const Self&);
00131
00132 RegionType m_RegionOfInterest;
00133 };
00134
00135
00136 }
00137
00138 #ifndef ITK_MANUAL_INSTANTIATION
00139 #include "itkRegionOfInterestImageFilter.txx"
00140 #endif
00141
00142 #endif
00143