]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuSliceImage.cxx
037eadf9a452dad307a09735275f7da6ccba2221
[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         printf("EED 0 SliceImage::Process \n");
13         vtkImageData *imagedata=NULL;
14         if ( bbGetInputIn()!=NULL ){
15           imageReslice->SetInput( bbGetInputIn() );
16           imageReslice->SetInformationInput(bbGetInputIn() );
17           imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
18           imageReslice->SetResliceAxesOrigin(0,0, bbGetInputZ() );
19           imageReslice->SetOutputDimensionality(2);
20           imageReslice->SetInterpolationModeToLinear();
21            imagedata = imageReslice->GetOutput();
22           imagedata->Update();
23           imagedata->UpdateInformation();       
24           printf("EED 1 SliceImage::Process %p\n", imagedata);
25   }
26   bbSetOutputOut( imagedata );
27 }
28         
29         
30         //-----------------------------------------------------------------     
31         void SliceImage::bbUserSetDefaultValues()
32         {
33                 bbSetInputIn(NULL);
34                 bbSetInputZ(0);
35                 imageReslice=NULL;
36         }
37         
38         //-----------------------------------------------------------------     
39         void SliceImage::bbUserInitializeProcessing()
40         {
41                 imageReslice = vtkImageReslice::New();
42         }
43         
44         //-----------------------------------------------------------------     
45         void SliceImage::bbUserFinalizeProcessing()
46         {
47         }
48         
49         //-----------------------------------------------------------------     
50         
51         
52 }
53 // EO namespace bbcreaMaracasVisu
54
55