18 #ifndef itkMultiLabelSTAPLEImageFilter_h
19 #define itkMultiLabelSTAPLEImageFilter_h
117 template <
typename TInputImage,
typename TOutputImage = TInputImage,
typename TWeights =
float >
141 itkStaticConstMacro(ImageDimension,
unsigned int,
142 TOutputImage::ImageDimension);
163 itkGetConstMacro(ElapsedNumberOfIterations,
unsigned int);
169 this->m_MaximumNumberOfIterations = mit;
170 this->m_HasMaximumNumberOfIterations =
true;
173 itkGetConstMacro(MaximumNumberOfIterations,
unsigned int);
177 itkGetConstMacro(HasMaximumNumberOfIterations,
bool);
183 if ( this->m_HasMaximumNumberOfIterations )
185 this->m_HasMaximumNumberOfIterations =
false;
193 itkSetMacro(TerminationUpdateThreshold, TWeights);
194 itkGetConstMacro(TerminationUpdateThreshold, TWeights);
201 this->m_LabelForUndecidedPixels = l;
202 this->m_HasLabelForUndecidedPixels =
true;
214 itkGetMacro(LabelForUndecidedPixels, OutputPixelType);
217 itkGetMacro(HasLabelForUndecidedPixels,
bool);
223 if ( this->m_HasLabelForUndecidedPixels )
225 this->m_HasLabelForUndecidedPixels =
false;
239 this->m_PriorProbabilities = ppa;
240 this->m_HasPriorProbabilities =
true;
252 itkGetConstReferenceMacro(PriorProbabilities, PriorProbabilitiesType);
255 itkGetMacro(HasPriorProbabilities,
bool);
261 if ( this->m_HasPriorProbabilities )
263 this->m_HasPriorProbabilities =
false;
273 return this->m_ConfusionMatrixArray[i];
278 m_TotalLabelCount(0),
280 m_HasLabelForUndecidedPixels(false),
281 m_HasPriorProbabilities(false),
282 m_HasMaximumNumberOfIterations(false),
283 m_MaximumNumberOfIterations(0),
284 m_ElapsedNumberOfIterations(0u),
285 m_TerminationUpdateThreshold(1
e-5)
290 void GenerateData() ITK_OVERRIDE;
292 void PrintSelf(std::ostream&,
Indent) const ITK_OVERRIDE;
295 typename TInputImage::PixelType ComputeMaximumInputValue();
298 void GenerateInputRequestedRegion() ITK_OVERRIDE;
301 void EnlargeOutputRequestedRegion(
DataObject * ) ITK_OVERRIDE;
306 size_t m_TotalLabelCount;
309 bool m_HasLabelForUndecidedPixels;
311 bool m_HasPriorProbabilities;
314 void InitializePriorProbabilities();
319 void AllocateConfusionMatrixArray();
320 void InitializeConfusionMatrixArrayFromVoting();
322 bool m_HasMaximumNumberOfIterations;
323 unsigned int m_MaximumNumberOfIterations;
324 unsigned int m_ElapsedNumberOfIterations;
326 TWeights m_TerminationUpdateThreshold;
331 #ifndef ITK_MANUAL_INSTANTIATION
332 #include "itkMultiLabelSTAPLEImageFilter.hxx"
Array2D< WeightsType > ConfusionMatrixType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
void UnsetPriorProbabilities()
Array< WeightsType > PriorProbabilitiesType
void UnsetMaximumNumberOfIterations()
TInputImage::PixelType InputPixelType
Base class for all process objects that output image data.
void SetLabelForUndecidedPixels(const OutputPixelType l)
OutputImageType::Pointer OutputImagePointer
virtual ~MultiLabelSTAPLEImageFilter() override
InputImageType::Pointer InputImagePointer
ImageRegionIterator< TOutputImage > OutputIteratorType
Array2D class representing a 2D array with size defined at construction time.
A multi-dimensional iterator templated over image type that walks a region of pixels.
MultiLabelSTAPLEImageFilter Self
MultiLabelSTAPLEImageFilter()
TOutputImage::PixelType OutputPixelType
const ConfusionMatrixType & GetConfusionMatrix(const unsigned int i) const
Superclass::OutputImageRegionType OutputImageRegionType
TOutputImage OutputImageType
ImageRegionConstIterator< TInputImage > InputConstIteratorType
void SetMaximumNumberOfIterations(const unsigned int mit)
SmartPointer< Self > Pointer
This filter performs a pixelwise combination of an arbitrary number of input images, where each of them represents a segmentation of the same scene (i.e., image).
void UnsetLabelForUndecidedPixels()
Base class for filters that take an image as input and produce an image as output.
void SetPriorProbabilities(const PriorProbabilitiesType &ppa)
Control indentation during Print() invocation.
TInputImage InputImageType
Define additional traits for native types such as int or float.
static ITK_CONSTEXPR_VAR double e
The base of the natural logarithm or Euler's number
SmartPointer< const Self > ConstPointer
Base class for all data objects in ITK.
A multi-dimensional iterator templated over image type that walks a region of pixels.