ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLabelShapeKeepNObjectsImageFilter.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 itkLabelShapeKeepNObjectsImageFilter_h
19#define itkLabelShapeKeepNObjectsImageFilter_h
20
21#include "itkShapeLabelObject.h"
26
27namespace itk
28{
50template <typename TInputImage>
51class ITK_TEMPLATE_EXPORT LabelShapeKeepNObjectsImageFilter : public ImageToImageFilter<TInputImage, TInputImage>
52{
53public:
54 ITK_DISALLOW_COPY_AND_MOVE(LabelShapeKeepNObjectsImageFilter);
55
61
63 using InputImageType = TInputImage;
64 using OutputImageType = TInputImage;
65 using InputImagePointer = typename InputImageType::Pointer;
66 using InputImageConstPointer = typename InputImageType::ConstPointer;
67 using InputImageRegionType = typename InputImageType::RegionType;
68 using InputImagePixelType = typename InputImageType::PixelType;
69 using OutputImagePointer = typename OutputImageType::Pointer;
70 using OutputImageConstPointer = typename OutputImageType::ConstPointer;
71 using OutputImageRegionType = typename OutputImageType::RegionType;
72 using OutputImagePixelType = typename OutputImageType::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
87
89 itkNewMacro(Self);
90
92 itkOverrideGetNameOfClassMacro(LabelShapeKeepNObjectsImageFilter);
93
97
102 itkSetMacro(BackgroundValue, OutputImagePixelType);
103 itkGetConstMacro(BackgroundValue, OutputImagePixelType);
105
109 itkGetConstMacro(NumberOfObjects, SizeValueType);
110 itkSetMacro(NumberOfObjects, SizeValueType);
112
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
136protected:
139 void
140 PrintSelf(std::ostream & os, Indent indent) const override;
141
145 void
147
149 void
150 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
151
154 void
155 GenerateData() override;
156
157private:
162}; // end of class
163} // end namespace itk
164
165#ifndef ITK_MANUAL_INSTANTIATION
166# include "itkLabelShapeKeepNObjectsImageFilter.hxx"
167#endif
168
169#endif
Base class for all data objects in ITK.
Templated n-dimensional image class.
Definition itkImage.h:89
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
Image< typename OutputImageType::PixelType, Self::OutputImageDimension > ShapeLabelFilterOutput
LabelMapToLabelImageFilter< LabelMapType, OutputImageType > BinarizerType
typename OutputImageType::RegionType OutputImageRegionType
ShapeLabelObject< InputImagePixelType, Self::ImageDimension > LabelObjectType
typename OutputImageType::ConstPointer OutputImageConstPointer
void EnlargeOutputRequestedRegion(DataObject *output) override
virtual void SetAttribute(AttributeType _arg)
typename InputImageType::ConstPointer InputImageConstPointer
void PrintSelf(std::ostream &os, Indent indent) const override
ShapeLabelMapFilter< LabelMapType, ShapeLabelFilterOutput > LabelObjectValuatorType
LabelImageToLabelMapFilter< InputImageType, LabelMapType > LabelizerType
~LabelShapeKeepNObjectsImageFilter() override=default
typename LabelObjectType::AttributeType AttributeType
ShapeKeepNObjectsLabelMapFilter< LabelMapType > KeepNObjectsType
ImageToImageFilter< TInputImage, TInputImage > Superclass
Keep N objects according to their shape attributes.
The valuator class for the ShapeLabelObject.
A Label object to store the common attributes related to the shape of the object.
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86