1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
19 #ifndef CLITKSLICEBYSLICERELATIVEPOSITIONFILTER_H
20 #define CLITKSLICEBYSLICERELATIVEPOSITIONFILTER_H
23 #include "clitkFilterBase.h"
27 //--------------------------------------------------------------------
29 Perform Relative Position filtering in a slice by slice manner.
31 //--------------------------------------------------------------------
33 template <class ImageType>
34 class ITK_EXPORT SliceBySliceRelativePositionFilter:
35 public clitk::FilterBase,
36 public itk::ImageToImageFilter<ImageType, ImageType>
40 /** Standard class typedefs. */
41 typedef itk::ImageToImageFilter<ImageType, ImageType> Superclass;
42 typedef SliceBySliceRelativePositionFilter Self;
43 typedef itk::SmartPointer<Self> Pointer;
44 typedef itk::SmartPointer<const Self> ConstPointer;
46 /** Method for creation through the object factory. */
49 /** Run-time type information (and related methods). */
50 itkTypeMacro(SliceBySliceRelativePositionFilter, ImageToImageFilter);
53 /** Some convenient typedefs. */
54 typedef typename ImageType::ConstPointer ImageConstPointer;
55 typedef typename ImageType::Pointer ImagePointer;
56 typedef typename ImageType::RegionType RegionType;
57 typedef typename ImageType::PixelType PixelType;
58 typedef typename ImageType::SpacingType SpacingType;
59 typedef typename ImageType::SizeType SizeType;
61 /** ImageDimension constants */
62 itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
63 typedef itk::Image<float, ImageDimension> FloatImageType;
65 /** Input : initial image and object */
66 void SetInput(const ImageType * image);
67 void SetInputObject(const ImageType * image);
70 itkGetConstMacro(Direction, int);
71 itkSetMacro(Direction, int);
72 itkGetConstMacro(ObjectBackgroundValue, PixelType);
73 itkSetMacro(ObjectBackgroundValue, PixelType);
76 SliceBySliceRelativePositionFilter();
77 virtual ~SliceBySliceRelativePositionFilter() {}
80 PixelType m_ObjectBackgroundValue;
82 virtual void GenerateOutputInformation();
83 virtual void GenerateInputRequestedRegion();
84 virtual void GenerateData();
88 ImagePointer m_working_input;
89 ImagePointer m_working_object;
92 SliceBySliceRelativePositionFilter(const Self&); //purposely not implemented
93 void operator=(const Self&); //purposely not implemented
96 //--------------------------------------------------------------------
98 } // end namespace clitk
99 //--------------------------------------------------------------------
101 #ifndef ITK_MANUAL_INSTANTIATION
102 #include "clitkSliceBySliceRelativePositionFilter.txx"