ITK  5.1.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 
80 template <typename TInputImage,
81  typename TOutputImage = TInputImage,
82  typename TInputFilter = ImageToImageFilter<Image<unsigned char, TInputImage::ImageDimension>,
83  Image<unsigned char, TOutputImage::ImageDimension>>,
84  class TOutputFilter = typename TInputFilter::Superclass,
85  class TInternalInputImage = typename TInputFilter::InputImageType,
86  class TInternalOutputImage = typename TOutputFilter::OutputImageType>
87 class ITK_TEMPLATE_EXPORT ObjectByObjectLabelMapFilter : public LabelMapFilter<TInputImage, TOutputImage>
88 {
89 public:
90  ITK_DISALLOW_COPY_AND_ASSIGN(ObjectByObjectLabelMapFilter);
91 
97 
99  using InputImageType = TInputImage;
100  using OutputImageType = TOutputImage;
101  using InputImagePointer = typename InputImageType::Pointer;
102  using InputImageConstPointer = typename InputImageType::ConstPointer;
104  using InputImagePixelType = typename InputImageType::PixelType;
105  using OutputImagePointer = typename OutputImageType::Pointer;
106  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
108  using OutputImagePixelType = typename OutputImageType::PixelType;
111  using LabelObjectType = typename LabelMapType::LabelObjectType;
112 
113  using InputFilterType = TInputFilter;
114  using OutputFilterType = TOutputFilter;
115 
116  using InternalInputImageType = TInternalInputImage;
120  using InternalOffsetType = typename InternalInputImageType::OffsetType;
121  using InternalInputPixelType = typename InternalInputImageType::PixelType;
122 
123  using InternalOutputImageType = TInternalOutputImage;
124  using InternalOutputPixelType = typename InternalOutputImageType::PixelType;
125 
127  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
128  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
129  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
130 
132  itkNewMacro(Self);
133 
136 
137  void
138  SetFilter(InputFilterType * filter);
141  {
142  return this->m_InputFilter;
143  }
144 
145  const InputFilterType *
146  GetFilter() const
147  {
148  return this->m_InputFilter;
149  }
150 
151  void
152  SetInputFilter(InputFilterType * filter);
153  itkGetModifiableObjectMacro(InputFilter, InputFilterType);
154 
155  void
156  SetOutputFilter(OutputFilterType * filter);
157  itkGetModifiableObjectMacro(OutputFilter, OutputFilterType);
158 
166  itkSetMacro(KeepLabels, bool);
167  itkGetMacro(KeepLabels, bool);
168  itkBooleanMacro(KeepLabels);
170 
174  itkSetMacro(PadSize, SizeType);
175  itkGetMacro(PadSize, SizeType);
177 
182  itkSetMacro(ConstrainPaddingToImage, bool);
183  itkGetMacro(ConstrainPaddingToImage, bool);
184  itkBooleanMacro(ConstrainPaddingToImage);
186 
192  itkSetMacro(BinaryInternalOutput, bool);
193  itkGetMacro(BinaryInternalOutput, bool);
194  itkBooleanMacro(BinaryInternalOutput);
196 
201  itkSetMacro(InternalForegroundValue, InternalOutputPixelType);
202  itkGetMacro(InternalForegroundValue, InternalOutputPixelType);
204 
209  itkGetMacro(Label, InputImagePixelType);
210 
211 protected:
213  ~ObjectByObjectLabelMapFilter() override = default;
214  void
215  PrintSelf(std::ostream & os, Indent indent) const override;
216 
217  void
218  GenerateData() override;
219 
220 private:
224 
226 
228 
231 
234 
237 
240 
243 
246 
247  typename InputFilterType::Pointer m_InputFilter;
248  typename OutputFilterType::Pointer m_OutputFilter;
249 
250 
252 
253 }; // end of class
254 
255 } // end namespace itk
256 
257 #ifndef ITK_MANUAL_INSTANTIATION
258 # include "itkObjectByObjectLabelMapFilter.hxx"
259 #endif
260 
261 #endif
itkLabelImageToLabelMapFilter.h
itk::LabelMapFilter::OutputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkLabelMapFilter.h:85
itk::ObjectByObjectLabelMapFilter::m_Label
InputImagePixelType m_Label
Definition: itkObjectByObjectLabelMapFilter.h:251
itk::ObjectByObjectLabelMapFilter::m_InternalForegroundValue
InternalOutputPixelType m_InternalForegroundValue
Definition: itkObjectByObjectLabelMapFilter.h:227
itk::ObjectByObjectLabelMapFilter
ObjectByObjectLabelMapFilter applies an image pipeline to all the objects of a label map and produce ...
Definition: itkObjectByObjectLabelMapFilter.h:87
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::ObjectByObjectLabelMapFilter::InternalOffsetType
typename InternalInputImageType::OffsetType InternalOffsetType
Definition: itkObjectByObjectLabelMapFilter.h:120
itk::PadLabelMapFilter
Pad a LabelMap image.
Definition: itkPadLabelMapFilter.h:56
itk::ObjectByObjectLabelMapFilter::InternalSizeType
typename InternalInputImageType::SizeType InternalSizeType
Definition: itkObjectByObjectLabelMapFilter.h:118
itk::LabelMapToBinaryImageFilter
Convert a LabelMap to a binary image.
Definition: itkLabelMapToBinaryImageFilter.h:46
itk::ObjectByObjectLabelMapFilter::m_OutputFilter
OutputFilterType::Pointer m_OutputFilter
Definition: itkObjectByObjectLabelMapFilter.h:248
itk::LabelSelectionLabelMapFilter
remove the objects according to the value of their attribute
Definition: itkLabelSelectionLabelMapFilter.h:55
itk::ObjectByObjectLabelMapFilter::GetFilter
InputFilterType * GetFilter()
Definition: itkObjectByObjectLabelMapFilter.h:140
itk::LabelImageToLabelMapFilter
convert a labeled image to a label collection image
Definition: itkLabelImageToLabelMapFilter.h:50
itk::ObjectByObjectLabelMapFilter::m_KeepLabels
bool m_KeepLabels
Definition: itkObjectByObjectLabelMapFilter.h:225
itk::ObjectByObjectLabelMapFilter::m_Crop
CropType::Pointer m_Crop
Definition: itkObjectByObjectLabelMapFilter.h:233
itk::ObjectByObjectLabelMapFilter::GetFilter
const InputFilterType * GetFilter() const
Definition: itkObjectByObjectLabelMapFilter.h:146
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:54
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ObjectByObjectLabelMapFilter::InternalInputPixelType
typename InternalInputImageType::PixelType InternalInputPixelType
Definition: itkObjectByObjectLabelMapFilter.h:121
itk::LabelMapFilter::LabelObjectType
typename InputImageType::LabelObjectType LabelObjectType
Definition: itkLabelMapFilter.h:81
itk::BinaryImageToLabelMapFilter
Label the connected components in a binary image and produce a collection of label objects.
Definition: itkBinaryImageToLabelMapFilter.h:56
itkLabelMapFilter.h
itk::ObjectByObjectLabelMapFilter::m_LI2LM
LI2LMType::Pointer m_LI2LM
Definition: itkObjectByObjectLabelMapFilter.h:242
itk::ObjectByObjectLabelMapFilter::InternalRegionType
typename InternalInputImageType::RegionType InternalRegionType
Definition: itkObjectByObjectLabelMapFilter.h:117
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:245
itk::ObjectByObjectLabelMapFilter::InternalIndexType
typename InternalInputImageType::IndexType InternalIndexType
Definition: itkObjectByObjectLabelMapFilter.h:119
itkPadLabelMapFilter.h
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::ObjectByObjectLabelMapFilter::OutputFilterType
TOutputFilter OutputFilterType
Definition: itkObjectByObjectLabelMapFilter.h:114
itkAutoCropLabelMapFilter.h
itk::LabelMapFilter
Base class for filters that take an image as input and overwrite that image as the output.
Definition: itkLabelMapFilter.h:58
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ObjectByObjectLabelMapFilter::InternalInputImageType
TInternalInputImage InternalInputImageType
Definition: itkObjectByObjectLabelMapFilter.h:116
itk::ObjectByObjectLabelMapFilter::InternalOutputPixelType
typename InternalOutputImageType::PixelType InternalOutputPixelType
Definition: itkObjectByObjectLabelMapFilter.h:124
itk::ObjectByObjectLabelMapFilter::m_Pad
PadType::Pointer m_Pad
Definition: itkObjectByObjectLabelMapFilter.h:236
itk::ObjectByObjectLabelMapFilter::m_LM2BI
LM2BIType::Pointer m_LM2BI
Definition: itkObjectByObjectLabelMapFilter.h:239
itkLabelMapToBinaryImageFilter.h
itk::ObjectByObjectLabelMapFilter::m_InputFilter
InputFilterType::Pointer m_InputFilter
Definition: itkObjectByObjectLabelMapFilter.h:247
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkBinaryImageToLabelMapFilter.h
itk::ObjectByObjectLabelMapFilter::InternalOutputImageType
TInternalOutputImage InternalOutputImageType
Definition: itkObjectByObjectLabelMapFilter.h:123
itk::ObjectByObjectLabelMapFilter::m_BinaryInternalOutput
bool m_BinaryInternalOutput
Definition: itkObjectByObjectLabelMapFilter.h:223
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::ObjectByObjectLabelMapFilter::InputFilterType
TInputFilter InputFilterType
Definition: itkObjectByObjectLabelMapFilter.h:113
itk::ObjectByObjectLabelMapFilter::LabelMapType
OutputImageType LabelMapType
Definition: itkObjectByObjectLabelMapFilter.h:110
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
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:230
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::ObjectByObjectLabelMapFilter::m_PadSize
SizeType m_PadSize
Definition: itkObjectByObjectLabelMapFilter.h:222
itk::ObjectByObjectLabelMapFilter::m_ConstrainPaddingToImage
bool m_ConstrainPaddingToImage
Definition: itkObjectByObjectLabelMapFilter.h:221
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:109