X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMesh.cxx;h=5b11d48e2d65e1a0bc8a9edb52384127a7e4c55d;hb=6f0512791afca0b1da36e332380b87f8d222cbad;hp=d666a21f76a14bcc54a1e1120bb5c0e9fa9bfc0e;hpb=1e034c70105f0926939acaaa27ddb46e904ae8bf;p=clitk.git diff --git a/vv/vvMesh.cxx b/vv/vvMesh.cxx index d666a21..5b11d48 100644 --- a/vv/vvMesh.cxx +++ b/vv/vvMesh.cxx @@ -3,7 +3,7 @@ Authors belong 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 @@ -14,10 +14,23 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ + +//std #include #include #include + +// clitk +#include "clitkCommon.h" + +// vv +#include "vvMesh.h" + +// itk +#include + +// vtk #include #include #include @@ -25,14 +38,10 @@ #include #include #include -#include "clitkCommon.h" -#include "vvMesh.h" #include #include #include #include -#include - #include vvMesh::vvMesh() : @@ -49,7 +58,6 @@ void vvMesh::AddMesh(vtkPolyData* p) void vvMesh::ReadFromVTK(const char * filename) { - DD("hello!"); std::string extension=itksys::SystemTools::GetFilenameLastExtension(std::string(filename)); if (extension == ".vtk" || extension== ".VTK") { assert(GetNumberOfMeshes() == 0); ///We assume the object is empty @@ -133,6 +141,7 @@ void vvMesh::ComputeMasks(vtkImageData* sample,bool extrude) double * samp_origin=sample->GetOrigin(); double * spacing=sample->GetSpacing(); binary_image->SetSpacing(spacing); + /// Put the origin on a voxel to avoid small skips binary_image->SetOrigin(floor((bounds[0]-samp_origin[0])/spacing[0]-2)*spacing[0]+samp_origin[0], floor((bounds[2]-samp_origin[1])/spacing[1]-2)*spacing[1]+samp_origin[1], @@ -165,10 +174,13 @@ void vvMesh::ComputeMasks(vtkImageData* sample,bool extrude) stencil->SetInput(binary_image); stencil->Update(); this->AddMask(stencil->GetOutput()); - //vtkSmartPointer w = vtkSmartPointer::New(); - //w->SetInput(stencil->GetOutput()); - //w->SetFileName("binary.mhd"); - //w->Write(); + + /* + vtkSmartPointer w = vtkSmartPointer::New(); + w->SetInput(stencil->GetOutput()); + w->SetFileName("binary.mhd"); + w->Write(); + */ } }