ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkPasteImageFilter.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 __itkPasteImageFilter_h
19 #define __itkPasteImageFilter_h
20 
21 #include "itkInPlaceImageFilter.h"
22 #include "itkSmartPointer.h"
23 
24 namespace itk
25 {
47 template< class TInputImage, class TSourceImage = TInputImage, class TOutputImage = TInputImage >
48 class ITK_EXPORT PasteImageFilter:
49  public InPlaceImageFilter< TInputImage, TOutputImage >
50 {
51 public:
57 
59  itkNewMacro(Self);
60 
63 
65  typedef typename Superclass::InputImagePointer InputImagePointer;
66  typedef typename Superclass::OutputImagePointer OutputImagePointer;
67 
69  typedef TInputImage InputImageType;
70  typedef TOutputImage OutputImageType;
71  typedef TSourceImage SourceImageType;
72  typedef typename OutputImageType::RegionType OutputImageRegionType;
73  typedef typename InputImageType::RegionType InputImageRegionType;
74  typedef typename SourceImageType::RegionType SourceImageRegionType;
75 
76  typedef typename SourceImageType::Pointer SourceImagePointer;
77  typedef typename SourceImageType::ConstPointer SourceImageConstPointer;
78 
80  typedef typename OutputImageType::PixelType OutputImagePixelType;
81  typedef typename InputImageType::PixelType InputImagePixelType;
82  typedef typename SourceImageType::PixelType SourceImagePixelType;
83 
85  typedef typename OutputImageType::IndexType OutputImageIndexType;
86  typedef typename OutputImageType::SizeType OutputImageSizeType;
87  typedef typename InputImageType::IndexType InputImageIndexType;
88  typedef typename InputImageType::SizeType InputImageSizeType;
89  typedef typename SourceImageType::IndexType SourceImageIndexType;
90  typedef typename SourceImageType::SizeType SourceImageSizeType;
91 
93  itkStaticConstMacro(InputImageDimension, unsigned int,
94  InputImageType::ImageDimension);
95  itkStaticConstMacro(OutputImageDimension, unsigned int,
96  OutputImageType::ImageDimension);
97  itkStaticConstMacro(SourceImageDimension, unsigned int,
98  SourceImageType::ImageDimension);
100 
103  itkSetMacro(DestinationIndex, InputImageIndexType);
104  itkGetConstMacro(DestinationIndex, InputImageIndexType);
106 
109  itkSetMacro(SourceRegion, SourceImageRegionType);
110  itkGetConstMacro(SourceRegion, SourceImageRegionType);
112 
115  void SetDestinationImage(const InputImageType *dest);
116 
117  const InputImageType * GetDestinationImage() const;
118 
121  void SetSourceImage(const SourceImageType *src);
122 
123  const SourceImageType * GetSourceImage() const;
124 
134  virtual void GenerateInputRequestedRegion();
135 
136 
142  virtual void VerifyInputInformation() {}
143 
144 protected:
147  void PrintSelf(std::ostream & os, Indent indent) const;
148 
158  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
159  ThreadIdType threadId);
160 
162 
164 
165 private:
166  PasteImageFilter(const Self &); //purposely not implemented
167  void operator=(const Self &); //purposely not implemented
168 };
169 } // end namespace itk
170 
171 #ifndef ITK_MANUAL_INSTANTIATION
172 #include "itkPasteImageFilter.hxx"
173 #endif
174 
175 #endif
176