18#ifndef itkMRFImageFilter_h
19#define itkMRFImageFilter_h
21#include "vnl/vnl_vector.h"
22#include "vnl/vnl_matrix.h"
31#include "ITKMarkovRandomFieldsClassifiersExport.h"
49 MaximumNumberOfIterations = 1,
55extern ITKMarkovRandomFieldsClassifiers_EXPORT std::ostream &
148template <
typename TInputImage,
typename TClassifiedImage>
160 using typename Superclass::OutputImagePointer;
184 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
215 static constexpr unsigned int ClassifiedImageDimension = TClassifiedImage::ImageDimension;
253 itkSetMacro(NumberOfClasses,
unsigned int);
254 itkGetConstMacro(NumberOfClasses,
unsigned int);
259 itkSetMacro(MaximumNumberOfIterations,
unsigned int);
260 itkGetConstMacro(MaximumNumberOfIterations,
unsigned int);
265 itkSetMacro(ErrorTolerance,
double);
266 itkGetConstMacro(ErrorTolerance,
double);
271 itkSetMacro(SmoothingFactor,
double);
272 itkGetConstMacro(SmoothingFactor,
double);
295 for (
int i = 0; i < InputImageDimension; ++i)
297 radius[i] = m_InputImageNeighborhoodRadius[i];
310 virtual std::vector<double>
313 return m_MRFNeighborhoodWeight;
317#if !defined(ITK_LEGACY_REMOVE)
321 static constexpr MRFStopEnum MaximumNumberOfIterations = MRFStopEnum::MaximumNumberOfIterations;
322 static constexpr MRFStopEnum ErrorTolerance = MRFStopEnum::ErrorTolerance;
330 itkGetConstReferenceMacro(NumberOfIterations,
unsigned int);
332#ifdef ITK_USE_CONCEPT_CHECKING
407 unsigned int m_NumberOfClasses{ 0 };
408 unsigned int m_MaximumNumberOfIterations{ 50 };
409 unsigned int m_KernelSize{};
411 int m_ErrorCounter{ 0 };
412 int m_NeighborhoodSize{ 27 };
413 int m_TotalNumberOfValidPixelsInOutputImage{ 1 };
414 int m_TotalNumberOfPixelsInInputImage{ 1 };
415 double m_ErrorTolerance{ 0.2 };
416 double m_SmoothingFactor{ 1 };
417 double * m_ClassProbability{
nullptr };
418 unsigned int m_NumberOfIterations{ 0 };
419 MRFStopEnum m_StopCondition{ MRFStopEnum::MaximumNumberOfIterations };
423 std::vector<double> m_MRFNeighborhoodWeight{};
424 std::vector<double> m_NeighborInfluence{};
425 std::vector<double> m_MahalanobisDistance{};
426 std::vector<double> m_DummyVector{};
443#ifndef ITK_MANUAL_INSTANTIATION
444# include "itkMRFImageFilter.hxx"
Base class for all data objects in ITK.
Base class for the ImageClassifierBase object.
A multi-dimensional iterator templated over image type that walks a region of pixels.
A multi-dimensional iterator templated over image type that walks a region of pixels.
Base class for filters that take an image as input and produce an image as output.
Templated n-dimensional image class.
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Contains all enum classes in MRFImageFilter class;.
Implementation of a labeler object that uses Markov Random Fields to classify pixels in an image data...
virtual void SetMRFNeighborhoodWeight(std::vector< double > betaMatrix)
typename TClassifiedImage::OffsetType LabelledImageOffsetType
typename LabelledImageIndexType::IndexValueType IndexValueType
void GenerateData() override
virtual void DoNeighborhoodOperation(const InputImageNeighborhoodIterator &imageIter, LabelledImageNeighborhoodIterator &labelledIter, LabelStatusImageNeighborhoodIterator &labelStatusIter)
void SetNeighborhoodRadius(const SizeValueType)
typename InputImageNeighborhoodIterator::RadiusType InputImageNeighborhoodRadiusType
void SetClassifier(typename ClassifierType::Pointer ptrToClassifier)
typename TInputImage::RegionType InputImageRegionType
typename TClassifiedImage::Pointer TrainingImagePointer
void SetNeighborhoodRadius(const NeighborhoodRadiusType &)
void GenerateOutputInformation() override
typename InputImageFacesCalculator::FaceListType InputImageFaceListType
typename TInputImage::SizeType SizeType
virtual void MinimizeFunctional()
const NeighborhoodRadiusType GetNeighborhoodRadius() const
typename TInputImage::ConstPointer InputImageConstPointer
typename InputImageFaceListType::iterator InputImageFaceListIterator
typename LabelStatusImageType::RegionType LabelStatusRegionType
virtual void SetDefaultMRFNeighborhoodWeight()
typename TInputImage::SizeType InputImageSizeType
void GenerateInputRequestedRegion() override
typename TClassifiedImage::PixelType LabelledImagePixelType
typename TInputImage::SizeType NeighborhoodRadiusType
void PrintSelf(std::ostream &os, Indent indent) const override
typename LabelStatusImageFacesCalculator::FaceListType LabelStatusImageFaceListType
void SetNeighborhoodRadius(const SizeValueType *radiusArray)
typename TClassifiedImage::IndexType LabelledImageIndexType
~MRFImageFilter() override=default
typename TInputImage::Pointer InputImagePointer
typename TClassifiedImage::Pointer LabelledImagePointer
typename TClassifiedImage::RegionType LabelledImageRegionType
typename TClassifiedImage::PixelType TrainingImagePixelType
typename LabelledImageFaceListType::iterator LabelledImageFaceListIterator
void EnlargeOutputRequestedRegion(DataObject *) override
typename TInputImage::PixelType InputImagePixelType
virtual void ApplyMRFImageFilter()
TInputImage InputImageType
typename LabelStatusImageFaceListType::iterator LabelStatusImageFaceListIterator
typename LabelStatusImageNeighborhoodIterator::RadiusType LabelStatusImageNeighborhoodRadiusType
typename LabelStatusImageType::IndexType LabelStatusIndexType
typename LabelledImageFacesCalculator::FaceListType LabelledImageFaceListType
typename LabelStatusImageType::Pointer LabelStatusImagePointer
typename LabelledImageNeighborhoodIterator::RadiusType LabelledImageNeighborhoodRadiusType
virtual std::vector< double > GetMRFNeighborhoodWeight()
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
unsigned long SizeValueType
Splits an image into a main region and several "face" regions which are used to handle computations o...
std::list< RegionType > FaceListType