itkIsoContourDistanceImageFilter.h
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 __itkIsoContourDistanceImageFilter_h
00018 #define __itkIsoContourDistanceImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkNarrowBand.h"
00022 #include "itkBarrier.h"
00023
00024 namespace itk
00025 {
00053 template <class TInputImage, class TOutputImage>
00054 class ITK_EXPORT IsoContourDistanceImageFilter :
00055 public ImageToImageFilter<TInputImage,TOutputImage>
00056 {
00057 public:
00059 typedef IsoContourDistanceImageFilter Self;
00060 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00061 typedef SmartPointer<Self> Pointer;
00062 typedef SmartPointer<const Self> ConstPointer;
00063
00065 itkNewMacro(Self);
00066
00068 itkTypeMacro(IsoContourDistanceImageFilter, ImageToImageFilter);
00069
00071 typedef typename Superclass::InputImageType InputImageType;
00072 typedef typename Superclass::OutputImageType OutputImageType;
00073
00076 itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
00077 itkStaticConstMacro(OutputImageDimension, unsigned int,
00078 TOutputImage::ImageDimension);
00080
00083 typedef typename OutputImageType::PixelType PixelType;
00084 typedef typename InputImageType::PixelType InputPixelType;
00085 typedef typename OutputImageType::RegionType OutputImageRegionType;
00086
00088 typedef typename InputImageType::SizeType InputSizeType;
00089 typedef typename OutputImageType::SizeType SizeType;
00090 typedef typename InputImageType::IndexType InputIndexType;
00091 typedef typename OutputImageType::IndexType IndexType;
00092
00094 typedef BandNode<IndexType,PixelType> BandNodeType;
00095 typedef NarrowBand<BandNodeType> NarrowBandType;
00096 typedef typename NarrowBandType::Pointer NarrowBandPointer;
00097 typedef typename NarrowBandType::RegionType RegionType;
00098 typedef typename NarrowBandType::ConstIterator ConstBandIterator;
00099 typedef typename NarrowBandType::Iterator BandIterator;
00100
00101
00104 itkSetMacro( LevelSetValue, InputPixelType );
00105 itkGetMacro( LevelSetValue, InputPixelType );
00107
00110 itkSetMacro( FarValue, PixelType );
00111 itkGetMacro( FarValue, PixelType );
00113
00114
00117 itkSetMacro( NarrowBanding, bool );
00118 itkGetMacro( NarrowBanding, bool );
00119 itkBooleanMacro( NarrowBanding );
00121
00122
00124 void SetNarrowBand( NarrowBandType * ptr );
00125 NarrowBandPointer GetNarrowBand() const
00126 { return m_NarrowBand; }
00128
00129 #ifdef ITK_USE_CONCEPT_CHECKING
00130
00131 itkConceptMacro(InputEqualityComparableCheck,
00132 (Concept::EqualityComparable<InputPixelType>));
00133 itkConceptMacro(OutputEqualityComparableCheck,
00134 (Concept::EqualityComparable<PixelType>));
00135 itkConceptMacro(SameDimensionCheck,
00136 (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00137 itkConceptMacro(DoubleConvertibleToOutputCheck,
00138 (Concept::Convertible<double, PixelType>));
00139 itkConceptMacro(InputConvertibleToOutputCheck,
00140 (Concept::Convertible<InputPixelType, PixelType>));
00141 itkConceptMacro(OutputAdditiveOperatorsCheck,
00142 (Concept::AdditiveOperators<PixelType>));
00143 itkConceptMacro(InputOStreamWritableCheck,
00144 (Concept::OStreamWritable<InputPixelType>));
00145 itkConceptMacro(OutputOStreamWritableCheck,
00146 (Concept::OStreamWritable<PixelType>));
00147
00149 #endif
00150
00151 protected:
00152 IsoContourDistanceImageFilter();
00153 ~IsoContourDistanceImageFilter(){};
00154 void PrintSelf(std::ostream& os, Indent indent) const;
00155
00156 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00157 int threadId );
00158 void ThreadedGenerateDataFull(const OutputImageRegionType& outputRegionForThread,
00159 int threadId );
00160 void ThreadedGenerateDataBand(const OutputImageRegionType& outputRegionForThread,
00161 int threadId );
00162 void BeforeThreadedGenerateData();
00163
00164 virtual void GenerateInputRequestedRegion();
00165 virtual void EnlargeOutputRequestedRegion( DataObject * );
00166
00167 private:
00168 IsoContourDistanceImageFilter(const Self&);
00169 void operator=(const Self&);
00170
00171 InputPixelType m_LevelSetValue;
00172 PixelType m_FarValue;
00173
00174 bool m_NarrowBanding;
00175 NarrowBandPointer m_NarrowBand;
00176 std::vector<RegionType> m_NarrowBandRegion;
00177
00179 typename Barrier::Pointer m_Barrier;
00180 };
00181
00182 }
00183
00184 #ifndef ITK_MANUAL_INSTANTIATION
00185 #include "itkIsoContourDistanceImageFilter.txx"
00186 #endif
00187
00188 #endif
00189