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://www.centreleonberard.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 CLITKSTRUCTURESEXTRACTIONFILTER_H
20 #define CLITKSTRUCTURESEXTRACTIONFILTER_H
23 #include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h"
24 #include "clitkFilterBase.h"
25 #include "clitkRelativePositionList.h"
29 //--------------------------------------------------------------------
31 - Convenient class to add some capabilities to a filter :
32 FilterBase, FilterWithAnatomicalFeatureDatabaseManagement and
35 //--------------------------------------------------------------------
36 template <class TImageType>
37 class StructuresExtractionFilter:
38 public virtual FilterBase,
39 public clitk::FilterWithAnatomicalFeatureDatabaseManagement,
40 public itk::ImageToImageFilter<TImageType, itk::Image<uchar, 3> >
43 // Standard class typedefs
44 typedef StructuresExtractionFilter Self;
45 typedef itk::ImageToImageFilter<TImageType, itk::Image<uchar, 3> > Superclass;
46 typedef itk::SmartPointer<Self> Pointer;
47 typedef itk::SmartPointer<const Self> ConstPointer;
49 /** Method for creation through the object factory. */
52 // Run-time type information (and related methods)
53 itkTypeMacro(StructuresExtractionFilter, ImageToImageFilter);
55 /** Some convenient typedefs. */
56 typedef TImageType ImageType;
57 typedef typename ImageType::ConstPointer ImageConstPointer;
58 typedef typename ImageType::Pointer ImagePointer;
59 typedef typename ImageType::RegionType ImageRegionType;
60 typedef typename ImageType::PixelType ImagePixelType;
61 typedef typename ImageType::SizeType ImageSizeType;
62 typedef typename ImageType::IndexType ImageIndexType;
63 typedef typename ImageType::PointType ImagePointType;
65 typedef uchar MaskImagePixelType;
66 typedef itk::Image<MaskImagePixelType, 3> MaskImageType;
67 typedef typename MaskImageType::Pointer MaskImagePointer;
68 typedef typename MaskImageType::RegionType MaskImageRegionType;
69 typedef typename MaskImageType::SizeType MaskImageSizeType;
70 typedef typename MaskImageType::IndexType MaskImageIndexType;
71 typedef typename MaskImageType::PointType MaskImagePointType;
73 typedef itk::Image<MaskImagePixelType, 2> MaskSliceType;
74 typedef typename MaskSliceType::Pointer MaskSlicePointer;
75 typedef typename MaskSliceType::PointType MaskSlicePointType;
76 typedef typename MaskSliceType::RegionType MaskSliceRegionType;
77 typedef typename MaskSliceType::SizeType MaskSliceSizeType;
78 typedef typename MaskSliceType::IndexType MaskSliceIndexType;
80 /** ImageDimension constants */
81 itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
84 itkGetConstMacro(BackgroundValue, MaskImagePixelType);
85 itkGetConstMacro(ForegroundValue, MaskImagePixelType);
86 itkSetMacro(BackgroundValue, MaskImagePixelType);
87 itkSetMacro(ForegroundValue, MaskImagePixelType);
89 // RelativePositionList management
90 void AddRelativePositionListFilename(std::string s);
91 MaskImagePointer ApplyRelativePositionList(std::string name, MaskImageType * input, bool overlap=false);
94 StructuresExtractionFilter();
95 virtual ~StructuresExtractionFilter() {}
97 virtual void GenerateData() {}
99 MaskImagePixelType m_BackgroundValue;
100 MaskImagePixelType m_ForegroundValue;
102 // RelativePositionList
103 std::vector<std::string> mListOfRelativePositionListFilename;
104 typedef clitk::RelativePositionList<MaskImageType> RelPosListType;
105 typedef typename RelPosListType::Pointer RelPosListPointer;
106 std::map<std::string, RelPosListPointer> mMapOfRelativePositionList;
109 StructuresExtractionFilter(const Self&); //purposely not implemented
110 void operator=(const Self&); //purposely not implemented
113 //--------------------------------------------------------------------
115 } // end namespace clitk
116 //--------------------------------------------------------------------
118 #include "clitkStructuresExtractionFilter.txx"
120 #endif // CLITKSTRUCTURESEXTRACTIONFILTER_H