ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkImageDuplicator.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 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_ASSIGN(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 * GetOutput () const { return this->m_DuplicateImage.GetPointer(); }
94  virtual ImageType * GetOutput() { return this->m_DuplicateImage.GetPointer(); }
96 
97 #if !defined(ITK_LEGACY_REMOVE)
98  // This interface was exposed in ITKv4 when the itkGetModifiableObjectMacro was used
99  virtual ImageType * GetModifiableOutput() { return this->m_DuplicateImage.GetPointer(); }
100 #endif
101 
103  void Update();
104 
105 protected:
106  ImageDuplicator();
107  ~ImageDuplicator() override = default;
108  void PrintSelf(std::ostream & os, Indent indent) const override;
109 
110 private:
114 };
115 } // end namespace itk
116 
117 #ifndef ITK_MANUAL_INSTANTIATION
118 #include "itkImageDuplicator.hxx"
119 #endif
120 
121 #endif /* itkImageDuplicator_h */
typename TInputImage::PixelType PixelType
ModifiedTimeType m_InternalImageTime
typename TInputImage::IndexType IndexType
A helper class which creates an image which is perfect copy of the input image.
ImageConstPointer m_InputImage
virtual ImageType * GetOutput()
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:104
virtual const ImageType * GetOutput() const
typename TInputImage::ConstPointer ImageConstPointer
Base class for most ITK classes.
Definition: itkObject.h:60
typename TInputImage::Pointer ImagePointer