Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __itkAutoCropLabelMapFilter_h
00021 #define __itkAutoCropLabelMapFilter_h
00022
00023 #include "itkChangeRegionLabelMapFilter.h"
00024
00025 namespace itk
00026 {
00027
00044 template <class TInputImage>
00045 class ITK_EXPORT AutoCropLabelMapFilter :
00046 public ChangeRegionLabelMapFilter<TInputImage>
00047 {
00048 public:
00050 typedef AutoCropLabelMapFilter Self;
00051 typedef ChangeRegionLabelMapFilter<TInputImage> Superclass;
00052 typedef SmartPointer<Self> Pointer;
00053 typedef SmartPointer<const Self> ConstPointer;
00054
00056 itkNewMacro(Self);
00057
00059 itkTypeMacro(AutoCropLabelMapFilter, ChangeRegionImageFilter);
00060
00062 typedef typename Superclass::OutputImageType OutputImageType;
00063 typedef typename Superclass::OutputImagePointer OutputImagePointer;
00064 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00065 typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
00066
00068 typedef TInputImage InputImageType;
00069 typedef typename InputImageType::Pointer InputImagePointer;
00070 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00071 typedef typename InputImageType::RegionType InputImageRegionType;
00072 typedef typename InputImageType::PixelType InputImagePixelType;
00073 typedef typename InputImageType::LabelObjectType LabelObjectType;
00074
00075 typedef typename InputImageType::PixelType PixelType;
00076 typedef typename InputImageType::IndexType IndexType;
00077 typedef typename InputImageType::SizeType SizeType;
00078 typedef typename InputImageType::RegionType RegionType;
00079
00080 typedef TInputImage TOutputImage;
00081
00083 itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
00084 itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
00085 itkStaticConstMacro(ImageDimension, unsigned int, TOutputImage::ImageDimension);
00087
00088
00092 itkSetMacro(CropBorder, SizeType);
00093 itkGetConstReferenceMacro(CropBorder, SizeType);
00095
00096 itkGetConstReferenceMacro(MinIndex, IndexType);
00097 itkGetConstReferenceMacro(MaxIndex, IndexType);
00098
00099 protected:
00100 AutoCropLabelMapFilter();
00101 ~AutoCropLabelMapFilter() {};
00102
00103 void PrintSelf(std::ostream& os, Indent indent) const;
00104
00105 virtual void GenerateOutputInformation();
00106
00107 private:
00108 AutoCropLabelMapFilter(const Self&);
00109 void operator=(const Self&);
00110
00111 void FindBoundingBox();
00112 void SetAndPadCropRegion();
00113
00114 SizeType m_CropBorder;
00115 TimeStamp m_CropTimeStamp;
00116
00117 IndexType m_MinIndex;
00118 IndexType m_MaxIndex;
00119
00120 InputImageRegionType m_CropRegion;
00121 };
00122
00123 }
00124
00125 #ifndef ITK_MANUAL_INSTANTIATION
00126 #include "itkAutoCropLabelMapFilter.txx"
00127 #endif
00128
00129 #endif
00130