]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuSliceImage.cxx
.
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuSliceImage.cxx
1 #include "bbcreaMaracasVisuSliceImage.h"
2 #include "bbcreaMaracasVisuPackage.h"
3 namespace bbcreaMaracasVisu
4 {
5
6         
7         
8 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,SliceImage)
9 BBTK_BLACK_BOX_IMPLEMENTATION(SliceImage,bbtk::AtomicBlackBox);
10 void SliceImage::Process()
11 {
12         vtkImageData *imagedata=NULL;
13         if ( bbGetInputIn()!=NULL ){
14           imageReslice->SetInput( imagedata );
15           imageReslice->SetInformationInput(imagedata);
16           imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
17           imageReslice->SetResliceAxesOrigin(0,0, bbGetInputZ() );
18           imageReslice->SetOutputDimensionality(2);
19           imageReslice->SetInterpolationModeToLinear();
20           vtkImageData *imagedata = imageReslice->GetOutput();
21           imagedata->Update();
22           imagedata->UpdateInformation();       
23   }
24   bbSetOutputOut( imagedata );
25 }
26         
27         
28         //-----------------------------------------------------------------     
29         void SliceImage::bbUserSetDefaultValues()
30         {
31                 bbSetInputIn(NULL);
32                 bbSetInputZ(0);
33                 imageReslice=NULL;
34         }
35         
36         //-----------------------------------------------------------------     
37         void SliceImage::bbUserInitializeProcessing()
38         {
39                 imageReslice = vtkImageReslice::New();
40         }
41         
42         //-----------------------------------------------------------------     
43         void SliceImage::bbUserFinalizeProcessing()
44         {
45         }
46         
47         //-----------------------------------------------------------------     
48         
49         
50 }
51 // EO namespace bbcreaMaracasVisu
52
53