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 AddRelativePositionConstraintToLabelImageFilter<ImageType>
40 /** Standard class typedefs. */
41 typedef AddRelativePositionConstraintToLabelImageFilter<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 /** ImageDimension constants */
54 itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
55 typedef itk::Image<float, ImageDimension> FloatImageType;
57 /** Some convenient typedefs. */
58 typedef typename ImageType::ConstPointer ImageConstPointer;
59 typedef typename ImageType::Pointer ImagePointer;
60 typedef typename ImageType::RegionType RegionType;
61 typedef typename ImageType::PixelType PixelType;
62 typedef typename ImageType::SpacingType SpacingType;
63 typedef typename ImageType::SizeType SizeType;
64 typedef itk::Image<PixelType, ImageDimension-1> SliceType;
65 typedef clitk::AddRelativePositionConstraintToLabelImageFilter<SliceType> RelPosFilterType;
66 typedef typename RelPosFilterType::OrientationTypeEnumeration OrientationTypeEnumeration;
68 /** Input : initial image and object */
69 void SetInput(const ImageType * image);
70 void SetInputObject(const ImageType * image);
74 itkGetConstMacro(Direction, int);
75 itkSetMacro(Direction, int);
76 // itkGetConstMacro(ObjectBackgroundValue, PixelType);
77 // itkSetMacro(ObjectBackgroundValue, PixelType);
79 // itkSetMacro(OrientationTypeString, std::string);
80 // itkGetConstMacro(OrientationTypeString, std::string);
82 // itkGetConstMacro(ResampleBeforeRelativePositionFilter, bool);
83 // itkSetMacro(ResampleBeforeRelativePositionFilter, bool);
84 // itkBooleanMacro(ResampleBeforeRelativePositionFilter);
86 // itkGetConstMacro(IntermediateSpacing, double);
87 // itkSetMacro(IntermediateSpacing, double);
89 // itkGetConstMacro(FuzzyThreshold, double);
90 // itkSetMacro(FuzzyThreshold, double);
92 itkGetConstMacro(UniqueConnectedComponentBySlice, bool);
93 itkSetMacro(UniqueConnectedComponentBySlice, bool);
94 itkBooleanMacro(UniqueConnectedComponentBySlice);
96 // itkGetConstMacro(AutoCropFlag, bool);
97 // itkSetMacro(AutoCropFlag, bool);
98 // itkBooleanMacro(AutoCropFlag);
100 // itkGetConstMacro(InverseOrientationFlag, bool);
101 // itkSetMacro(InverseOrientationFlag, bool);
102 // itkBooleanMacro(InverseOrientationFlag);
104 // itkGetConstMacro(RemoveObjectFlag, bool);
105 // itkSetMacro(RemoveObjectFlag, bool);
106 // itkBooleanMacro(RemoveObjectFlag);
108 // itkGetConstMacro(CombineWithOrFlag, bool);
109 // itkSetMacro(CombineWithOrFlag, bool);
110 // itkBooleanMacro(CombineWithOrFlag);
113 SliceBySliceRelativePositionFilter();
114 virtual ~SliceBySliceRelativePositionFilter() {}
116 // PixelType m_ObjectBackgroundValue;
117 // OrientationTypeEnumeration m_OrientationType;
118 // std::string m_OrientationTypeString;
119 // double m_IntermediateSpacing;
120 // double m_FuzzyThreshold;
121 // bool m_ResampleBeforeRelativePositionFilter;
123 virtual void GenerateOutputInformation();
124 virtual void GenerateInputRequestedRegion();
125 virtual void GenerateData();
129 ImagePointer m_working_input;
130 ImagePointer m_working_object;
131 bool m_UniqueConnectedComponentBySlice;
133 // bool m_InverseOrientationFlag;
134 // bool m_RemoveObjectFlag;
135 // bool m_AutoCropFlag;
136 // bool m_CombineWithOrFlag;
139 SliceBySliceRelativePositionFilter(const Self&); //purposely not implemented
140 void operator=(const Self&); //purposely not implemented
143 //--------------------------------------------------------------------
145 } // end namespace clitk
146 //--------------------------------------------------------------------
148 #ifndef ITK_MANUAL_INSTANTIATION
149 #include "clitkSliceBySliceRelativePositionFilter.txx"