ITK  5.3.0
Insight Toolkit
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  * http://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"
27 #include "itkPadLabelMapFilter.h"
28 
29 
30 namespace itk
31 {
32 
79 template <typename TInputImage,
80  typename TOutputImage = TInputImage,
81  typename TInputFilter = ImageToImageFilter<Image<unsigned char, TInputImage::ImageDimension>,
82  Image<unsigned char, TOutputImage::ImageDimension>>,
83  class TOutputFilter = typename TInputFilter::Superclass,
84  class TInternalInputImage = typename TInputFilter::InputImageType,
85  class TInternalOutputImage = typename TOutputFilter::OutputImageType>
86 class ITK_TEMPLATE_EXPORT ObjectByObjectLabelMapFilter : public LabelMapFilter<TInputImage, TOutputImage>
87 {
88 public:
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;
103  using InputImagePixelType = typename InputImageType::PixelType;
104  using OutputImagePointer = typename OutputImageType::Pointer;
105  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
107  using OutputImagePixelType = typename OutputImageType::PixelType;
110  using LabelObjectType = typename LabelMapType::LabelObjectType;
111 
112  using InputFilterType = TInputFilter;
113  using OutputFilterType = TOutputFilter;
114 
115  using InternalInputImageType = TInternalInputImage;
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 
135 
136  void
137  SetFilter(InputFilterType * filter);
140  {
141  return this->m_InputFilter;
142  }
143 
144  const InputFilterType *
145  GetFilter() const
146  {
147  return this->m_InputFilter;
148  }
149 
150  void
151  SetInputFilter(InputFilterType * filter);
152  itkGetModifiableObjectMacro(InputFilter, InputFilterType);
153 
154  void
155  SetOutputFilter(OutputFilterType * filter);
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 
208  itkGetMacro(Label, InputImagePixelType);
209 
210 protected:
212  ~ObjectByObjectLabelMapFilter() override = default;
213  void
214  PrintSelf(std::ostream & os, Indent indent) const override;
215 
216  void
217  GenerateData() override;
218 
219 private:
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
itkLabelImageToLabelMapFilter.h
itk::LabelMapFilter::OutputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkLabelMapFilter.h:84
itk::ObjectByObjectLabelMapFilter::m_Label
InputImagePixelType m_Label
Definition: itkObjectByObjectLabelMapFilter.h:250
itk::ObjectByObjectLabelMapFilter::m_InternalForegroundValue
InternalOutputPixelType m_InternalForegroundValue
Definition: itkObjectByObjectLabelMapFilter.h:226
itk::ObjectByObjectLabelMapFilter
ObjectByObjectLabelMapFilter applies an image pipeline to all the objects of a label map and produce ...
Definition: itkObjectByObjectLabelMapFilter.h:86
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::ObjectByObjectLabelMapFilter::InternalOffsetType
typename InternalInputImageType::OffsetType InternalOffsetType
Definition: itkObjectByObjectLabelMapFilter.h:119
itk::PadLabelMapFilter
Pad a LabelMap image.
Definition: itkPadLabelMapFilter.h:55
itk::ObjectByObjectLabelMapFilter::InternalSizeType
typename InternalInputImageType::SizeType InternalSizeType
Definition: itkObjectByObjectLabelMapFilter.h:117
itk::LabelMapToBinaryImageFilter
Convert a LabelMap to a binary image.
Definition: itkLabelMapToBinaryImageFilter.h:45
itk::ObjectByObjectLabelMapFilter::m_OutputFilter
OutputFilterType::Pointer m_OutputFilter
Definition: itkObjectByObjectLabelMapFilter.h:247
itk::LabelSelectionLabelMapFilter
remove the objects according to the value of their attribute
Definition: itkLabelSelectionLabelMapFilter.h:54
itk::ObjectByObjectLabelMapFilter::GetFilter
InputFilterType * GetFilter()
Definition: itkObjectByObjectLabelMapFilter.h:139
itk::LabelImageToLabelMapFilter
convert a labeled image to a label collection image
Definition: itkLabelImageToLabelMapFilter.h:49
itk::ObjectByObjectLabelMapFilter::m_KeepLabels
bool m_KeepLabels
Definition: itkObjectByObjectLabelMapFilter.h:224
itk::ObjectByObjectLabelMapFilter::m_Crop
CropType::Pointer m_Crop
Definition: itkObjectByObjectLabelMapFilter.h:232
itk::ObjectByObjectLabelMapFilter::GetFilter
const InputFilterType * GetFilter() const
Definition: itkObjectByObjectLabelMapFilter.h:145
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::AutoCropLabelMapFilter
Crop a LabelMap image to fit exactly the objects in the LabelMap.
Definition: itkAutoCropLabelMapFilter.h:53
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ObjectByObjectLabelMapFilter::InternalInputPixelType
typename InternalInputImageType::PixelType InternalInputPixelType
Definition: itkObjectByObjectLabelMapFilter.h:120
itk::LabelMapFilter::LabelObjectType
typename InputImageType::LabelObjectType LabelObjectType
Definition: itkLabelMapFilter.h:80
itk::BinaryImageToLabelMapFilter
Label the connected components in a binary image and produce a collection of label objects.
Definition: itkBinaryImageToLabelMapFilter.h:55
itkLabelMapFilter.h
itk::ObjectByObjectLabelMapFilter::m_LI2LM
LI2LMType::Pointer m_LI2LM
Definition: itkObjectByObjectLabelMapFilter.h:241
itk::ObjectByObjectLabelMapFilter::InternalRegionType
typename InternalInputImageType::RegionType InternalRegionType
Definition: itkObjectByObjectLabelMapFilter.h:116
itk::ImageToImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkImageToImageFilter.h:133
itkLabelSelectionLabelMapFilter.h
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ObjectByObjectLabelMapFilter::m_BI2LM
BI2LMType::Pointer m_BI2LM
Definition: itkObjectByObjectLabelMapFilter.h:244
itk::ObjectByObjectLabelMapFilter::InternalIndexType
typename InternalInputImageType::IndexType InternalIndexType
Definition: itkObjectByObjectLabelMapFilter.h:118
itkPadLabelMapFilter.h
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::ObjectByObjectLabelMapFilter::OutputFilterType
TOutputFilter OutputFilterType
Definition: itkObjectByObjectLabelMapFilter.h:113
itkAutoCropLabelMapFilter.h
itk::LabelMapFilter
Base class for filters that take an image as input and overwrite that image as the output.
Definition: itkLabelMapFilter.h:57
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ObjectByObjectLabelMapFilter::InternalInputImageType
TInternalInputImage InternalInputImageType
Definition: itkObjectByObjectLabelMapFilter.h:115
itk::ObjectByObjectLabelMapFilter::InternalOutputPixelType
typename InternalOutputImageType::PixelType InternalOutputPixelType
Definition: itkObjectByObjectLabelMapFilter.h:123
itk::ObjectByObjectLabelMapFilter::m_Pad
PadType::Pointer m_Pad
Definition: itkObjectByObjectLabelMapFilter.h:235
itk::ObjectByObjectLabelMapFilter::m_LM2BI
LM2BIType::Pointer m_LM2BI
Definition: itkObjectByObjectLabelMapFilter.h:238
itkLabelMapToBinaryImageFilter.h
itk::ObjectByObjectLabelMapFilter::m_InputFilter
InputFilterType::Pointer m_InputFilter
Definition: itkObjectByObjectLabelMapFilter.h:246
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkBinaryImageToLabelMapFilter.h
itk::ObjectByObjectLabelMapFilter::InternalOutputImageType
TInternalOutputImage InternalOutputImageType
Definition: itkObjectByObjectLabelMapFilter.h:122
itk::ObjectByObjectLabelMapFilter::m_BinaryInternalOutput
bool m_BinaryInternalOutput
Definition: itkObjectByObjectLabelMapFilter.h:222
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::ObjectByObjectLabelMapFilter::InputFilterType
TInputFilter InputFilterType
Definition: itkObjectByObjectLabelMapFilter.h:112
itk::ObjectByObjectLabelMapFilter::LabelMapType
OutputImageType LabelMapType
Definition: itkObjectByObjectLabelMapFilter.h:109
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
Label
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::ImageSource::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::ObjectByObjectLabelMapFilter::m_Select
SelectType::Pointer m_Select
Definition: itkObjectByObjectLabelMapFilter.h:229
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::ObjectByObjectLabelMapFilter::m_PadSize
SizeType m_PadSize
Definition: itkObjectByObjectLabelMapFilter.h:221
itk::ObjectByObjectLabelMapFilter::m_ConstrainPaddingToImage
bool m_ConstrainPaddingToImage
Definition: itkObjectByObjectLabelMapFilter.h:220
itk::ImageToImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkImageToImageFilter.h:131
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::ObjectByObjectLabelMapFilter::SizeType
typename OutputImageType::SizeType SizeType
Definition: itkObjectByObjectLabelMapFilter.h:108