1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
3 Main authors : XX XX XX
6 - University of LYON http://www.universite-lyon.fr/
7 - Léon Bérard cancer center http://www.centreleonberard.fr
8 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the copyright notices for more information.
14 It is distributed under dual licence
15 - BSD http://www.opensource.org/licenses/bsd-license.php
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
18 =========================================================================*/
25 #include "clitkImage2DicomRTStructFilter.h"
26 #include "clitkImageCommon.h"
27 #include "vvFromITK.h"
30 #include <vtkPolyDataToImageStencil.h>
31 #include <vtkSmartPointer.h>
32 #include <vtkImageStencil.h>
33 #include <vtkLinearExtrusionFilter.h>
34 #include <vtkMetaImageWriter.h>
35 #include <vtkImageData.h>
39 #include <itkVTKImageToImageFilter.h>
41 //--------------------------------------------------------------------
42 template<class PixelType>
43 clitk::Image2DicomRTStructFilter<PixelType>::Image2DicomRTStructFilter()
45 DD("Image2DicomRTStructFilter Const");
47 //--------------------------------------------------------------------
50 //--------------------------------------------------------------------
51 template<class PixelType>
52 clitk::Image2DicomRTStructFilter<PixelType>::~Image2DicomRTStructFilter()
54 DD("Image2DicomRTStructFilter Destructor");
56 //--------------------------------------------------------------------
59 //--------------------------------------------------------------------
60 template<class PixelType>
61 void clitk::Image2DicomRTStructFilter<PixelType>::Update()
63 DD("Image2DicomRTStructFilter::GenerateData");
66 std::string filename = "RS.zzQAnotmt_french01_.dcm";
67 clitk::DicomRT_StructureSet::Pointer structset = clitk::DicomRT_StructureSet::New();
68 structset->Read(filename);
70 DD(structset->GetName());
71 clitk::DicomRT_ROI * roi = structset->GetROIFromROINumber(1); // Aorta
73 DD(roi->GetROINumber());
75 // Add an image to the roi
76 vvImage::Pointer im = vvImageFromITK<3, PixelType>(m_Input);
81 roi->ComputeMeshFromImage();
82 vtkSmartPointer<vtkPolyData> mesh = roi->GetMesh();
85 // Change the mesh (shift by 10);
86 // const vtkSmartPointer<vtkPoints> & points = mesh->GetPoints();
87 // for(uint i=0; i<mesh->GetNumberOfVerts (); i++) {
89 // double * p = points->GetPoint(i);
91 // points->SetPoint(i, p);
94 roi->SetDicomUptodateFlag(false); // indicate that dicom info must be updated from the mesh.
100 structset->Write("toto.dcm");
102 //--------------------------------------------------------------------