From: Eduardo Davila Date: Fri, 3 Apr 2009 17:39:38 +0000 (+0000) Subject: Transform dicom X-Git-Tag: EED.02Oct2009~111 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=4db61566d2cc017bccbbca36f713aa24faecc9f6;p=creaMaracasVisu.git Transform dicom --- diff --git a/bbtk/src/bbcreaMaracasVisuSliceImage.cxx b/bbtk/src/bbcreaMaracasVisuSliceImage.cxx new file mode 100644 index 0000000..363252e --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuSliceImage.cxx @@ -0,0 +1,47 @@ +#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::bbUserConstructor() +{ + bbSetInputIn(NULL); + bbSetInputZ(0); + imageReslice = vtkImageReslice::New(); +} + +void SliceImage::bbUserCopyConstructor(bbtk::BlackBox::Pointer) +{ +} + +void SliceImage::bbUserDestructor() +{ +} + +} +// EO namespace bbcreaMaracasVisu + + diff --git a/bbtk/src/bbcreaMaracasVisuSliceImage.h b/bbtk/src/bbcreaMaracasVisuSliceImage.h new file mode 100644 index 0000000..0b30b20 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuSliceImage.h @@ -0,0 +1,49 @@ +#ifndef __bbcreaMaracasVisuSliceImage_h_INCLUDED__ +#define __bbcreaMaracasVisuSliceImage_h_INCLUDED__ +#include "bbcreaMaracasVisu_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include +#include + +namespace bbcreaMaracasVisu +{ + +class bbcreaMaracasVisu_EXPORT SliceImage + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(SliceImage,bbtk::AtomicBlackBox); +//================================================================== +/// User callback called in the box contructor +virtual void bbUserConstructor(); +/// User callback called in the box copy constructor +virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer); +/// User callback called in the box destructor +virtual void bbUserDestructor(); +//================================================================== + BBTK_DECLARE_INPUT(In,vtkImageData*); + BBTK_DECLARE_INPUT(Z, double ); + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_PROCESS(Process); + void Process(); + + vtkImageReslice *imageReslice; + +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(SliceImage,bbtk::AtomicBlackBox); +BBTK_NAME("SliceImage"); +BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr"); +BBTK_DESCRIPTION("filter"); +BBTK_CATEGORY(""); +BBTK_INPUT(SliceImage,In,"Input image",vtkImageData *,""); +BBTK_INPUT(SliceImage,Z,"Z",double,""); +BBTK_OUTPUT(SliceImage,Out,"Output image",vtkImageData *,""); +BBTK_END_DESCRIBE_BLACK_BOX(SliceImage); +} +// EO namespace bbcreaMaracasVisu + +#endif // __bbcreaMaracasVisuSliceImage_h_INCLUDED__ +