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);
77 itkGetConstMacro(UniqueConnectedComponentBySlice, bool);
78 itkSetMacro(UniqueConnectedComponentBySlice, bool);
79 itkBooleanMacro(UniqueConnectedComponentBySlice);
81 itkGetConstMacro(IgnoreEmptySliceObjectFlag, bool);
82 itkSetMacro(IgnoreEmptySliceObjectFlag, bool);
83 itkBooleanMacro(IgnoreEmptySliceObjectFlag);
85 itkGetConstMacro(UseASingleObjectConnectedComponentBySliceFlag, bool);
86 itkSetMacro(UseASingleObjectConnectedComponentBySliceFlag, bool);
87 itkBooleanMacro(UseASingleObjectConnectedComponentBySliceFlag);
90 SliceBySliceRelativePositionFilter();
91 virtual ~SliceBySliceRelativePositionFilter() {}
93 virtual void GenerateOutputInformation();
94 virtual void GenerateInputRequestedRegion();
95 virtual void GenerateData();
99 ImagePointer m_working_input;
100 ImagePointer m_working_object;
101 bool m_UniqueConnectedComponentBySlice;
103 bool m_IgnoreEmptySliceObjectFlag;
104 bool m_UseASingleObjectConnectedComponentBySliceFlag;
107 SliceBySliceRelativePositionFilter(const Self&); //purposely not implemented
108 void operator=(const Self&); //purposely not implemented
111 //--------------------------------------------------------------------
113 } // end namespace clitk
114 //--------------------------------------------------------------------
116 #ifndef ITK_MANUAL_INSTANTIATION
117 #include "clitkSliceBySliceRelativePositionFilter.txx"