ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkRegionFromReferenceLabelMapFilter.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 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef itkRegionFromReferenceLabelMapFilter_h
29 #define itkRegionFromReferenceLabelMapFilter_h
30 
32 
33 namespace itk
34 {
53 template< typename TInputImage >
54 class ITK_TEMPLATE_EXPORT RegionFromReferenceLabelMapFilter:public ChangeRegionLabelMapFilter< TInputImage >
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_ASSIGN(RegionFromReferenceLabelMapFilter);
58 
64 
66  itkTypeMacro(RegionFromReferenceLabelMapFilter, ChangeRegionImageFilter);
67 
69  itkNewMacro(Self);
70 
72  using OutputImageType = typename Superclass::OutputImageType;
73  using OutputImagePointer = typename Superclass::OutputImagePointer;
74  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
75  using OutputImagePixelType = typename Superclass::OutputImagePixelType;
76 
78  using InputImageType = TInputImage;
79  using InputImagePointer = typename InputImageType::Pointer;
80  using InputImageConstPointer = typename InputImageType::ConstPointer;
82  using InputImagePixelType = typename InputImageType::PixelType;
83  using LabelObjectType = typename InputImageType::LabelObjectType;
84 
85  using PixelType = typename InputImageType::PixelType;
89 
90  using TOutputImage = TInputImage;
91 
93  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
94  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
95  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
96 
98 
100  void SetReferenceImage(const ReferenceImageType *image);
101 
102  const ReferenceImageType * GetReferenceImage() const;
103 
105  void SetInput1(const TInputImage *input)
106  {
107  this->SetInput(input);
108  }
109 
111  void SetInput2(const ReferenceImageType *input)
112  {
113  this->SetReferenceImage(input);
114  }
115 
116 protected:
118  {
119  this->SetNumberOfRequiredInputs(2);
120  }
121 
122  ~RegionFromReferenceLabelMapFilter() override = default;
123 
124  void GenerateOutputInformation() override;
125 
126  void PrintSelf(std::ostream & os, Indent indent) const override;
127 };
128 } // end namespace itk
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 #include "itkRegionFromReferenceLabelMapFilter.hxx"
132 #endif
133 
134 #endif
typename InputImageType::RegionType InputImageRegionType
typename InputImageType::PixelType InputImagePixelType
typename Superclass::OutputImagePointer OutputImagePointer
Light weight base class for most itk classes.
typename Superclass::OutputImagePixelType OutputImagePixelType
typename InputImageType::IndexType IndexType
typename InputImageType::ConstPointer InputImageConstPointer
typename Superclass::OutputImageType OutputImageType
typename InputImageType::LabelObjectType LabelObjectType
typename InputImageType::PixelType PixelType
typename Superclass::OutputImageRegionType OutputImageRegionType
typename InputImageType::SizeType SizeType
typename InputImageType::RegionType RegionType
Base class for templated image classes.
Definition: itkImageBase.h:105
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename InputImageType::Pointer InputImagePointer
Change the region of a label map.