ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
00001 /*========================================================================= 00002 * 00003 * Copyright Insight Software Consortium 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0.txt 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 * 00017 *=========================================================================*/ 00018 #ifndef __itkPasteImageFilter_h 00019 #define __itkPasteImageFilter_h 00020 00021 #include "itkInPlaceImageFilter.h" 00022 #include "itkSmartPointer.h" 00023 00024 namespace itk 00025 { 00047 template< class TInputImage, class TSourceImage = TInputImage, class TOutputImage = TInputImage > 00048 class ITK_EXPORT PasteImageFilter: 00049 public InPlaceImageFilter< TInputImage, TOutputImage > 00050 { 00051 public: 00053 typedef PasteImageFilter Self; 00054 typedef InPlaceImageFilter< TInputImage, TOutputImage > Superclass; 00055 typedef SmartPointer< Self > Pointer; 00056 typedef SmartPointer< const Self > ConstPointer; 00057 00059 itkNewMacro(Self); 00060 00062 itkTypeMacro(PasteImageFilter, InPlaceImageFilter); 00063 00065 typedef typename Superclass::InputImagePointer InputImagePointer; 00066 typedef typename Superclass::OutputImagePointer OutputImagePointer; 00067 00069 typedef TInputImage InputImageType; 00070 typedef TOutputImage OutputImageType; 00071 typedef TSourceImage SourceImageType; 00072 typedef typename OutputImageType::RegionType OutputImageRegionType; 00073 typedef typename InputImageType::RegionType InputImageRegionType; 00074 typedef typename SourceImageType::RegionType SourceImageRegionType; 00075 00076 typedef typename SourceImageType::Pointer SourceImagePointer; 00077 typedef typename SourceImageType::ConstPointer SourceImageConstPointer; 00078 00080 typedef typename OutputImageType::PixelType OutputImagePixelType; 00081 typedef typename InputImageType::PixelType InputImagePixelType; 00082 typedef typename SourceImageType::PixelType SourceImagePixelType; 00083 00085 typedef typename OutputImageType::IndexType OutputImageIndexType; 00086 typedef typename OutputImageType::SizeType OutputImageSizeType; 00087 typedef typename InputImageType::IndexType InputImageIndexType; 00088 typedef typename InputImageType::SizeType InputImageSizeType; 00089 typedef typename SourceImageType::IndexType SourceImageIndexType; 00090 typedef typename SourceImageType::SizeType SourceImageSizeType; 00091 00093 itkStaticConstMacro(InputImageDimension, unsigned int, 00094 InputImageType::ImageDimension); 00095 itkStaticConstMacro(OutputImageDimension, unsigned int, 00096 OutputImageType::ImageDimension); 00097 itkStaticConstMacro(SourceImageDimension, unsigned int, 00098 SourceImageType::ImageDimension); 00100 00103 itkSetMacro(DestinationIndex, InputImageIndexType); 00104 itkGetConstMacro(DestinationIndex, InputImageIndexType); 00106 00109 itkSetMacro(SourceRegion, SourceImageRegionType); 00110 itkGetConstMacro(SourceRegion, SourceImageRegionType); 00112 00115 void SetDestinationImage(const InputImageType *dest); 00116 00117 const InputImageType * GetDestinationImage() const; 00118 00121 void SetSourceImage(const SourceImageType *src); 00122 00123 const SourceImageType * GetSourceImage() const; 00124 00134 virtual void GenerateInputRequestedRegion(); 00135 00136 00142 virtual void VerifyInputInformation() {} 00143 00144 protected: 00145 PasteImageFilter(); 00146 ~PasteImageFilter() {} 00147 void PrintSelf(std::ostream & os, Indent indent) const; 00148 00158 void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, 00159 ThreadIdType threadId); 00160 00161 SourceImageRegionType m_SourceRegion; 00162 00163 InputImageIndexType m_DestinationIndex; 00164 private: 00165 PasteImageFilter(const Self &); //purposely not implemented 00166 void operator=(const Self &); //purposely not implemented 00167 }; 00168 } // end namespace itk 00169 00170 #ifndef ITK_MANUAL_INSTANTIATION 00171 #include "itkPasteImageFilter.hxx" 00172 #endif 00173 00174 #endif 00175