18 #ifndef itkMRFImageFilter_h
19 #define itkMRFImageFilter_h
21 #include "vnl/vnl_vector.h"
22 #include "vnl/vnl_matrix.h"
124 template<
typename TInputImage,
typename TClassifiedImage >
160 static constexpr
unsigned int InputImageDimension = TInputImage::ImageDimension;
191 static constexpr
unsigned int ClassifiedImageDimension = TClassifiedImage::ImageDimension;
228 itkSetMacro(NumberOfClasses,
unsigned int);
229 itkGetConstMacro(NumberOfClasses,
unsigned int);
234 itkSetMacro(MaximumNumberOfIterations,
unsigned int);
235 itkGetConstMacro(MaximumNumberOfIterations,
unsigned int);
240 itkSetMacro(ErrorTolerance,
double);
241 itkGetConstMacro(ErrorTolerance,
double);
246 itkSetMacro(SmoothingFactor,
double);
247 itkGetConstMacro(SmoothingFactor,
double);
258 void SetNeighborhoodRadius(
const SizeValueType *radiusArray);
265 for (
int i = 0; i < InputImageDimension; ++i )
267 radius[i] = m_InputImageNeighborhoodRadius[i];
277 virtual void SetMRFNeighborhoodWeight(std::vector< double > BetaMatrix);
281 return m_MRFNeighborhoodWeight;
286 MaximumNumberOfIterations = 1,
292 itkGetConstReferenceMacro(StopCondition, StopConditionType);
295 itkGetConstReferenceMacro(NumberOfIterations,
unsigned int);
297 #ifdef ITK_USE_CONCEPT_CHECKING
315 void PrintSelf(std::ostream & os,
Indent indent)
const override;
324 virtual void ApplyMRFImageFilter();
327 virtual void MinimizeFunctional();
343 void GenerateData()
override;
345 void GenerateInputRequestedRegion()
override;
347 void EnlargeOutputRequestedRegion(
DataObject *)
override;
349 void GenerateOutputInformation()
override;
366 unsigned int m_NumberOfClasses{0};
367 unsigned int m_MaximumNumberOfIterations{50};
370 int m_ErrorCounter{0};
371 int m_NeighborhoodSize{27};
372 int m_TotalNumberOfValidPixelsInOutputImage{1};
373 int m_TotalNumberOfPixelsInInputImage{1};
374 double m_ErrorTolerance{0.2};
375 double m_SmoothingFactor{1};
376 double * m_ClassProbability{
nullptr};
377 unsigned int m_NumberOfIterations{0};
393 virtual void SetDefaultMRFNeighborhoodWeight();
396 void ApplyICMLabeller();
400 #ifndef ITK_MANUAL_INSTANTIATION
401 #include "itkMRFImageFilter.hxx"
typename TInputImage::ConstPointer InputImageConstPointer
typename TClassifiedImage::RegionType LabelledImageRegionType
TInputImage InputImageType
Light weight base class for most itk classes.
typename TClassifiedImage::IndexType LabelledImageIndexType
typename LabelledImageFaceListType::iterator LabelledImageFaceListIterator
typename TInputImage::SizeType InputImageSizeType
std::vector< double > m_MahalanobisDistance
unsigned long SizeValueType
typename TClassifiedImage::Pointer LabelledImagePointer
std::vector< double > m_MRFNeighborhoodWeight
typename TInputImage::PixelType InputImagePixelType
typename TClassifiedImage::PixelType TrainingImagePixelType
typename TClassifiedImage::OffsetType LabelledImageOffsetType
LabelStatusImagePointer m_LabelStatusImage
Base class for the ImageClassifierBase object.
std::vector< double > m_DummyVector
Implementation of a labeller object that uses Markov Random Fields to classify pixels in an image dat...
typename TInputImage::SizeType SizeType
std::list< RegionType > FaceListType
ClassifierType::Pointer m_ClassifierPtr
Splits an image into a main region and several "face" regions which are used to handle computations o...
typename TClassifiedImage::Pointer TrainingImagePointer
typename InputImageFacesCalculator::FaceListType InputImageFaceListType
ImageBaseType::SizeType SizeType
typename LabelStatusImageType::IndexType LabelStatusIndexType
ImageBaseType::IndexType IndexType
typename LabelStatusImageFacesCalculator::FaceListType LabelStatusImageFaceListType
A multi-dimensional iterator templated over image type that walks a region of pixels.
signed long IndexValueType
unsigned int m_KernelSize
typename InputImageNeighborhoodIterator::RadiusType InputImageNeighborhoodRadiusType
LabelStatusImageNeighborhoodRadiusType m_LabelStatusImageNeighborhoodRadius
typename Superclass::OutputImagePointer OutputImagePointer
InputImageNeighborhoodRadiusType m_InputImageNeighborhoodRadius
virtual std::vector< double > GetMRFNeighborhoodWeight()
const NeighborhoodRadiusType GetNeighborhoodRadius() const
typename TInputImage::SizeType NeighborhoodRadiusType
typename TInputImage::RegionType InputImageRegionType
typename Superclass::RadiusType RadiusType
LabelledImageNeighborhoodRadiusType m_LabelledImageNeighborhoodRadius
typename TInputImage::Pointer InputImagePointer
typename TClassifiedImage::PixelType LabelledImagePixelType
typename LabelStatusImageType::RegionType LabelStatusRegionType
typename LabelStatusImageType::Pointer LabelStatusImagePointer
Base class for filters that take an image as input and produce an image as output.
typename InputImageFaceListType::iterator InputImageFaceListIterator
Control indentation during Print() invocation.
typename LabelledImageIndexType::IndexValueType IndexValueType
typename LabelledImageFacesCalculator::FaceListType LabelledImageFaceListType
std::vector< double > m_NeighborInfluence
typename LabelStatusImageFaceListType::iterator LabelStatusImageFaceListIterator
StopConditionType m_StopCondition
Base class for most ITK classes.
ImageBaseType::RegionType RegionType
#define itkConceptMacro(name, concept)
typename LabelStatusImageNeighborhoodIterator::RadiusType LabelStatusImageNeighborhoodRadiusType
Base class for all data objects in ITK.
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
Templated n-dimensional image class.
A multi-dimensional iterator templated over image type that walks a region of pixels.
typename LabelledImageNeighborhoodIterator::RadiusType LabelledImageNeighborhoodRadiusType