X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkDicomRT_ROI_ConvertToImageFilter.cxx;h=e3b34723fdc264865ee925ddac9cd549b836bd67;hb=a48894959f4e7df71c77c91da5e8723b2697a79c;hp=7b4d04e72609f6161a109aec2c32c9f836645bc5;hpb=c93a32f96e61514b8b945d515ffcf11c2a12ae66;p=clitk.git diff --git a/common/clitkDicomRT_ROI_ConvertToImageFilter.cxx b/common/clitkDicomRT_ROI_ConvertToImageFilter.cxx index 7b4d04e..e3b3472 100644 --- a/common/clitkDicomRT_ROI_ConvertToImageFilter.cxx +++ b/common/clitkDicomRT_ROI_ConvertToImageFilter.cxx @@ -4,7 +4,7 @@ Authors belongs to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -19,12 +19,18 @@ #include #include + +// clitk #include "clitkDicomRT_ROI_ConvertToImageFilter.h" +#include "clitkImageCommon.h" + +// vtk #include #include #include #include -#include "clitkImageCommon.h" +#include + //-------------------------------------------------------------------- clitk::DicomRT_ROI_ConvertToImageFilter::DicomRT_ROI_ConvertToImageFilter() @@ -121,11 +127,9 @@ void clitk::DicomRT_ROI_ConvertToImageFilter::Update() std::cerr << "Error. Please provide image info (spacing/origin) with SetImageFilename" << std::endl; exit(0); } - // DD("Update"); // Get Mesh vtkPolyData * mesh = mROI->GetMesh(); - DD(mesh->GetNumberOfCells()); // Get bounds double *bounds=mesh->GetBounds(); @@ -176,7 +180,8 @@ void clitk::DicomRT_ROI_ConvertToImageFilter::Update() // Extrude vtkSmartPointer extrude=vtkSmartPointer::New(); extrude->SetInput(mesh); - extrude->SetVector(0, 0, mROI->GetContourSpacing()); + ///We extrude in the -slice_spacing direction to respect the FOCAL convention (NEEDED !) + extrude->SetVector(0, 0, -mSpacing[2]); // Binarization vtkSmartPointer sts=vtkSmartPointer::New(); @@ -192,6 +197,14 @@ void clitk::DicomRT_ROI_ConvertToImageFilter::Update() stencil->SetInput(mBinaryImage); stencil->ReverseStencilOn(); stencil->Update(); + + /* + vtkSmartPointer w = vtkSmartPointer::New(); + w->SetInput(stencil->GetOutput()); + w->SetFileName("binary2.mhd"); + w->Write(); + */ + mBinaryImage->ShallowCopy(stencil->GetOutput()); if (mWriteOutput) {