]> Creatis software - clitk.git/blob - itk/clitkCoordinatesOfImageBoundariesCalculator.h
Add reverse flag in clitkDicom2Image
[clitk.git] / itk / clitkCoordinatesOfImageBoundariesCalculator.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
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
8
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.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17   ======================================================================-====*/
18
19 #ifndef CLITKCOORDINATESOFIMAGEBOUNDARIESCALCULATOR_H
20 #define CLITKCOORDINATESOFIMAGEBOUNDARIESCALCULATOR_H
21
22 // clitk
23 #include "clitkCommon.h"
24
25 namespace clitk {
26     
27   /* --------------------------------------------------------------------     
28      Convert a mesh composed of a list of 2D contours, into a 3D binray
29      image.     
30      -------------------------------------------------------------------- */
31   
32   template <class ImageType>
33   class ITK_EXPORT CoordinatesOfImageBoundariesCalculator: public itk::ImageSource<ImageType>
34   {
35
36   public:
37     /** Standard class typedefs. */
38     typedef itk::ImageSource<ImageType>   Superclass;
39     typedef CoordinatesOfImageBoundariesCalculator       Self;
40     typedef itk::SmartPointer<Self>       Pointer;
41     typedef itk::SmartPointer<const Self> ConstPointer;
42        
43     /** Method for creation through the object factory. */
44     itkNewMacro(Self);
45     
46     /** Run-time type information (and related methods). */
47     itkTypeMacro(CoordinatesOfImageBoundariesCalculator, Superclass);
48
49     /** ImageDimension constants */
50     itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
51     typedef itk::Image<float, ImageDimension> FloatImageType;
52
53     /** Some convenient typedefs. */
54     typedef typename ImageType::ConstPointer ImageConstPointer;
55     typedef typename ImageType::Pointer      ImagePointer;
56     typedef typename ImageType::RegionType   RegionType; 
57     typedef typename ImageType::PixelType    PixelType;
58     typedef typename ImageType::SpacingType  SpacingType;
59     typedef typename ImageType::SizeType     SizeType;
60     typedef typename ImageType::PointType    PointType;
61     typedef itk::Image<PixelType, ImageDimension-1> SliceType;
62     
63     /** Input : initial image and object */
64     itkSetMacro(Mesh, vtkSmartPointer<vtkPolyData>);
65     itkGetConstMacro(Mesh, vtkSmartPointer<vtkPolyData>);
66
67     itkSetMacro(LikeImage, ImagePointer);
68     itkGetConstMacro(LikeImage, ImagePointer);
69
70     // Options
71   
72
73   protected:
74     CoordinatesOfImageBoundariesCalculator();
75     virtual ~CoordinatesOfImageBoundariesCalculator() {}
76     
77     // virtual void GenerateOutputInformation();
78     // virtual void GenerateInputRequestedRegion();
79     virtual void GenerateData();
80
81     ImagePointer m_LikeImage;
82     vtkSmartPointer<vtkPolyData> m_Mesh;
83
84   private:
85     CoordinatesOfImageBoundariesCalculator(const Self&); //purposely not implemented
86     void operator=(const Self&); //purposely not implemented
87     
88   }; // end class
89   //--------------------------------------------------------------------
90
91 } // end namespace clitk
92 //--------------------------------------------------------------------
93
94 #ifndef ITK_MANUAL_INSTANTIATION
95 #include "clitkCoordinatesOfImageBoundariesCalculator.txx"
96 #endif
97
98 #endif