ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkExtractOrthogonalSwath2DImageFilter.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 __itkExtractOrthogonalSwath2DImageFilter_h
00019 #define __itkExtractOrthogonalSwath2DImageFilter_h
00020 
00021 #include "itkImageAndPathToImageFilter.h"
00022 #include "itkParametricPath.h"
00023 
00024 namespace itk
00025 {
00041 template< class TImage >
00042 class ITK_EXPORT ExtractOrthogonalSwath2DImageFilter:public
00043   ImageAndPathToImageFilter< TImage, ParametricPath< 2 >, TImage >
00044 {
00045 public:
00047   typedef ExtractOrthogonalSwath2DImageFilter Self;
00048   typedef ImageAndPathToImageFilter< TImage, ParametricPath< 2 >, TImage >
00049   Superclass;
00050   typedef SmartPointer< Self >       Pointer;
00051   typedef SmartPointer< const Self > ConstPointer;
00052 
00054   itkNewMacro(Self);
00055 
00057   itkTypeMacro(ExtractOrthogonalSwath2DImageFilter, ImageAndPathToImageFilter);
00058 
00060   typedef           TImage                        ImageType;
00061   typedef typename  ImageType::Pointer            ImagePointer;
00062   typedef typename  ImageType::ConstPointer       ImageConstPointer;
00063   typedef typename  ImageType::RegionType         ImageRegionType;
00064   typedef typename  ImageType::IndexType          ImageIndexType;
00065   typedef typename  ImageType::PixelType          ImagePixelType;
00066   typedef           ParametricPath< 2 >           PathType;
00067   typedef typename  PathType::ConstPointer        PathConstPointer;
00068   typedef typename  PathType::InputType           PathInputType;
00069   typedef typename  PathType::OutputType          PathOutputType;
00070   typedef typename  PathType::IndexType           PathIndexType;
00071   typedef typename  PathType::ContinuousIndexType PathContinuousIndexType;
00072   typedef typename  PathType::OffsetType          PathOffsetType;
00073   typedef typename  PathType::VectorType          PathVectorType;
00074   typedef typename  ImageType::SizeType           SizeType;
00075 
00077   itkStaticConstMacro(PathDimension, unsigned int,
00078                       2);
00079   itkStaticConstMacro(ImageDimension, unsigned int,
00080                       TImage::ImageDimension);
00082 
00089   virtual void SetSpacing(const double *spacing);
00090 
00091   virtual void SetSpacing(const float *spacing);
00092 
00093   virtual const double * GetSpacing() const;
00094 
00099   virtual void SetOrigin(const double *origin);
00100 
00101   virtual void SetOrigin(const float *origin);
00102 
00103   virtual const double * GetOrigin() const;
00104 
00107   itkSetMacro(Size, SizeType)
00108 
00109 
00111   itkSetMacro(DefaultPixelValue, ImagePixelType)
00112 
00113   //--------------------------------------------------------------------------
00114   //
00115 
00117   virtual void EnlargeOutputRequestedRegion(DataObject *output)
00118   {
00119     output->SetRequestedRegionToLargestPossibleRegion();
00120   }
00121 
00122   //
00123   //--------------------------------------------------------------------------
00124 protected:
00125   ExtractOrthogonalSwath2DImageFilter()
00126   {
00127     m_DefaultPixelValue = NumericTraits< ImagePixelType >::Zero;
00128     m_Size[0] = 512;
00129     m_Size[1] = 16 * 2 + 1; // must be odd
00130     m_Origin[0]  = m_Origin[1]  = 0.0;
00131     m_Spacing[0] = m_Spacing[1] = 1.0;
00132   }
00133 
00134   virtual ~ExtractOrthogonalSwath2DImageFilter() {}
00135   void PrintSelf(std::ostream & os, Indent indent) const;
00136 
00137   //--------------------------------------------------------------------------
00138   //
00139 
00141   virtual void GenerateOutputInformation(void);
00142 
00144   virtual void GenerateInputRequestedRegion()
00145   {
00146     Superclass::GenerateInputRequestedRegion();
00147     ( const_cast< ImageType * >( this->GetImageInput() ) )->
00148     SetRequestedRegionToLargestPossibleRegion();
00149     ( const_cast< PathType * >( this->GetPathInput() ) )->
00150     SetRequestedRegionToLargestPossibleRegion();
00151   }
00153 
00154   virtual void GenerateData(void);
00155 
00156   //
00157   //--------------------------------------------------------------------------
00158 private:
00159   ExtractOrthogonalSwath2DImageFilter(const Self &); //purposely not implemented
00160   void operator=(const Self &);                      //purposely not implemented
00161 
00162   ImagePixelType m_DefaultPixelValue;
00163   SizeType       m_Size;
00164   double         m_Origin[ImageDimension];
00165   double         m_Spacing[ImageDimension];
00166 };
00167 } // end namespace itk
00168 
00169 #ifndef ITK_MANUAL_INSTANTIATION
00170 #include "itkExtractOrthogonalSwath2DImageFilter.hxx"
00171 #endif
00172 
00173 #endif
00174