ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkStatisticsRelabelImageFilter.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 itkStatisticsRelabelImageFilter_h
19#define itkStatisticsRelabelImageFilter_h
20
25
26namespace itk
27{
44template <typename TInputImage, typename TFeatureImage>
45class ITK_TEMPLATE_EXPORT StatisticsRelabelImageFilter : public ImageToImageFilter<TInputImage, TInputImage>
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(StatisticsRelabelImageFilter);
49
55
57 using InputImageType = TInputImage;
58 using OutputImageType = TInputImage;
59 using InputImagePointer = typename InputImageType::Pointer;
60 using InputImageConstPointer = typename InputImageType::ConstPointer;
61 using InputImageRegionType = typename InputImageType::RegionType;
62 using InputImagePixelType = typename InputImageType::PixelType;
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
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
85
87 itkNewMacro(Self);
88
90 itkOverrideGetNameOfClassMacro(StatisticsRelabelImageFilter);
91
95
100 itkSetMacro(BackgroundValue, OutputImagePixelType);
101 itkGetConstMacro(BackgroundValue, OutputImagePixelType);
103
109 itkGetConstMacro(ReverseOrdering, bool);
110 itkSetMacro(ReverseOrdering, bool);
111 itkBooleanMacro(ReverseOrdering);
113
117 itkGetConstMacro(Attribute, AttributeType);
118 itkSetMacro(Attribute, AttributeType);
119 void
120 SetAttribute(const std::string & s)
121 {
123 }
124
125
127 void
128 SetFeatureImage(TFeatureImage * input)
129 {
130 // Process object is not const-correct so the const casting is required.
131 this->SetNthInput(1, const_cast<TFeatureImage *>(input));
132 }
133
135 FeatureImageType *
137 {
138 return static_cast<FeatureImageType *>(const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
139 }
140
142 void
144 {
145 this->SetInput(input);
146 }
147
149 void
151 {
152 this->SetFeatureImage(input);
153 }
154
155protected:
157 ~StatisticsRelabelImageFilter() override = default;
158 void
159 PrintSelf(std::ostream & os, Indent indent) const override;
160
164 void
166
168 void
169 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
170
173 void
174 GenerateData() override;
175
176private:
180}; // end of class
181} // end namespace itk
182
183#ifndef ITK_MANUAL_INSTANTIATION
184# include "itkStatisticsRelabelImageFilter.hxx"
185#endif
186
187#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
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.
typename InputImageType::RegionType InputImageRegionType
LabelMapToLabelImageFilter< LabelMapType, OutputImageType > BinarizerType
virtual void SetAttribute(AttributeType _arg)
StatisticsLabelMapFilter< LabelMapType, TFeatureImage > LabelObjectValuatorType
typename OutputImageType::RegionType OutputImageRegionType
StatisticsLabelObject< InputImagePixelType, Self::ImageDimension > LabelObjectType
void PrintSelf(std::ostream &os, Indent indent) const override
typename OutputImageType::Pointer OutputImagePointer
LabelImageToLabelMapFilter< InputImageType, LabelMapType > LabelizerType
typename InputImageType::ConstPointer InputImageConstPointer
ImageToImageFilter< TInputImage, TInputImage > Superclass
typename FeatureImageType::PixelType FeatureImagePixelType
typename FeatureImageType::Pointer FeatureImagePointer
StatisticsRelabelLabelMapFilter< LabelMapType > RelabelType
typename LabelObjectType::AttributeType AttributeType
static constexpr unsigned int InputImageDimension
typename OutputImageType::PixelType OutputImagePixelType
static constexpr unsigned int OutputImageDimension
void EnlargeOutputRequestedRegion(DataObject *output) override
typename InputImageType::Pointer InputImagePointer
void GenerateInputRequestedRegion() override
typename InputImageType::PixelType InputImagePixelType
typename FeatureImageType::ConstPointer FeatureImageConstPointer
~StatisticsRelabelImageFilter() override=default
typename OutputImageType::ConstPointer OutputImageConstPointer
relabel objects according to their shape attributes
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....