ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkObjectByObjectLabelMapFilter.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 itkObjectByObjectLabelMapFilter_h
19#define itkObjectByObjectLabelMapFilter_h
20
21#include "itkLabelMapFilter.h"
28
29
30namespace itk
31{
32
79template <typename TInputImage,
80 typename TOutputImage = TInputImage,
83 class TOutputFilter = typename TInputFilter::Superclass,
84 class TInternalInputImage = typename TInputFilter::InputImageType,
85 class TInternalOutputImage = typename TOutputFilter::OutputImageType>
86class ITK_TEMPLATE_EXPORT ObjectByObjectLabelMapFilter : public LabelMapFilter<TInputImage, TOutputImage>
87{
88public:
89 ITK_DISALLOW_COPY_AND_MOVE(ObjectByObjectLabelMapFilter);
90
96
98 using InputImageType = TInputImage;
99 using OutputImageType = TOutputImage;
100 using InputImagePointer = typename InputImageType::Pointer;
101 using InputImageConstPointer = typename InputImageType::ConstPointer;
102 using InputImageRegionType = typename InputImageType::RegionType;
103 using InputImagePixelType = typename InputImageType::PixelType;
104 using OutputImagePointer = typename OutputImageType::Pointer;
105 using OutputImageConstPointer = typename OutputImageType::ConstPointer;
106 using OutputImageRegionType = typename OutputImageType::RegionType;
107 using OutputImagePixelType = typename OutputImageType::PixelType;
108 using SizeType = typename OutputImageType::SizeType;
110 using LabelObjectType = typename LabelMapType::LabelObjectType;
111
112 using InputFilterType = TInputFilter;
113 using OutputFilterType = TOutputFilter;
114
115 using InternalInputImageType = TInternalInputImage;
116 using InternalRegionType = typename InternalInputImageType::RegionType;
117 using InternalSizeType = typename InternalInputImageType::SizeType;
118 using InternalIndexType = typename InternalInputImageType::IndexType;
119 using InternalOffsetType = typename InternalInputImageType::OffsetType;
120 using InternalInputPixelType = typename InternalInputImageType::PixelType;
121
122 using InternalOutputImageType = TInternalOutputImage;
123 using InternalOutputPixelType = typename InternalOutputImageType::PixelType;
124
126 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
127 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
128 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
129
131 itkNewMacro(Self);
132
134 itkOverrideGetNameOfClassMacro(ObjectByObjectLabelMapFilter);
135
136 void
140 {
141 return this->m_InputFilter;
142 }
143
144 const InputFilterType *
145 GetFilter() const
146 {
147 return this->m_InputFilter;
148 }
149
150 void
152 itkGetModifiableObjectMacro(InputFilter, InputFilterType);
153
154 void
156 itkGetModifiableObjectMacro(OutputFilter, OutputFilterType);
157
165 itkSetMacro(KeepLabels, bool);
166 itkGetMacro(KeepLabels, bool);
167 itkBooleanMacro(KeepLabels);
169
173 itkSetMacro(PadSize, SizeType);
174 itkGetMacro(PadSize, SizeType);
176
181 itkSetMacro(ConstrainPaddingToImage, bool);
182 itkGetMacro(ConstrainPaddingToImage, bool);
183 itkBooleanMacro(ConstrainPaddingToImage);
185
191 itkSetMacro(BinaryInternalOutput, bool);
192 itkGetMacro(BinaryInternalOutput, bool);
193 itkBooleanMacro(BinaryInternalOutput);
195
200 itkSetMacro(InternalForegroundValue, InternalOutputPixelType);
201 itkGetMacro(InternalForegroundValue, InternalOutputPixelType);
203
209
210protected:
212 ~ObjectByObjectLabelMapFilter() override = default;
213 void
214 PrintSelf(std::ostream & os, Indent indent) const override;
215
216 void
217 GenerateData() override;
218
219private:
223
225
227
230
233
236
239
242
245
246 typename InputFilterType::Pointer m_InputFilter{};
247 typename OutputFilterType::Pointer m_OutputFilter{};
248
249
251
252}; // end of class
253
254} // end namespace itk
255
256#ifndef ITK_MANUAL_INSTANTIATION
257# include "itkObjectByObjectLabelMapFilter.hxx"
258#endif
259
260#endif
Crop a LabelMap image to fit exactly the objects in the LabelMap.
Label the connected components in a binary image and produce a collection of label objects.
Base class for filters that take an image as input and produce an image as output.
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
Convert a LabelMap to a binary image.
remove the objects according to the value of their attribute
typename InternalInputImageType::RegionType InternalRegionType
typename InputImageType::RegionType InputImageRegionType
itk::BinaryImageToLabelMapFilter< InternalOutputImageType, LabelMapType > BI2LMType
itk::LabelImageToLabelMapFilter< InternalOutputImageType, LabelMapType > LI2LMType
itk::LabelMapToBinaryImageFilter< LabelMapType, InternalInputImageType > LM2BIType
typename InternalInputImageType::PixelType InternalInputPixelType
typename OutputImageType::ConstPointer OutputImageConstPointer
~ObjectByObjectLabelMapFilter() override=default
LabelMapFilter< TInputImage, TOutputImage > Superclass
typename OutputImageType::SizeType SizeType
itk::LabelSelectionLabelMapFilter< LabelMapType > SelectType
itk::PadLabelMapFilter< LabelMapType > PadType
typename OutputImageType::RegionType OutputImageRegionType
void SetFilter(InputFilterType *filter)
itk::AutoCropLabelMapFilter< LabelMapType > CropType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::ConstPointer InputImageConstPointer
void SetInputFilter(InputFilterType *filter)
typename InternalInputImageType::SizeType InternalSizeType
typename OutputImageType::Pointer OutputImagePointer
typename LabelMapType::LabelObjectType LabelObjectType
void SetOutputFilter(OutputFilterType *filter)
void PrintSelf(std::ostream &os, Indent indent) const override
typename InternalInputImageType::OffsetType InternalOffsetType
typename InternalInputImageType::IndexType InternalIndexType
typename InternalOutputImageType::PixelType InternalOutputPixelType
typename InputImageType::PixelType InputImagePixelType
Pad a LabelMap image.
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....