18 #ifndef itkLabelOverlapMeasuresImageFilter_h
19 #define itkLabelOverlapMeasuresImageFilter_h
24 #include "itksys/hash_map.hxx"
44 template<
typename TLabelImage>
91 m_SourceComplement = 0;
92 m_TargetComplement = 0;
119 using MapType = itksys::hash_map<LabelType, LabelSetMeasures>;
124 static constexpr
unsigned int ImageDimension = TLabelImage::ImageDimension;
128 { this->SetNthInput( 0, const_cast<LabelImageType *>( image ) ); }
132 { this->SetNthInput( 1, const_cast<LabelImageType *>( image ) ); }
136 {
return this->GetInput( 0 ); }
140 {
return this->GetInput( 1 ); }
144 {
return this->m_LabelSetMeasures; }
149 RealType GetTotalOverlap()
const;
152 RealType GetTargetOverlap( LabelType )
const;
155 RealType GetUnionOverlap()
const;
157 {
return this->GetUnionOverlap(); }
162 RealType GetUnionOverlap( LabelType )
const;
164 {
return this->GetUnionOverlap( label ); }
168 RealType GetMeanOverlap()
const;
170 {
return this->GetMeanOverlap(); }
175 RealType GetMeanOverlap( LabelType )
const;
177 {
return this->GetMeanOverlap( label ); }
181 RealType GetVolumeSimilarity()
const;
184 RealType GetVolumeSimilarity( LabelType )
const;
189 RealType GetFalseNegativeError()
const;
192 RealType GetFalseNegativeError( LabelType )
const;
195 RealType GetFalsePositiveError()
const;
198 RealType GetFalsePositiveError( LabelType )
const;
200 #ifdef ITK_USE_CONCEPT_CHECKING
210 void PrintSelf( std::ostream& os,
Indent indent )
const override;
217 void AllocateOutputs()
override;
219 void BeforeThreadedGenerateData()
override;
221 void AfterThreadedGenerateData()
override;
228 itkExceptionMacro(
"This class requires threadId so it must use classic multi-threading model");
232 void EnlargeOutputRequestedRegion(
DataObject *data )
override;
241 #ifndef ITK_MANUAL_INSTANTIATION
242 #include "itkLabelOverlapMeasuresImageFilter.hxx"
typename TLabelImage::RegionType RegionType
typename TLabelImage::PixelType LabelType
Light weight base class for most itk classes.
TLabelImage LabelImageType
Define numeric traits for std::vector.
typename NumericTraits< LabelType >::RealType RealType
typename TLabelImage::ConstPointer LabelImageConstPointer
unsigned long m_Intersection
RealType GetDiceCoefficient() const
void DynamicThreadedGenerateData(const RegionType &) override
unsigned long m_TargetComplement
typename TLabelImage::SizeType SizeType
typename TLabelImage::Pointer LabelImagePointer
typename MapType::iterator MapIterator
RealType GetJaccardCoefficient(LabelType label) const
MapType GetLabelSetMeasures()
ImageBaseType::SizeType SizeType
RealType GetDiceCoefficient(LabelType label) const
MapType m_LabelSetMeasures
ImageBaseType::IndexType IndexType
typename TLabelImage::IndexType IndexType
std::vector< MapType > m_LabelSetMeasuresPerThread
RealType GetJaccardCoefficient() const
Computes overlap measures between the set same set of labels of pixels of two images. Background is assumed to be 0.
unsigned int ThreadIdType
void SetTargetImage(const LabelImageType *image)
typename MapType::const_iterator MapConstIterator
const LabelImageType * GetTargetImage()
Base class for filters that take an image as input and produce an image as output.
void SetSourceImage(const LabelImageType *image)
Control indentation during Print() invocation.
unsigned long m_SourceComplement
itksys::hash_map< LabelType, LabelSetMeasures > MapType
ImageBaseType::RegionType RegionType
#define itkConceptMacro(name, concept)
Base class for all data objects in ITK.
Metrics stored per label.
const LabelImageType * GetSourceImage()
LabelSetMeasures & operator=(const LabelSetMeasures &l)