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 CLITKRELATIVEPOSITIONLIST_H
20 #define CLITKRELATIVEPOSITIONLIST_H
23 #include "clitkSegmentationUtils.h"
24 #include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h"
25 #include "clitkRelativePosition_ggo.h"
29 /*--------------------------------------------------------------------
30 Manage a list of RelativePosition operations, to be performed on
31 the same input image, with different objects and parameters.
32 ------------------------------------------------------------------*/
34 template <class TImageType>
35 class ITK_EXPORT RelativePositionList:
36 public virtual clitk::FilterBase,
37 public clitk::FilterWithAnatomicalFeatureDatabaseManagement,
38 public itk::ImageToImageFilter<TImageType, TImageType>
42 /** Standard class typedefs. */
43 typedef itk::ImageToImageFilter<TImageType, TImageType> Superclass;
44 typedef RelativePositionList Self;
45 typedef itk::SmartPointer<Self> Pointer;
46 typedef itk::SmartPointer<const Self> ConstPointer;
48 /** Method for creation through the object factory. */
51 /** Run-time type information (and related methods). */
52 itkTypeMacro(RelativePositionList, ImageToImageFilter);
54 /** Some convenient typedefs. */
55 typedef TImageType ImageType;
56 typedef typename ImageType::ConstPointer ImageConstPointer;
57 typedef typename ImageType::Pointer ImagePointer;
58 typedef typename ImageType::RegionType ImageRegionType;
59 typedef typename ImageType::PixelType ImagePixelType;
60 typedef typename ImageType::SizeType ImageSizeType;
61 typedef typename ImageType::IndexType ImageIndexType;
62 typedef typename ImageType::PointType ImagePointType;
63 typedef struct args_info_clitkRelativePosition ArgsInfoType;
64 typedef SliceBySliceRelativePositionFilter<ImageType> SliceRelPosFilterType;
65 typedef AddRelativePositionConstraintToLabelImageFilter<ImageType> RelPosFilterType;
67 /** ImageDimension constants */
68 itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
71 itkGetConstMacro(BackgroundValue, ImagePixelType);
72 itkGetConstMacro(ForegroundValue, ImagePixelType);
73 itkSetMacro(BackgroundValue, ImagePixelType);
74 itkSetMacro(ForegroundValue, ImagePixelType);
76 itkSetMacro(InputName, std::string);
77 itkGetConstMacro(InputName, std::string);
79 itkGetConstMacro(ComputeOverlapFlag, bool);
80 itkSetMacro(ComputeOverlapFlag, bool);
81 itkBooleanMacro(ComputeOverlapFlag);
83 void Read(std::string filename);
84 void SetFilterOptions(typename RelPosFilterType::Pointer filter, ArgsInfoType & options);
85 void SetReferenceImageForOverlapMeasure(ImagePointer ref);
88 RelativePositionList();
89 virtual ~RelativePositionList() {}
92 RelativePositionList(const Self&); //purposely not implemented
93 void operator=(const Self&); //purposely not implemented
95 void GenerateInputRequestedRegion();
96 void GenerateOutputInformation();
99 std::string m_InputName;
100 ImagePixelType m_BackgroundValue;
101 ImagePixelType m_ForegroundValue;
102 typename SliceRelPosFilterType::Pointer mFilter;
103 std::vector<ArgsInfoType> mArgsInfoList;
104 ImagePointer m_working_input;
105 ImagePointer m_reference;
106 bool m_ComputeOverlapFlag;
109 //--------------------------------------------------------------------
111 } // end namespace clitk
112 //--------------------------------------------------------------------
114 #include "clitkRelativePositionList.txx"