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"
24 #include "clitkAddRelativePositionConstraintToLabelImageFilter.h"
28 //--------------------------------------------------------------------
30 Perform Relative Position filtering in a slice by slice manner.
32 //--------------------------------------------------------------------
34 template <class ImageType>
35 class ITK_EXPORT SliceBySliceRelativePositionFilter:
36 public clitk::FilterBase,
37 public itk::ImageToImageFilter<ImageType, ImageType>
41 /** Standard class typedefs. */
42 typedef itk::ImageToImageFilter<ImageType, ImageType> Superclass;
43 typedef SliceBySliceRelativePositionFilter Self;
44 typedef itk::SmartPointer<Self> Pointer;
45 typedef itk::SmartPointer<const Self> ConstPointer;
47 /** Method for creation through the object factory. */
50 /** Run-time type information (and related methods). */
51 itkTypeMacro(SliceBySliceRelativePositionFilter, ImageToImageFilter);
54 /** ImageDimension constants */
55 itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
56 typedef itk::Image<float, ImageDimension> FloatImageType;
58 /** Some convenient typedefs. */
59 typedef typename ImageType::ConstPointer ImageConstPointer;
60 typedef typename ImageType::Pointer ImagePointer;
61 typedef typename ImageType::RegionType RegionType;
62 typedef typename ImageType::PixelType PixelType;
63 typedef typename ImageType::SpacingType SpacingType;
64 typedef typename ImageType::SizeType SizeType;
65 typedef itk::Image<PixelType, ImageDimension-1> SliceType;
66 typedef clitk::AddRelativePositionConstraintToLabelImageFilter<SliceType> RelPosFilterType;
67 typedef typename RelPosFilterType::OrientationTypeEnumeration OrientationTypeEnumeration;
69 /** Input : initial image and object */
70 void SetInput(const ImageType * image);
71 void SetInputObject(const ImageType * image);
74 itkGetConstMacro(Direction, int);
75 itkSetMacro(Direction, int);
76 itkGetConstMacro(ObjectBackgroundValue, PixelType);
77 itkSetMacro(ObjectBackgroundValue, PixelType);
79 itkSetMacro(OrientationType, OrientationTypeEnumeration);
80 itkGetConstMacro(OrientationType, OrientationTypeEnumeration);
81 itkGetConstMacro(ResampleBeforeRelativePositionFilter, bool);
82 itkSetMacro(ResampleBeforeRelativePositionFilter, bool);
83 itkBooleanMacro(ResampleBeforeRelativePositionFilter);
84 itkGetConstMacro(IntermediateSpacing, double);
85 itkSetMacro(IntermediateSpacing, double);
86 itkGetConstMacro(FuzzyThreshold, double);
87 itkSetMacro(FuzzyThreshold, double);
90 SliceBySliceRelativePositionFilter();
91 virtual ~SliceBySliceRelativePositionFilter() {}
94 PixelType m_ObjectBackgroundValue;
95 OrientationTypeEnumeration m_OrientationType;
96 double m_IntermediateSpacing;
97 double m_FuzzyThreshold;
98 bool m_ResampleBeforeRelativePositionFilter;
100 virtual void GenerateOutputInformation();
101 virtual void GenerateInputRequestedRegion();
102 virtual void GenerateData();
106 ImagePointer m_working_input;
107 ImagePointer m_working_object;
110 SliceBySliceRelativePositionFilter(const Self&); //purposely not implemented
111 void operator=(const Self&); //purposely not implemented
114 //--------------------------------------------------------------------
116 } // end namespace clitk
117 //--------------------------------------------------------------------
119 #ifndef ITK_MANUAL_INSTANTIATION
120 #include "clitkSliceBySliceRelativePositionFilter.txx"