From a58b0ef3e9adb0fd28caeb807b7fd2c904c4363a Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 7 Jun 2022 16:33:06 +0200 Subject: [PATCH] #3487 BUG spacing in PolyDataToImage box --- bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx | 7 +++++++ 1 file changed, 7 insertions(+) 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(); -- 2.47.1