#include "bbcreaMaracasVisuSliceImage.h" #include "bbcreaMaracasVisuPackage.h" namespace bbcreaMaracasVisu { BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,SliceImage) BBTK_BLACK_BOX_IMPLEMENTATION(SliceImage,bbtk::AtomicBlackBox); void SliceImage::Process() { vtkImageData *imagedata=NULL; if ( bbGetInputIn()!=NULL ){ imageReslice->SetInput( imagedata ); imageReslice->SetInformationInput(imagedata); imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1); imageReslice->SetResliceAxesOrigin(0,0, bbGetInputZ() ); imageReslice->SetOutputDimensionality(2); imageReslice->SetInterpolationModeToLinear(); vtkImageData *imagedata = imageReslice->GetOutput(); imagedata->Update(); imagedata->UpdateInformation(); } bbSetOutputOut( imagedata ); } //----------------------------------------------------------------- void SliceImage::bbUserSetDefaultValues() { bbSetInputIn(NULL); bbSetInputZ(0); imageReslice=NULL; } //----------------------------------------------------------------- void SliceImage::bbUserInitializeProcessing() { imageReslice = vtkImageReslice::New(); } //----------------------------------------------------------------- void SliceImage::bbUserFinalizeProcessing() { } //----------------------------------------------------------------- } // EO namespace bbcreaMaracasVisu