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 CLITKLABELIMAGEOVERLAPMEASUREFILTER_H
20 #define CLITKRELATIVEPOSITIONANALYZERFILTER_H
23 #include "clitkFilterBase.h"
24 #include "clitkCropLikeImageFilter.h"
25 #include "clitkSegmentationUtils.h"
26 // #include "itkLabelOverlapMeasuresImageFilter.h"
29 #include <itkImageToImageFilter.h>
30 #include <itkLabelStatisticsImageFilter.h>
34 //--------------------------------------------------------------------
36 Analyze the relative position of a Target (mask image) according
37 to some Object, in a given Support. Indicate the main important
38 position of this Target according the Object.
40 //--------------------------------------------------------------------
42 template <class ImageType>
43 class LabelImageOverlapMeasureFilter:
44 public virtual FilterBase,
45 public itk::ImageToImageFilter<ImageType, ImageType>
49 /** Standard class typedefs. */
50 typedef itk::ImageToImageFilter<ImageType, ImageType> Superclass;
51 typedef LabelImageOverlapMeasureFilter<ImageType> Self;
52 typedef itk::SmartPointer<Self> Pointer;
53 typedef itk::SmartPointer<const Self> ConstPointer;
55 /** Method for creation through the object factory. */
58 /** Run-time type information (and related methods). */
59 itkTypeMacro(LabelImageOverlapMeasureFilter, ImageToImageFilter);
61 /** Some convenient typedefs. */
62 typedef typename ImageType::ConstPointer ImageConstPointer;
63 typedef typename ImageType::Pointer ImagePointer;
64 typedef typename ImageType::RegionType RegionType;
65 typedef typename ImageType::PixelType PixelType;
66 typedef typename ImageType::SpacingType SpacingType;
67 typedef typename ImageType::SizeType SizeType;
68 typedef typename ImageType::IndexType IndexType;
69 typedef typename ImageType::PointType PointType;
71 /** ImageDimension constants */
72 itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
76 itkGetConstMacro(BackgroundValue, PixelType);
77 itkSetMacro(BackgroundValue, PixelType);
79 itkGetConstMacro(Label1, PixelType);
80 itkSetMacro(Label1, PixelType);
82 itkGetConstMacro(Label2, PixelType);
83 itkSetMacro(Label2, PixelType);
85 // I dont want to verify inputs information
86 virtual void VerifyInputInformation() { }
89 LabelImageOverlapMeasureFilter();
90 virtual ~LabelImageOverlapMeasureFilter() {}
92 PixelType m_BackgroundValue;
95 ImagePointer m_Input1;
96 ImagePointer m_Input2;
98 virtual void GenerateOutputInformation();
99 virtual void GenerateInputRequestedRegion();
100 virtual void GenerateData();
103 LabelImageOverlapMeasureFilter(const Self&); //purposely not implemented
104 void operator=(const Self&); //purposely not implemented
107 //--------------------------------------------------------------------
109 } // end namespace clitk
110 //--------------------------------------------------------------------
112 #include "clitkLabelImageOverlapMeasureFilter.txx"