ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkBinaryImageToStatisticsLabelMapFilter.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 itkBinaryImageToStatisticsLabelMapFilter_h
19#define itkBinaryImageToStatisticsLabelMapFilter_h
20
24
25namespace itk
26{
40template <typename TInputImage,
41 typename TFeatureImage,
43class ITK_TEMPLATE_EXPORT BinaryImageToStatisticsLabelMapFilter : public ImageToImageFilter<TInputImage, TOutputImage>
44{
45public:
46 ITK_DISALLOW_COPY_AND_MOVE(BinaryImageToStatisticsLabelMapFilter);
47
53
55 using InputImageType = TInputImage;
56 using InputImagePointer = typename InputImageType::Pointer;
57 using InputImageConstPointer = typename InputImageType::ConstPointer;
58 using InputImageRegionType = typename InputImageType::RegionType;
59 using InputImagePixelType = typename InputImageType::PixelType;
60
61 using OutputImageType = TOutputImage;
62 using OutputImagePointer = typename OutputImageType::Pointer;
63 using OutputImageConstPointer = typename OutputImageType::ConstPointer;
64 using OutputImageRegionType = typename OutputImageType::RegionType;
65 using OutputImagePixelType = typename OutputImageType::PixelType;
66 using LabelObjectType = typename OutputImageType::LabelObjectType;
67
68 using FeatureImageType = TFeatureImage;
69 using FeatureImagePointer = typename FeatureImageType::Pointer;
70 using FeatureImageConstPointer = typename FeatureImageType::ConstPointer;
71 using FeatureImagePixelType = typename FeatureImageType::PixelType;
72
74 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
75 static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
76 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
77
80
82 itkNewMacro(Self);
83
85 itkOverrideGetNameOfClassMacro(BinaryImageToStatisticsLabelMapFilter);
86
93 itkSetMacro(FullyConnected, bool);
94 itkGetConstReferenceMacro(FullyConnected, bool);
95 itkBooleanMacro(FullyConnected);
97
101
106 itkSetMacro(OutputBackgroundValue, OutputImagePixelType);
107 itkGetConstMacro(OutputBackgroundValue, OutputImagePixelType);
109
114 itkSetMacro(InputForegroundValue, InputImagePixelType);
115 itkGetConstMacro(InputForegroundValue, InputImagePixelType);
117
122 itkSetMacro(ComputeFeretDiameter, bool);
123 itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
124 itkBooleanMacro(ComputeFeretDiameter);
126
131 itkSetMacro(ComputePerimeter, bool);
132 itkGetConstReferenceMacro(ComputePerimeter, bool);
133 itkBooleanMacro(ComputePerimeter);
135
137 void
138 SetFeatureImage(const TFeatureImage * input)
139 {
140 // Process object is not const-correct so the const casting is required.
141 this->SetNthInput(1, const_cast<TFeatureImage *>(input));
142 }
143
145 const FeatureImageType *
147 {
148 return static_cast<const FeatureImageType *>(this->ProcessObject::GetInput(1));
149 }
150
152 void
154 {
155 this->SetInput(input);
156 }
157
159 void
161 {
162 this->SetFeatureImage(input);
163 }
164
171 itkSetMacro(ComputeHistogram, bool);
172 itkGetConstReferenceMacro(ComputeHistogram, bool);
173 itkBooleanMacro(ComputeHistogram);
175
181 itkSetMacro(NumberOfBins, unsigned int);
182 itkGetConstReferenceMacro(NumberOfBins, unsigned int);
184
185protected:
188 void
189 PrintSelf(std::ostream & os, Indent indent) const override;
190
194 void
196
198 void
199 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
200
203 void
204 GenerateData() override;
205
206private:
212 unsigned int m_NumberOfBins{};
214}; // end of class
215} // end namespace itk
216
217#ifndef ITK_MANUAL_INSTANTIATION
218# include "itkBinaryImageToStatisticsLabelMapFilter.hxx"
219#endif
220
221#endif
Label the connected components in a binary image and produce a collection of label objects.
~BinaryImageToStatisticsLabelMapFilter() override=default
StatisticsLabelMapFilter< OutputImageType, FeatureImageType > LabelObjectValuatorType
void EnlargeOutputRequestedRegion(DataObject *output) override
void PrintSelf(std::ostream &os, Indent indent) const override
BinaryImageToLabelMapFilter< InputImageType, OutputImageType > LabelizerType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Base class for all data objects in ITK.
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition itkIndent.h:50
Templated n-dimensional image to store labeled objects.
Definition itkLabelMap.h:71
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Implements transparent reference counting.
The valuator class for the StatisticsLabelObject.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....