]> Creatis software - creaVtk.git/commitdiff
#3487 BUG spacing in PolyDataToImage box
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 7 Jun 2022 14:33:06 +0000 (16:33 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 7 Jun 2022 14:33:06 +0000 (16:33 +0200)
bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx

index 7813c429c58f61a35d42f41c9ba2ce14339d844d..66543b2179dfddb744d9cf802ddca067da97b7cc 100644 (file)
@@ -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();