ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLabelStatisticsOpeningImageFilter.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 itkLabelStatisticsOpeningImageFilter_h
19#define itkLabelStatisticsOpeningImageFilter_h
20
25
26namespace itk
27{
45template <typename TInputImage, typename TFeatureImage>
46class ITK_TEMPLATE_EXPORT LabelStatisticsOpeningImageFilter : public ImageToImageFilter<TInputImage, TInputImage>
47{
48public:
49 ITK_DISALLOW_COPY_AND_MOVE(LabelStatisticsOpeningImageFilter);
50
56
58 using InputImageType = TInputImage;
59 using OutputImageType = TInputImage;
60 using InputImagePointer = typename InputImageType::Pointer;
61 using InputImageConstPointer = typename InputImageType::ConstPointer;
62 using InputImageRegionType = typename InputImageType::RegionType;
63 using InputImagePixelType = typename InputImageType::PixelType;
64 using OutputImagePointer = typename OutputImageType::Pointer;
65 using OutputImageConstPointer = typename OutputImageType::ConstPointer;
66 using OutputImageRegionType = typename OutputImageType::RegionType;
67 using OutputImagePixelType = typename OutputImageType::PixelType;
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
86
88 itkNewMacro(Self);
89
91 itkOverrideGetNameOfClassMacro(LabelStatisticsOpeningImageFilter);
92
96
101 itkSetMacro(BackgroundValue, OutputImagePixelType);
102 itkGetConstMacro(BackgroundValue, OutputImagePixelType);
104
108 itkGetConstMacro(Lambda, double);
109 itkSetMacro(Lambda, double);
111
118 itkGetConstMacro(ReverseOrdering, bool);
119 itkSetMacro(ReverseOrdering, bool);
120 itkBooleanMacro(ReverseOrdering);
122
127 itkGetConstMacro(Attribute, AttributeType);
128 itkSetMacro(Attribute, AttributeType);
129 void
130 SetAttribute(const std::string & s)
131 {
133 }
134
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
165protected:
168 void
169 PrintSelf(std::ostream & os, Indent indent) const override;
170
174 void
176
178 void
179 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
180
183 void
184 GenerateData() override;
185
186private:
188 double m_Lambda{};
191}; // end of class
192} // end namespace itk
193
194#ifndef ITK_MANUAL_INSTANTIATION
195# include "itkLabelStatisticsOpeningImageFilter.hxx"
196#endif
197
198#endif
Base class for all data objects in ITK.
virtual void SetInput(const InputImageType *input)
Control indentation during Print() invocation.
Definition itkIndent.h:50
convert a labeled image to a label collection image
Converts a LabelMap to a labeled image.
Templated n-dimensional image to store labeled objects.
Definition itkLabelMap.h:71
void EnlargeOutputRequestedRegion(DataObject *output) override
virtual void SetAttribute(AttributeType _arg)
LabelMapToLabelImageFilter< LabelMapType, OutputImageType > BinarizerType
ImageToImageFilter< TInputImage, TInputImage > Superclass
LabelImageToLabelMapFilter< InputImageType, LabelMapType > LabelizerType
typename OutputImageType::RegionType OutputImageRegionType
StatisticsLabelMapFilter< LabelMapType, TFeatureImage > LabelObjectValuatorType
void PrintSelf(std::ostream &os, Indent indent) const override
typename LabelObjectType::AttributeType AttributeType
typename FeatureImageType::PixelType FeatureImagePixelType
~LabelStatisticsOpeningImageFilter() override=default
typename InputImageType::ConstPointer InputImageConstPointer
typename FeatureImageType::ConstPointer FeatureImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
StatisticsLabelObject< InputImagePixelType, Self::ImageDimension > LabelObjectType
StatisticsOpeningLabelMapFilter< LabelMapType > OpeningType
virtual void SetNthInput(DataObjectPointerArraySizeType idx, DataObject *input)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Implements transparent reference counting.
The valuator class for the StatisticsLabelObject.
A Label object to store the common attributes related to the statistics of the object.
remove the objects according to the value of their statistics attribute
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....