From 40ec2ad8bdf9c5de81c5f8fc4a162c6dc0fef948 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 6 Jun 2013 08:06:56 +0200 Subject: [PATCH] 2027 FeatureImageSlice Create differents Orientations --- bbtk/src/bbcreaMaracasVisuSliceImage.cxx | 23 ++++++++++++++++++----- bbtk/src/bbcreaMaracasVisuSliceImage.h | 2 ++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/bbtk/src/bbcreaMaracasVisuSliceImage.cxx b/bbtk/src/bbcreaMaracasVisuSliceImage.cxx index 06b3df6..f55ea47 100644 --- a/bbtk/src/bbcreaMaracasVisuSliceImage.cxx +++ b/bbtk/src/bbcreaMaracasVisuSliceImage.cxx @@ -38,19 +38,31 @@ void SliceImage::Process() vtkImageData *imagedata=NULL; //std::cout<<"MSJ: test SliceImage::Process()"<SetInput( bbGetInputIn() ); imageReslice->SetInformationInput(bbGetInputIn() ); - imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1); + + if (bbGetInputTypeOrientation()==2) + { + imageReslice->SetResliceAxesDirectionCosines(0,0,1, 1,0,0 ,0,1,0); // 2=YZ + } else if (bbGetInputTypeOrientation()==1) { + imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,0,-1 ,0,1,0); // 1=XZ + } else + { + imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1); // 0=XY + } + + + imageReslice->SetResliceAxesOrigin(0,0, bbGetInputZ()*bbGetInputIn()->GetSpacing()[2] ); imageReslice->SetOutputDimensionality(2); imageReslice->SetInterpolationModeToLinear(); - imagedata = imageReslice->GetOutput(); + imagedata = imageReslice->GetOutput(); imagedata->Update(); imagedata->UpdateInformation(); //printf("EED 1 SliceImage::Process %p\n", imagedata); - } + } bbSetOutputOut( imagedata ); } @@ -60,6 +72,7 @@ void SliceImage::Process() { bbSetInputIn(NULL); bbSetInputZ(0); + bbSetInputTypeOrientation(0); imageReslice=NULL; } diff --git a/bbtk/src/bbcreaMaracasVisuSliceImage.h b/bbtk/src/bbcreaMaracasVisuSliceImage.h index ac1cd50..b02f2ea 100644 --- a/bbtk/src/bbcreaMaracasVisuSliceImage.h +++ b/bbtk/src/bbcreaMaracasVisuSliceImage.h @@ -42,6 +42,7 @@ class bbcreaMaracasVisu_EXPORT SliceImage BBTK_BLACK_BOX_INTERFACE(SliceImage,bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,vtkImageData*); BBTK_DECLARE_INPUT(Z, double ); + BBTK_DECLARE_INPUT(TypeOrientation, int ); BBTK_DECLARE_OUTPUT(Out,vtkImageData*); BBTK_PROCESS(Process); void Process(); @@ -57,6 +58,7 @@ BBTK_DESCRIPTION("filter"); BBTK_CATEGORY(""); BBTK_INPUT(SliceImage,In,"Input image",vtkImageData *,""); BBTK_INPUT(SliceImage,Z,"Z",double,""); +BBTK_INPUT(SliceImage,TypeOrientation,"Type orientation (default 0) 0=XY 1=XZ 2=YZ",int,""); BBTK_OUTPUT(SliceImage,Out,"Output image",vtkImageData *,""); BBTK_END_DESCRIBE_BLACK_BOX(SliceImage); } -- 2.47.1