From 4df545231e17fa12f81bb5cc4944cd66d74d170e Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 9 Jul 2013 22:56:39 +0200 Subject: [PATCH] 2041 Feature box SliceImage of XY,YZ,XZ and FREE planes --- bbtk/src/bbcreaMaracasVisuSliceImage.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bbtk/src/bbcreaMaracasVisuSliceImage.cxx b/bbtk/src/bbcreaMaracasVisuSliceImage.cxx index 9b015c2..10306c6 100644 --- a/bbtk/src/bbcreaMaracasVisuSliceImage.cxx +++ b/bbtk/src/bbcreaMaracasVisuSliceImage.cxx @@ -42,6 +42,12 @@ void SliceImage::Process() imageReslice->SetInput( bbGetInputIn() ); imageReslice->SetInformationInput(bbGetInputIn() ); + double slice=bbGetInputSlice(); + if (slice<0) + { + slice=0; + } + if (bbGetInputTypeOrientation()==3) { // Orientation 3 = FREE @@ -59,7 +65,7 @@ void SliceImage::Process() bbGetInputResliceAxesDirectionCosines()[5], // v2z bbGetInputResliceAxesDirectionCosines()[8] // v3z ); - imageReslice->SetResliceAxesOrigin( bbGetInputSlice()*bbGetInputIn()->GetSpacing()[0] ,0 ,0); + imageReslice->SetResliceAxesOrigin( slice*bbGetInputIn()->GetSpacing()[0] ,0 ,0); } else if (bbGetInputTypeOrientation()==2) { // Orientation 2 = YZ @@ -68,7 +74,7 @@ void SliceImage::Process() // v3 = [ 0 ,-1 , 0 ] // SetResliceAxesDirectionCosines(v1x,v2x,v3x,v1y,v2y,v3y,v1z,v2z,v3z); imageReslice->SetResliceAxesDirectionCosines(0,1,0, 0,0,-1 ,-1,0,0); - imageReslice->SetResliceAxesOrigin( bbGetInputSlice()*bbGetInputIn()->GetSpacing()[0] ,0 ,0); + imageReslice->SetResliceAxesOrigin( slice*bbGetInputIn()->GetSpacing()[0] ,0 ,0); } else if (bbGetInputTypeOrientation()==1) { // Orientation 1 = XZ // v1 = [ 1 , 0 , 0 ] @@ -76,7 +82,7 @@ void SliceImage::Process() // v3 = [ 0 ,-1 , 0 ] // SetResliceAxesDirectionCosines(v1x,v2x,v3x,v1y,v2y,v3y,v1z,v2z,v3z); imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,0,-1 ,0,1,0); - imageReslice->SetResliceAxesOrigin(0, bbGetInputSlice()*bbGetInputIn()->GetSpacing()[1],0 ); + imageReslice->SetResliceAxesOrigin(0, slice*bbGetInputIn()->GetSpacing()[1],0 ); } else { // Orientation 0 = XY @@ -85,7 +91,7 @@ void SliceImage::Process() // v3 = [ 0 , 0 , 1 ] // SetResliceAxesDirectionCosines(v1x,v2x,v3x,v1y,v2y,v3y,v1z,v2z,v3z); imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1); - imageReslice->SetResliceAxesOrigin(0,0, bbGetInputSlice()*bbGetInputIn()->GetSpacing()[2] ); + imageReslice->SetResliceAxesOrigin(0,0, slice*bbGetInputIn()->GetSpacing()[2] ); } imageReslice->SetOutputDimensionality(2); imageReslice->SetInterpolationModeToLinear(); -- 2.47.1