ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkGridForwardWarpImageFilter.h
Go to the documentation of this file.
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 __itkGridForwardWarpImageFilter_h
00019 #define __itkGridForwardWarpImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00054 template<
00055   class TDisplacementField,
00056   class TOutputImage
00057   >
00058 class ITK_EXPORT GridForwardWarpImageFilter:
00059   public ImageToImageFilter< TDisplacementField, TOutputImage >
00060 {
00061 public:
00063   typedef GridForwardWarpImageFilter                             Self;
00064   typedef ImageToImageFilter< TDisplacementField, TOutputImage > Superclass;
00065   typedef SmartPointer< Self >                                   Pointer;
00066   typedef SmartPointer< const Self >                             ConstPointer;
00067 
00069   itkNewMacro(Self);
00070 
00072   itkTypeMacro(GridForwardWarpImageFilter, ImageToImageFilter);
00073 
00075   typedef typename TOutputImage::RegionType OutputImageRegionType;
00076 
00078   typedef typename Superclass::OutputImageType    OutputImageType;
00079   typedef typename Superclass::OutputImagePointer OutputImagePointer;
00080   typedef typename OutputImageType::IndexType     IndexType;
00081   typedef typename OutputImageType::SizeType      SizeType;
00082   typedef typename OutputImageType::PixelType     PixelType;
00083   typedef typename OutputImageType::SpacingType   SpacingType;
00084 
00086   itkStaticConstMacro(ImageDimension, unsigned int,
00087                       TOutputImage::ImageDimension);
00088   itkStaticConstMacro(DisplacementFieldDimension, unsigned int,
00089                       TDisplacementField::ImageDimension);
00091 
00093   typedef TDisplacementField                           DisplacementFieldType;
00094   typedef typename DisplacementFieldType::ConstPointer DisplacementFieldConstPointer;
00095   typedef typename DisplacementFieldType::PixelType    DisplacementType;
00096 
00098   itkSetMacro(BackgroundValue, PixelType);
00099 
00101   itkGetConstMacro(BackgroundValue, PixelType);
00102 
00104   itkSetMacro(ForegroundValue, PixelType);
00105 
00107   itkGetConstMacro(ForegroundValue, PixelType);
00108 
00109 #ifdef ITK_USE_CONCEPT_CHECKING
00110 
00111   itkConceptMacro( SameDimensionCheck,
00112                    ( Concept::SameDimension< ImageDimension, DisplacementFieldDimension > ) );
00113   itkConceptMacro( DisplacementFieldHasNumericTraitsCheck,
00114                    ( Concept::HasNumericTraits< typename TDisplacementField::PixelType::ValueType > ) );
00115 
00117 #endif
00118 protected:
00119   GridForwardWarpImageFilter();
00120   ~GridForwardWarpImageFilter() {}
00121 
00122   void PrintSelf(std::ostream & os, Indent indent) const;
00123 
00127   void GenerateData();
00128 
00129 private:
00130   GridForwardWarpImageFilter(const Self &); //purposely not implemented
00131   void operator=(const Self &);             //purposely not implemented
00132 
00133   PixelType    m_BackgroundValue;
00134   PixelType    m_ForegroundValue;
00135   unsigned int m_GridPixSpacing;
00136 };
00137 } // end namespace itk
00138 
00139 #ifndef ITK_MANUAL_INSTANTIATION
00140 #include "itkGridForwardWarpImageFilter.hxx"
00141 #endif
00142 
00143 #endif
00144