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 CLITKCOORDINATESOFIMAGEBOUNDARIESCALCULATOR_H
20 #define CLITKCOORDINATESOFIMAGEBOUNDARIESCALCULATOR_H
23 #include "clitkCommon.h"
27 /* --------------------------------------------------------------------
28 Convert a mesh composed of a list of 2D contours, into a 3D binray
30 -------------------------------------------------------------------- */
32 template <class ImageType>
33 class ITK_EXPORT CoordinatesOfImageBoundariesCalculator: public itk::ImageSource<ImageType>
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;
43 /** Method for creation through the object factory. */
46 /** Run-time type information (and related methods). */
47 itkTypeMacro(CoordinatesOfImageBoundariesCalculator, Superclass);
49 /** ImageDimension constants */
50 itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
51 typedef itk::Image<float, ImageDimension> FloatImageType;
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;
63 /** Input : initial image and object */
64 itkSetMacro(Mesh, vtkSmartPointer<vtkPolyData>);
65 itkGetConstMacro(Mesh, vtkSmartPointer<vtkPolyData>);
67 itkSetMacro(LikeImage, ImagePointer);
68 itkGetConstMacro(LikeImage, ImagePointer);
74 CoordinatesOfImageBoundariesCalculator();
75 virtual ~CoordinatesOfImageBoundariesCalculator() {}
77 // virtual void GenerateOutputInformation();
78 // virtual void GenerateInputRequestedRegion();
79 virtual void GenerateData();
81 ImagePointer m_LikeImage;
82 vtkSmartPointer<vtkPolyData> m_Mesh;
85 CoordinatesOfImageBoundariesCalculator(const Self&); //purposely not implemented
86 void operator=(const Self&); //purposely not implemented
89 //--------------------------------------------------------------------
91 } // end namespace clitk
92 //--------------------------------------------------------------------
94 #ifndef ITK_MANUAL_INSTANTIATION
95 #include "clitkCoordinatesOfImageBoundariesCalculator.txx"