ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkShapeLabelMapFilter.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 itkShapeLabelMapFilter_h
19#define itkShapeLabelMapFilter_h
20
23
24namespace itk
25{
51
52template <typename TImage, typename TLabelImage = Image<typename TImage::PixelType, TImage::ImageDimension>>
53class ITK_TEMPLATE_EXPORT ShapeLabelMapFilter : public InPlaceLabelMapFilter<TImage>
54{
55public:
56 ITK_DISALLOW_COPY_AND_MOVE(ShapeLabelMapFilter);
57
63
65 using ImageType = TImage;
66 using ImagePointer = typename ImageType::Pointer;
67 using ImageConstPointer = typename ImageType::ConstPointer;
68 using PixelType = typename ImageType::PixelType;
69 using IndexType = typename ImageType::IndexType;
70 using SizeType = typename ImageType::SizeType;
71 using RegionType = typename ImageType::RegionType;
72 using OffsetType = typename ImageType::OffsetType;
73 using LabelObjectType = typename ImageType::LabelObjectType;
74 using MatrixType = typename LabelObjectType::MatrixType;
75 using VectorType = typename LabelObjectType::VectorType;
76
77 using LabelImageType = TLabelImage;
78 using LabelImagePointer = typename LabelImageType::Pointer;
79 using LabelImageConstPointer = typename LabelImageType::ConstPointer;
80 using LabelPixelType = typename LabelImageType::PixelType;
81
83 static constexpr unsigned int ImageDimension = TImage::ImageDimension;
84
86 itkNewMacro(Self);
87
89 itkOverrideGetNameOfClassMacro(ShapeLabelMapFilter);
90
91 /*itkConceptMacro(InputEqualityComparableCheck,
92 (Concept::EqualityComparable<InputImagePixelType>));
93 itkConceptMacro(IntConvertibleToInputCheck,
94 (Concept::Convertible<int, InputImagePixelType>));
95 itkConceptMacro(InputOStreamWritableCheck,
96 (Concept::OStreamWritable<InputImagePixelType>));*/
97
102 itkSetMacro(ComputeFeretDiameter, bool);
103 itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
104 itkBooleanMacro(ComputeFeretDiameter);
106
111 itkSetMacro(ComputePerimeter, bool);
112 itkGetConstReferenceMacro(ComputePerimeter, bool);
113 itkBooleanMacro(ComputePerimeter);
115
121 itkSetMacro(ComputeOrientedBoundingBox, bool);
122 itkGetConstReferenceMacro(ComputeOrientedBoundingBox, bool);
125
127 void
128 SetLabelImage(const TLabelImage * input)
129 {
130 m_LabelImage = input;
131 }
132
133protected:
135 ~ShapeLabelMapFilter() override = default;
136
137 void
139
140 void
142
143 void
145
146 void
147 PrintSelf(std::ostream & os, Indent indent) const override;
148
149private:
154
155 void
157 void
159 void
161
166 using MapIntercept2Type = std::map<Offset2Type, SizeValueType, Functor::LexicographicCompare>;
167 using MapIntercept3Type = std::map<Offset3Type, SizeValueType, Functor::LexicographicCompare>;
168
169 // it seems impossible to specialize a method without specializing the whole class, but we
170 // can use simple overloading
171 template <typename TMapIntercept, typename TSpacing>
172 double
173 PerimeterFromInterceptCount(TMapIntercept & intercepts, const TSpacing & spacing);
174#if !defined(ITK_DO_NOT_USE_PERIMETER_SPECIALIZATION)
175 double
177 double
179#endif
180};
181
182
183} // end namespace itk
184
185#ifndef ITK_MANUAL_INSTANTIATION
186# include "itkShapeLabelMapFilter.hxx"
187#endif
188
189#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
void SetLabelImage(const TLabelImage *input)
double PerimeterFromInterceptCount(MapIntercept2Type &intercepts, const Spacing2Type spacing)
double PerimeterFromInterceptCount(MapIntercept3Type &intercepts, const Spacing3Type spacing)
void BeforeThreadedGenerateData() override
void ThreadedProcessLabelObject(LabelObjectType *labelObject) override
std::map< Offset3Type, SizeValueType, Functor::LexicographicCompare > MapIntercept3Type
std::map< Offset2Type, SizeValueType, Functor::LexicographicCompare > MapIntercept2Type
double PerimeterFromInterceptCount(TMapIntercept &intercepts, const TSpacing &spacing)
void PrintSelf(std::ostream &os, Indent indent) const override
void AfterThreadedGenerateData() override
~ShapeLabelMapFilter() override=default
Implements transparent reference counting.
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
Definition itkOffset.h:67