From: Eduardo DAVILA Date: Tue, 7 Jun 2022 14:33:06 +0000 (+0200) Subject: #3487 BUG spacing in PolyDataToImage box X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a58b0ef3e9adb0fd28caeb807b7fd2c904c4363a;p=creaVtk.git #3487 BUG spacing in PolyDataToImage box --- diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx index 7813c42..66543b2 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx @@ -36,6 +36,11 @@ void PolyDataToImageData::Process() printf("EED Warnning!! PolyDataToImageData::Process Clean this code .................;\n "); int ext[6]; bbGetInputInImage()->GetExtent( ext ); + double spc[3]; + bbGetInputInImage()->GetSpacing( spc ); + double org[3]; + bbGetInputInImage()->GetOrigin( org ); + // vtkCleanPolyData *clean1 = vtkCleanPolyData::New(); if (clean1!=NULL) clean1->Delete(); clean1 = vtkCleanPolyData::New(); @@ -48,6 +53,8 @@ printf("EED Warnning!! PolyDataToImageData::Process Clean this code ......... if (dataToStencil!=NULL) dataToStencil->Delete(); dataToStencil = vtkPolyDataToImageStencil::New(); dataToStencil->SetInputData( triangle1->GetOutput() ); + dataToStencil->SetOutputOrigin( org ); + dataToStencil->SetOutputSpacing( spc ); dataToStencil->SetOutputWholeExtent( ext ); dataToStencil->Update(); // vtkExtractVOI *extract = vtkExtractVOI::New();