ITK  5.2.0
Insight Toolkit
itkImageDuplicator.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 itkImageDuplicator_h
19 #define itkImageDuplicator_h
20 
21 #include "itkObject.h"
22 #include "itkImage.h"
23 
24 namespace itk
25 {
53 template <typename TInputImage>
54 class ITK_TEMPLATE_EXPORT ImageDuplicator : public Object
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_MOVE(ImageDuplicator);
58 
61  using Superclass = Object;
64 
66  itkNewMacro(Self);
67 
69  itkTypeMacro(ImageDuplicator, Object);
70 
72  using ImageType = TInputImage;
73  using ImagePointer = typename TInputImage::Pointer;
74  using ImageConstPointer = typename TInputImage::ConstPointer;
75  using PixelType = typename TInputImage::PixelType;
77 
78  static constexpr unsigned int ImageDimension = ImageType::ImageDimension;
79 
80  itkSetConstObjectMacro(InputImage, ImageType);
81 
89  // NOTE: The m_DuplicateImage is only
90  // exposed via the Source generation interface
91  // by the GetOutput() method that mimics
92  // a process object.
93  virtual const ImageType *
94  GetOutput() const
95  {
96  return this->m_DuplicateImage.GetPointer();
97  }
98  virtual ImageType *
100  {
101  return this->m_DuplicateImage.GetPointer();
102  }
104 
105 #if !defined(ITK_LEGACY_REMOVE)
106  // This interface was exposed in ITKv4 when the itkGetModifiableObjectMacro was used
107  virtual ImageType *
108  GetModifiableOutput()
109  {
110  return this->m_DuplicateImage.GetPointer();
111  }
112 #endif
113 
115  void
116  Update();
117 
118 protected:
119  ImageDuplicator();
120  ~ImageDuplicator() override = default;
121  void
122  PrintSelf(std::ostream & os, Indent indent) const override;
123 
124 private:
128 };
129 } // end namespace itk
130 
131 #ifndef ITK_MANUAL_INSTANTIATION
132 # include "itkImageDuplicator.hxx"
133 #endif
134 
135 #endif /* itkImageDuplicator_h */
itk::ImageDuplicator::ImageConstPointer
typename TInputImage::ConstPointer ImageConstPointer
Definition: itkImageDuplicator.h:74
itk::ModifiedTimeType
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:102
itk::ImageDuplicator::GetOutput
virtual ImageType * GetOutput()
Definition: itkImageDuplicator.h:99
itk::ImageDuplicator::ImagePointer
typename TInputImage::Pointer ImagePointer
Definition: itkImageDuplicator.h:73
itk::ImageDuplicator::m_InputImage
ImageConstPointer m_InputImage
Definition: itkImageDuplicator.h:125
itk::ImageDuplicator
A helper class which creates an image which is perfect copy of the input image.
Definition: itkImageDuplicator.h:54
itk::ImageDuplicator::GetOutput
virtual const ImageType * GetOutput() const
Definition: itkImageDuplicator.h:94
itkImage.h
itk::SmartPointer< Self >
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageDuplicator::m_DuplicateImage
ImagePointer m_DuplicateImage
Definition: itkImageDuplicator.h:126
itk::ImageDuplicator::IndexType
typename TInputImage::IndexType IndexType
Definition: itkImageDuplicator.h:76
itk::ImageDuplicator::ImageType
TInputImage ImageType
Definition: itkImageDuplicator.h:72
itkObject.h
itk::ImageDuplicator::PixelType
typename TInputImage::PixelType PixelType
Definition: itkImageDuplicator.h:75
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::ImageDuplicator::m_InternalImageTime
ModifiedTimeType m_InternalImageTime
Definition: itkImageDuplicator.h:127