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 void Read(std::string filename);
80 void SetFilterOptions(typename RelPosFilterType::Pointer filter, ArgsInfoType & options);
83 RelativePositionList();
84 virtual ~RelativePositionList() {}
87 RelativePositionList(const Self&); //purposely not implemented
88 void operator=(const Self&); //purposely not implemented
90 void GenerateInputRequestedRegion();
91 void GenerateOutputInformation();
94 std::string m_InputName;
95 ImagePixelType m_BackgroundValue;
96 ImagePixelType m_ForegroundValue;
97 typename SliceRelPosFilterType::Pointer mFilter;
98 std::vector<ArgsInfoType> mArgsInfoList;
99 ImagePointer m_working_input;
102 //--------------------------------------------------------------------
104 } // end namespace clitk
105 //--------------------------------------------------------------------
107 #include "clitkRelativePositionList.txx"