ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkVectorExpandImageFilter.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 __itkVectorExpandImageFilter_h
00019 #define __itkVectorExpandImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkVectorLinearInterpolateImageFunction.h"
00023 
00024 namespace itk
00025 {
00071 template< class TInputImage, class TOutputImage >
00072 class ITK_EXPORT VectorExpandImageFilter:
00073   public ImageToImageFilter< TInputImage, TOutputImage >
00074 {
00075 public:
00077   typedef VectorExpandImageFilter                         Self;
00078   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00079   typedef SmartPointer< Self >                            Pointer;
00080   typedef SmartPointer< const Self >                      ConstPointer;
00081 
00083   itkNewMacro(Self);
00084 
00086   typedef typename TInputImage::Pointer     InputImagePointer;
00087   typedef typename TOutputImage::Pointer    OutputImagePointer;
00088   typedef typename TOutputImage::RegionType OutputImageRegionType;
00089 
00091   itkTypeMacro(VectorExpandImageFilter, ImageToImageFilter);
00092 
00094   itkStaticConstMacro(ImageDimension, unsigned int,
00095                       TInputImage::ImageDimension);
00096 
00098   typedef typename Superclass::InputImageType  InputImageType;
00099   typedef typename Superclass::OutputImageType OutputImageType;
00100 
00102   typedef typename OutputImageType::PixelType OutputPixelType;
00103   typedef typename OutputPixelType::ValueType OutputValueType;
00104   typedef typename InputImageType::PixelType  InputPixelType;
00105   typedef typename InputPixelType::ValueType  InputValueType;
00106 
00108   enum { VectorDimension = InputPixelType::Dimension };
00109 
00111   typedef float                                           ExpandFactorsType;
00112   typedef FixedArray< ExpandFactorsType, ImageDimension > ExpandFactorsArrayType;
00113 
00115   typedef double                                                               CoordRepType;
00116   typedef VectorInterpolateImageFunction< InputImageType, CoordRepType >       InterpolatorType;
00117   typedef typename InterpolatorType::Pointer                                   InterpolatorPointer;
00118   typedef VectorLinearInterpolateImageFunction< InputImageType, CoordRepType > DefaultInterpolatorType;
00119 
00121   itkSetObjectMacro(Interpolator, InterpolatorType);
00122 
00124   itkGetObjectMacro(Interpolator, InterpolatorType);
00125 
00128   itkSetMacro(ExpandFactors, ExpandFactorsArrayType);
00129   virtual void SetExpandFactors(const float factor);
00130   itkSetVectorMacro(ExpandFactors, const unsigned int, ImageDimension);
00132 
00134   itkGetConstReferenceMacro(ExpandFactors, ExpandFactorsArrayType);
00135 
00138 //TEST_RMV20100728  virtual void SetEdgePaddingValue( const OutputPixelType&
00139 // value );
00140 //TEST_RMV20100728
00141 
00143 //TEST_RMV20100728  virtual const OutputPixelType& GetEdgePaddingValue()
00144 //TEST_RMV20100728    { return m_EdgePaddingValue; }
00145 
00152   virtual void GenerateOutputInformation();
00153 
00159   virtual void GenerateInputRequestedRegion();
00160 
00161 #ifdef ITK_USE_CONCEPT_CHECKING
00162 
00163   itkConceptMacro( InputHasNumericTraitsCheck,
00164                    ( Concept::HasNumericTraits< InputValueType > ) );
00165   itkConceptMacro( OutputHasNumericTraitsCheck,
00166                    ( Concept::HasNumericTraits< OutputValueType > ) );
00167 
00169 #endif
00170 protected:
00171 
00172   VectorExpandImageFilter();
00173   ~VectorExpandImageFilter() {}
00174   void PrintSelf(std::ostream & os, Indent indent) const;
00175 
00184   virtual
00185   void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
00186                             ThreadIdType threadId);
00187 
00190   virtual void BeforeThreadedGenerateData();
00191 
00192 private:
00193   VectorExpandImageFilter(const Self &); //purposely not implemented
00194   void operator=(const Self &);          //purposely not implemented
00195 
00196   ExpandFactorsArrayType   m_ExpandFactors;
00197   InterpolatorPointer      m_Interpolator;
00198 //TEST_RMV20100728 * \warning: The following is valid only when the flag
00199 //TEST_RMV20100728 * ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY is ON
00200 //TEST_RMV20100728 * The output image will not contain any padding, and
00201 // therefore the
00202 //TEST_RMV20100728 * EdgePaddingValue will not be used.
00203 //TEST_RMV20100728 *
00204 //TEST_RMV20100728  OutputPixelType        m_EdgePaddingValue;
00205 };
00206 } // end namespace itk
00207 
00208 #ifndef ITK_MANUAL_INSTANTIATION
00209 #include "itkVectorExpandImageFilter.hxx"
00210 #endif
00211 
00212 #endif
00213