Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkLabelImageToShapeLabelMapFilter_h
00018 #define __itkLabelImageToShapeLabelMapFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkShapeLabelObject.h"
00022 #include "itkLabelMap.h"
00023 #include "itkLabelImageToLabelMapFilter.h"
00024 #include "itkShapeLabelMapFilter.h"
00025
00026
00027 namespace itk {
00028
00044 template<class TInputImage, class TOutputImage=LabelMap< ShapeLabelObject< ITK_TYPENAME TInputImage::PixelType, ::itk::GetImageDimension<TInputImage>::ImageDimension> > >
00045 class ITK_EXPORT LabelImageToShapeLabelMapFilter :
00046 public ImageToImageFilter<TInputImage, TOutputImage>
00047 {
00048 public:
00050 typedef LabelImageToShapeLabelMapFilter Self;
00051 typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00052 typedef SmartPointer<Self> Pointer;
00053 typedef SmartPointer<const Self> ConstPointer;
00054
00056 typedef TInputImage InputImageType;
00057 typedef typename InputImageType::Pointer InputImagePointer;
00058 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00059 typedef typename InputImageType::RegionType InputImageRegionType;
00060 typedef typename InputImageType::PixelType InputImagePixelType;
00061
00062 typedef TOutputImage OutputImageType;
00063 typedef typename OutputImageType::Pointer OutputImagePointer;
00064 typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
00065 typedef typename OutputImageType::RegionType OutputImageRegionType;
00066 typedef typename OutputImageType::PixelType OutputImagePixelType;
00067 typedef typename OutputImageType::LabelObjectType LabelObjectType;
00068
00070 itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
00071 itkStaticConstMacro(OutputImageDimension, unsigned int, TInputImage::ImageDimension);
00072 itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
00074
00075 typedef LabelImageToLabelMapFilter< InputImageType, OutputImageType >
00076 LabelizerType;
00077 typedef Image< typename OutputImageType::PixelType, itkGetStaticConstMacro(OutputImageDimension)>
00078 ShapeLabelFilterOutput;
00079 typedef ShapeLabelMapFilter< TOutputImage, ShapeLabelFilterOutput >
00080 LabelObjectValuatorType;
00081
00083 itkNewMacro(Self);
00084
00086 itkTypeMacro(LabelImageToShapeLabelMapFilter, ImageToImageFilter);
00087
00088 #ifdef ITK_USE_CONCEPT_CHECKING
00089
00090 itkConceptMacro(InputEqualityComparableCheck,
00091 (Concept::EqualityComparable<InputImagePixelType>));
00092 itkConceptMacro(IntConvertibleToInputCheck,
00093 (Concept::Convertible<int, InputImagePixelType>));
00094 itkConceptMacro(InputOStreamWritableCheck,
00095 (Concept::OStreamWritable<InputImagePixelType>));
00096
00098 #endif
00099
00104 itkSetMacro( BackgroundValue, OutputImagePixelType );
00105 itkGetConstMacro( BackgroundValue, OutputImagePixelType );
00107
00112 itkSetMacro(ComputeFeretDiameter, bool);
00113 itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
00114 itkBooleanMacro(ComputeFeretDiameter);
00116
00121 itkSetMacro(ComputePerimeter, bool);
00122 itkGetConstReferenceMacro(ComputePerimeter, bool);
00123 itkBooleanMacro(ComputePerimeter);
00125
00126 protected:
00127 LabelImageToShapeLabelMapFilter();
00128 ~LabelImageToShapeLabelMapFilter() {};
00129 void PrintSelf(std::ostream& os, Indent indent) const;
00130
00133 void GenerateInputRequestedRegion();
00134
00136 void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00137
00140 void GenerateData();
00141
00142
00143 private:
00144 LabelImageToShapeLabelMapFilter(const Self&);
00145 void operator=(const Self&);
00146
00147 OutputImagePixelType m_BackgroundValue;
00148 bool m_ComputeFeretDiameter;
00149 bool m_ComputePerimeter;
00150
00151 };
00152
00153 }
00154
00155 #ifndef ITK_MANUAL_INSTANTIATION
00156 #include "itkLabelImageToShapeLabelMapFilter.txx"
00157 #endif
00158
00159 #endif
00160