18 #ifndef itkMultiLabelSTAPLEImageFilter_h
19 #define itkMultiLabelSTAPLEImageFilter_h
117 template <
typename TInputImage,
typename TOutputImage = TInputImage,
typename TWeights =
float >
143 static constexpr
unsigned int ImageDimension = TOutputImage::ImageDimension;
164 itkGetConstMacro(ElapsedNumberOfIterations,
unsigned int);
170 this->m_MaximumNumberOfIterations = mit;
171 this->m_HasMaximumNumberOfIterations =
true;
174 itkGetConstMacro(MaximumNumberOfIterations,
unsigned int);
178 itkGetConstMacro(HasMaximumNumberOfIterations,
bool);
184 if ( this->m_HasMaximumNumberOfIterations )
186 this->m_HasMaximumNumberOfIterations =
false;
194 itkSetMacro(TerminationUpdateThreshold, TWeights);
195 itkGetConstMacro(TerminationUpdateThreshold, TWeights);
202 this->m_LabelForUndecidedPixels = l;
203 this->m_HasLabelForUndecidedPixels =
true;
215 itkGetMacro(LabelForUndecidedPixels, OutputPixelType);
218 itkGetMacro(HasLabelForUndecidedPixels,
bool);
224 if ( this->m_HasLabelForUndecidedPixels )
226 this->m_HasLabelForUndecidedPixels =
false;
240 this->m_PriorProbabilities = ppa;
241 this->m_HasPriorProbabilities =
true;
253 itkGetConstReferenceMacro(PriorProbabilities, PriorProbabilitiesType);
256 itkGetMacro(HasPriorProbabilities,
bool);
262 if ( this->m_HasPriorProbabilities )
264 this->m_HasPriorProbabilities =
false;
274 return this->m_ConfusionMatrixArray[i];
280 m_TerminationUpdateThreshold(1
e-5)
285 void GenerateData()
override;
287 void PrintSelf(std::ostream&,
Indent)
const override;
290 typename TInputImage::PixelType ComputeMaximumInputValue();
293 void GenerateInputRequestedRegion()
override;
296 void EnlargeOutputRequestedRegion(
DataObject * )
override;
299 size_t m_TotalLabelCount{0};
302 bool m_HasLabelForUndecidedPixels{
false};
304 bool m_HasPriorProbabilities{
false};
307 void InitializePriorProbabilities();
312 void AllocateConfusionMatrixArray();
313 void InitializeConfusionMatrixArrayFromVoting();
315 bool m_HasMaximumNumberOfIterations{
false};
316 unsigned int m_MaximumNumberOfIterations{0};
317 unsigned int m_ElapsedNumberOfIterations{0u};
324 #ifndef ITK_MANUAL_INSTANTIATION
325 #include "itkMultiLabelSTAPLEImageFilter.hxx"
std::vector< ConfusionMatrixType > m_ConfusionMatrixArray
typename OutputImageType::Pointer OutputImagePointer
void UnsetPriorProbabilities()
Define numeric traits for std::vector.
typename TOutputImage::PixelType OutputPixelType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
void UnsetMaximumNumberOfIterations()
Base class for all process objects that output image data.
TWeights m_TerminationUpdateThreshold
TInputImage InputImageType
void SetLabelForUndecidedPixels(const OutputPixelType l)
OutputPixelType m_LabelForUndecidedPixels
typename InputImageType::Pointer InputImagePointer
Array2D class representing a 2D array with size defined at construction time.
typename OutputImageType::RegionType OutputImageRegionType
A multi-dimensional iterator templated over image type that walks a region of pixels.
TOutputImage OutputImageType
MultiLabelSTAPLEImageFilter()
const ConfusionMatrixType & GetConfusionMatrix(const unsigned int i) const
void SetMaximumNumberOfIterations(const unsigned int mit)
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()
std::vector< ConfusionMatrixType > m_UpdatedConfusionMatrixArray
static constexpr double e
The base of the natural logarithm or Euler's number
Base class for filters that take an image as input and produce an image as output.
PriorProbabilitiesType m_PriorProbabilities
void SetPriorProbabilities(const PriorProbabilitiesType &ppa)
Control indentation during Print() invocation.
typename TInputImage::PixelType InputPixelType
Base class for all data objects in ITK.
A multi-dimensional iterator templated over image type that walks a region of pixels.