ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkExpandImageFilter.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 __itkExpandImageFilter_h
00019 #define __itkExpandImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkLinearInterpolateImageFunction.h"
00023 
00024 namespace itk
00025 {
00066 template< class TInputImage, class TOutputImage >
00067 class ITK_EXPORT ExpandImageFilter:
00068   public ImageToImageFilter< TInputImage, TOutputImage >
00069 {
00070 public:
00072   typedef ExpandImageFilter                               Self;
00073   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00074   typedef SmartPointer< Self >                            Pointer;
00075   typedef SmartPointer< const Self >                      ConstPointer;
00076 
00078   itkNewMacro(Self);
00079 
00081   itkTypeMacro(ExpandImageFilter, ImageToImageFilter);
00082 
00084   typedef typename TOutputImage::RegionType OutputImageRegionType;
00085 
00087   itkStaticConstMacro(ImageDimension, unsigned int,
00088                       TInputImage::ImageDimension);
00089 
00091   typedef typename Superclass::InputImageType  InputImageType;
00092   typedef typename Superclass::OutputImageType OutputImageType;
00093   typedef typename OutputImageType::PixelType  OutputPixelType;
00094   typedef typename InputImageType::Pointer     InputImagePointer;
00095   typedef typename OutputImageType::Pointer    OutputImagePointer;
00096 
00098   typedef double                                                   CoordRepType;
00099   typedef InterpolateImageFunction< InputImageType, CoordRepType > InterpolatorType;
00100   typedef typename InterpolatorType::Pointer                       InterpolatorPointer;
00101   typedef LinearInterpolateImageFunction< InputImageType, CoordRepType >
00102   DefaultInterpolatorType;
00103 
00105   itkSetObjectMacro(Interpolator, InterpolatorType);
00106 
00108   itkGetObjectMacro(Interpolator, InterpolatorType);
00109 
00111   typedef FixedArray< unsigned int, ImageDimension > ExpandFactorsType;
00112 
00115   itkSetMacro(ExpandFactors, ExpandFactorsType);
00116   virtual void SetExpandFactors(const unsigned int factor);
00118 
00120   itkGetConstReferenceMacro(ExpandFactors, ExpandFactorsType);
00121 
00123 //TEST_RMV20100728   itkSetMacro( EdgePaddingValue, OutputPixelType );
00124 //TEST_RMV20100728
00125 
00127 //TEST_RMV20100728   itkGetConstMacro( EdgePaddingValue, OutputPixelType );
00128 
00135   virtual void GenerateOutputInformation();
00136 
00142   virtual void GenerateInputRequestedRegion();
00143 
00144 #ifdef ITK_USE_CONCEPT_CHECKING
00145 
00146   itkConceptMacro( InputHasNumericTraitsCheck,
00147                    ( Concept::HasNumericTraits< typename TInputImage::PixelType > ) );
00148   itkConceptMacro( OutputHasNumericTraitsCheck,
00149                    ( Concept::HasNumericTraits< OutputPixelType > ) );
00150 
00152 #endif
00153 protected:
00154   ExpandImageFilter();
00155   ~ExpandImageFilter() {}
00156   void PrintSelf(std::ostream & os, Indent indent) const;
00158 
00168   virtual
00169   void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
00170                             ThreadIdType threadId);
00171 
00174   virtual void BeforeThreadedGenerateData();
00175 
00176 private:
00177   ExpandImageFilter(const Self &); //purposely not implemented
00178   void operator=(const Self &);    //purposely not implemented
00179 
00180   ExpandFactorsType   m_ExpandFactors;
00181   InterpolatorPointer m_Interpolator;
00182 //TEST_RMV20100728 * \warning: The following is valid only when the flag
00183 //TEST_RMV20100728 * ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY is ON
00184 //TEST_RMV20100728 * The output image will not contain any padding, and
00185 // therefore the
00186 //TEST_RMV20100728 * EdgePaddingValue will not be used.
00187 //TEST_RMV20100728 *
00188 //TEST_RMV20100728  OutputPixelType        m_EdgePaddingValue;
00189 };
00190 } // end namespace itk
00191 
00192 #ifndef ITK_MANUAL_INSTANTIATION
00193 #include "itkExpandImageFilter.hxx"
00194 #endif
00195 
00196 #endif
00197