itkMultiphaseDenseFiniteDifferenceImageFilter.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
00018 #ifndef __itkMultiphaseDenseFiniteDifferenceImageFilter_h
00019 #define __itkMultiphaseDenseFiniteDifferenceImageFilter_h
00020
00021 #include "itkMultiphaseFiniteDifferenceImageFilter.h"
00022 #include "itkBinaryThresholdImageFilter.h"
00023 #include "itkSignedMaurerDistanceMapImageFilter.h"
00024 #include "itkImageRegionConstIterator.h"
00025 #include "itkImageRegionIterator.h"
00026 #include "itkNumericTraits.h"
00027 #include "itkNeighborhoodAlgorithm.h"
00028
00029 #include <list>
00030
00031
00032 namespace itk {
00033
00101 template < class TInputImage, class TFeatureImage, class TOutputImage, class TFunction,
00102 typename TIdCell = unsigned int >
00103 class ITK_EXPORT MultiphaseDenseFiniteDifferenceImageFilter :
00104 public MultiphaseFiniteDifferenceImageFilter< TInputImage, TFeatureImage,
00105 TOutputImage, TFunction, TIdCell >
00106 {
00107 public:
00108
00110 typedef MultiphaseDenseFiniteDifferenceImageFilter Self;
00111 typedef MultiphaseFiniteDifferenceImageFilter< TInputImage,
00112 TFeatureImage, TOutputImage, TFunction, TIdCell > Superclass;
00113 typedef SmartPointer<Self> Pointer;
00114 typedef SmartPointer<const Self> ConstPointer;
00115
00117 itkTypeMacro( MultiphaseDenseFiniteDifferenceImageFilter, ImageToImageFilter );
00118
00121 itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
00122
00124 typedef typename Superclass::InputImageType InputImageType;
00125 typedef typename Superclass::InputImagePointer InputImagePointer;
00126 typedef typename Superclass::InputRegionType InputRegionType;
00127 typedef typename Superclass::InputSizeType InputSizeType;
00128 typedef typename Superclass::InputSizeValueType InputSizeValueType;
00129 typedef typename Superclass::InputIndexType InputIndexType;
00130 typedef typename Superclass::InputIndexValueType InputIndexValueType;
00131 typedef typename Superclass::InputPixelType InputPixelType;
00132 typedef typename Superclass::InputPointType InputPointType;
00133 typedef typename Superclass::InputSpacingType InputSpacingType;
00134 typedef typename InputImageType::ValueType ValueType;
00135
00136 typedef typename Superclass::FeatureImageType FeatureImageType;
00137 typedef typename Superclass::FeatureSizeType FeatureSizeType;
00138 typedef typename Superclass::FeatureImagePointer FeatureImagePointer;
00139 typedef typename Superclass::FeatureRegionType FeatureRegionType;
00140 typedef typename Superclass::FeatureSpacingType FeatureSpacingType;
00141 typedef typename Superclass::FeaturePointType FeaturePointType;
00142 typedef typename Superclass::FeaturePixelType FeaturePixelType;
00143
00144 typedef typename Superclass::OutputImageType OutputImageType;
00145 typedef typename Superclass::OutputImagePointer OutputImagePointer;
00146 typedef typename Superclass::OutputRegionType OutputRegionType;
00147 typedef typename Superclass::OutputSizeType OutputSizeType;
00148 typedef typename Superclass::OutputSizeValueType SizeValueType;
00149 typedef typename Superclass::OutputIndexType OutputIndexType;
00150 typedef typename Superclass::OutputIndexValueType OutputIndexValueType;
00151 typedef typename OutputImageType::PixelType OutputPixelType;
00152
00153 typedef typename Superclass::IdCellType IdCellType;
00154
00155 typedef BinaryThresholdImageFilter< InputImageType, InputImageType >
00156 ThresholdFilterType;
00157 typedef typename ThresholdFilterType::Pointer
00158 ThresholdFilterPointer;
00159
00160 typedef SignedMaurerDistanceMapImageFilter< InputImageType, InputImageType >
00161 MaurerType;
00162 typedef typename MaurerType::Pointer MaurerPointer;
00163
00164 typedef typename Superclass::FiniteDifferenceFunctionType
00165 FiniteDifferenceFunctionType;
00166 typedef typename Superclass::FiniteDifferenceFunctionPointer
00167 FiniteDifferenceFunctionPointer;
00168 typedef typename FiniteDifferenceFunctionType::NeighborhoodType
00169 NeighborhoodIteratorType;
00170
00172 typedef typename Superclass::TimeStepType TimeStepType;
00173
00174
00175 typedef NeighborhoodAlgorithm::ImageBoundaryFacesCalculator< InputImageType >
00176 FaceCalculatorType;
00177 typedef typename FaceCalculatorType::FaceListType FaceListType;
00178
00179 void SetFunctionCount( const IdCellType& n );
00180
00181 #ifdef ITK_USE_CONCEPT_CHECKING
00182
00183 itkConceptMacro(OutputTimesDoubleCheck,
00184 (Concept::MultiplyOperator<OutputPixelType, double>));
00185 itkConceptMacro(OutputAdditiveOperatorsCheck,
00186 (Concept::AdditiveOperators<OutputPixelType>));
00187 itkConceptMacro(InputConvertibleToOutputCheck,
00188 (Concept::Convertible<FeaturePixelType, OutputPixelType>));
00189
00191 #endif
00192
00193 itkSetMacro( ReinitializeCounter, unsigned int );
00194 itkGetMacro( ReinitializeCounter, unsigned int );
00195
00196 protected:
00197 MultiphaseDenseFiniteDifferenceImageFilter()
00198 {
00199 this->m_ReinitializeCounter = 1;
00200
00201
00202 }
00203
00204 ~MultiphaseDenseFiniteDifferenceImageFilter() {}
00205
00206 virtual void PrintSelf( std::ostream&, Indent indent ) const;
00207
00211 virtual void CopyInputToOutput();
00212 virtual void PostProcessOutput();
00214
00218 virtual void ApplyUpdate(TimeStepType dt);
00219
00220 unsigned int m_ReinitializeCounter;
00221
00222
00223 private:
00224 MultiphaseDenseFiniteDifferenceImageFilter(const Self&);
00225 void operator=(const Self&);
00226
00229 virtual void AllocateUpdateBuffer();
00230
00234 virtual TimeStepType CalculateChange();
00235
00237 std::vector< InputImagePointer > m_UpdateBuffers;
00238 };
00239
00240
00241 }
00242
00243 #ifndef ITK_MANUAL_INSTANTIATION
00244 #include "itkMultiphaseDenseFiniteDifferenceImageFilter.txx"
00245 #endif
00246
00247 #endif
00248