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 CLITKMESHTOBINARYIMAGEFILTER_H
20 #define CLITKMESHTOBINARYIMAGEFILTER_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 MeshToBinaryImageFilter: public itk::ImageSource<ImageType>
37 /** Standard class typedefs. */
38 typedef itk::ImageSource<ImageType> Superclass;
39 typedef MeshToBinaryImageFilter 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(MeshToBinaryImageFilter, 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);
71 MeshToBinaryImageFilter();
72 virtual ~MeshToBinaryImageFilter() {}
74 virtual void GenerateOutputInformation();
75 virtual void GenerateData();
77 ImagePointer m_LikeImage;
78 vtkSmartPointer<vtkPolyData> m_Mesh;
81 MeshToBinaryImageFilter(const Self&); //purposely not implemented
82 void operator=(const Self&); //purposely not implemented
85 //--------------------------------------------------------------------
87 } // end namespace clitk
88 //--------------------------------------------------------------------
90 #ifndef ITK_MANUAL_INSTANTIATION
91 #include "clitkMeshToBinaryImageFilter.txx"