ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLabelImageToStatisticsLabelMapFilter.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 itkLabelImageToStatisticsLabelMapFilter_h
19#define itkLabelImageToStatisticsLabelMapFilter_h
20
24
25namespace itk
26{
40template <typename TInputImage,
41 typename TFeatureImage,
42 typename TOutputImage =
44class ITK_TEMPLATE_EXPORT LabelImageToStatisticsLabelMapFilter : public ImageToImageFilter<TInputImage, TOutputImage>
45{
46public:
47 ITK_DISALLOW_COPY_AND_MOVE(LabelImageToStatisticsLabelMapFilter);
48
54
56 using InputImageType = TInputImage;
57 using InputImagePointer = typename InputImageType::Pointer;
58 using InputImageConstPointer = typename InputImageType::ConstPointer;
59 using InputImageRegionType = typename InputImageType::RegionType;
60 using InputImagePixelType = typename InputImageType::PixelType;
61
62 using OutputImageType = TOutputImage;
63 using OutputImagePointer = typename OutputImageType::Pointer;
64 using OutputImageConstPointer = typename OutputImageType::ConstPointer;
65 using OutputImageRegionType = typename OutputImageType::RegionType;
66 using OutputImagePixelType = typename OutputImageType::PixelType;
67 using LabelObjectType = typename OutputImageType::LabelObjectType;
68
69 using FeatureImageType = TFeatureImage;
70 using FeatureImagePointer = typename FeatureImageType::Pointer;
71 using FeatureImageConstPointer = typename FeatureImageType::ConstPointer;
72 using FeatureImagePixelType = typename FeatureImageType::PixelType;
73
75 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
76 static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
77 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
78
81
83 itkNewMacro(Self);
84
86 itkOverrideGetNameOfClassMacro(LabelImageToStatisticsLabelMapFilter);
87
91
96 itkSetMacro(BackgroundValue, OutputImagePixelType);
97 itkGetConstMacro(BackgroundValue, OutputImagePixelType);
99
104 itkSetMacro(ComputeFeretDiameter, bool);
105 itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
106 itkBooleanMacro(ComputeFeretDiameter);
108
113 itkSetMacro(ComputePerimeter, bool);
114 itkGetConstReferenceMacro(ComputePerimeter, bool);
115 itkBooleanMacro(ComputePerimeter);
117
119 void
120 SetFeatureImage(const TFeatureImage * input)
121 {
122 // Process object is not const-correct so the const casting is required.
123 this->SetNthInput(1, const_cast<TFeatureImage *>(input));
124 }
125
127 const FeatureImageType *
129 {
130 return static_cast<FeatureImageType *>(this->ProcessObject::GetInput(1));
131 }
132
134 void
136 {
137 this->SetInput(input);
138 }
139
141 void
143 {
144 this->SetFeatureImage(input);
145 }
146
153 itkSetMacro(ComputeHistogram, bool);
154 itkGetConstReferenceMacro(ComputeHistogram, bool);
155 itkBooleanMacro(ComputeHistogram);
157
163 itkSetMacro(NumberOfBins, unsigned int);
164 itkGetConstReferenceMacro(NumberOfBins, unsigned int);
166
167protected:
170 void
171 PrintSelf(std::ostream & os, Indent indent) const override;
172
176 void
178
180 void
181 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
182
185 void
186 GenerateData() override;
187
188private:
192 unsigned int m_NumberOfBins{};
194}; // end of class
195} // end namespace itk
196
197#ifndef ITK_MANUAL_INSTANTIATION
198# include "itkLabelImageToStatisticsLabelMapFilter.hxx"
199#endif
200
201#endif
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
convert a labeled image to a label collection image
ImageToImageFilter< TInputImage, TOutputImage > Superclass
void PrintSelf(std::ostream &os, Indent indent) const override
void EnlargeOutputRequestedRegion(DataObject *output) override
typename FeatureImageType::ConstPointer FeatureImageConstPointer
LabelImageToLabelMapFilter< InputImageType, OutputImageType > LabelizerType
StatisticsLabelMapFilter< OutputImageType, FeatureImageType > LabelObjectValuatorType
~LabelImageToStatisticsLabelMapFilter() override=default
typename OutputImageType::LabelObjectType LabelObjectType
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....