ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLabelOverlapMeasuresImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkLabelOverlapMeasuresImageFilter_h
19#define itkLabelOverlapMeasuresImageFilter_h
20
21#include "itkImageSink.h"
22#include "itkNumericTraits.h"
23#include <mutex>
24#include <unordered_map>
25
26namespace itk
27{
28
44template <typename TLabelImage>
45class ITK_TEMPLATE_EXPORT LabelOverlapMeasuresImageFilter : public ImageSink<TLabelImage>
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(LabelOverlapMeasuresImageFilter);
49
55
57 itkNewMacro(Self);
58
60 itkOverrideGetNameOfClassMacro(LabelOverlapMeasuresImageFilter);
61
63 using LabelImageType = TLabelImage;
64 using LabelImagePointer = typename TLabelImage::Pointer;
65 using LabelImageConstPointer = typename TLabelImage::ConstPointer;
66
67 using RegionType = typename TLabelImage::RegionType;
68 using SizeType = typename TLabelImage::SizeType;
69 using IndexType = typename TLabelImage::IndexType;
70
71 using LabelType = typename TLabelImage::PixelType;
72
75
92
94 using MapType = std::unordered_map<LabelType, LabelSetMeasures>;
95 using MapIterator = typename MapType::iterator;
96 using MapConstIterator = typename MapType::const_iterator;
97
99 static constexpr unsigned int ImageDimension = TLabelImage::ImageDimension;
100
107
108
110 MapType
112 {
113 return this->m_LabelSetMeasures;
114 }
115
116 // Overlap agreement metrics
117
121
124
130 {
131 return this->GetUnionOverlap();
132 }
133
134
140 {
141 return this->GetUnionOverlap(label);
142 }
143
144
150 {
151 return this->GetMeanOverlap();
152 }
153
154
160 {
161 return this->GetMeanOverlap(label);
162 }
163
164
168
171
172 // Overlap error metrics
173
177
180
184
187
191
194
195 itkConceptMacro(Input1HasNumericTraitsCheck, (Concept::HasNumericTraits<LabelType>));
196
197protected:
200
203
204 void
205 PrintSelf(std::ostream & os, Indent indent) const override;
206
207 void
209
210 void
212
213 void
214 MergeMap(MapType & m1, MapType & m2) const;
215
216private:
218
219 std::mutex m_Mutex{};
220}; // end of class
221
222} // end namespace itk
223
224#ifndef ITK_MANUAL_INSTANTIATION
225# include "itkLabelOverlapMeasuresImageFilter.hxx"
226#endif
227
228#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
typename TLabelImage::ConstPointer LabelImageConstPointer
typename NumericTraits< LabelType >::RealType RealType
itkSetInputMacro(SourceImage, LabelImageType)
RealType GetUnionOverlap(LabelType) const
itkSetInputMacro(TargetImage, LabelImageType)
RealType GetFalsePositiveError(LabelType) const
RealType GetFalseDiscoveryRate(LabelType) const
RealType GetVolumeSimilarity(LabelType) const
RealType GetMeanOverlap(LabelType) const
void ThreadedStreamedGenerateData(const RegionType &) override
RealType GetTargetOverlap(LabelType) const
~LabelOverlapMeasuresImageFilter() override=default
typename NumericTraits< LabelType >::PrintType PrintType
itkGetInputMacro(SourceImage, LabelImageType)
void PrintSelf(std::ostream &os, Indent indent) const override
RealType GetFalseNegativeError(LabelType) const
itkGetInputMacro(TargetImage, LabelImageType)
std::unordered_map< LabelType, LabelSetMeasures > MapType
void MergeMap(MapType &m1, MapType &m2) const
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86