ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkLabelMapToAttributeImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkLabelMapToAttributeImageFilter_h
19 #define itkLabelMapToAttributeImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 
24 namespace itk {
25 
42 template<typename TInputImage, typename TOutputImage, typename TAttributeAccessor=
43  typename Functor::AttributeLabelObjectAccessor< typename TInputImage::LabelObjectType > >
44 class ITK_TEMPLATE_EXPORT LabelMapToAttributeImageFilter :
45  public ImageToImageFilter<TInputImage, TOutputImage>
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_ASSIGN(LabelMapToAttributeImageFilter);
49 
55 
57  using InputImageType = TInputImage;
58  using OutputImageType = TOutputImage;
59  using InputImagePointer = typename InputImageType::Pointer;
60  using InputImageConstPointer = typename InputImageType::ConstPointer;
62  using InputImagePixelType = typename InputImageType::PixelType;
63  using OutputImagePointer = typename OutputImageType::Pointer;
64  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
66  using OutputImagePixelType = typename OutputImageType::PixelType;
68 
69  using AttributeAccessorType = TAttributeAccessor;
70  using AttributeValueType = typename AttributeAccessorType::AttributeValueType;
71 
73  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
74  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
75 
77  itkNewMacro(Self);
78 
80  itkTypeMacro(LabelMapToAttributeImageFilter,
82 
88  itkSetMacro(BackgroundValue, OutputImagePixelType);
89  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
91 
92 protected:
94  ~LabelMapToAttributeImageFilter() override = default;
95  void PrintSelf(std::ostream& os, Indent indent) const override;
96 
100  void GenerateInputRequestedRegion() override;
101 
103  void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output)) override;
104 
107  void GenerateData() override;
108 
109 private:
111 
112 }; // end of class
113 
114 } // end namespace itk
115 
116 #ifndef ITK_MANUAL_INSTANTIATION
117 #include "itkLabelMapToAttributeImageFilter.hxx"
118 #endif
119 
120 #endif
typename OutputImageType::Pointer OutputImagePointer
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
typename OutputImageType::ConstPointer OutputImageConstPointer
Base class for all process objects that output image data.
Convert a LabelMap to a labeled image.
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename AttributeAccessorType::AttributeValueType AttributeValueType
typename InputImageType::RegionType InputImageRegionType
typename OutputImageType::IndexType IndexType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename InputImageType::ConstPointer InputImageConstPointer
Base class for all data objects in ITK.