]> Creatis software - creaImageIO.git/blob - bbtk_Transform3Ddicom_PKG/src/bbTransform3DdicomTransformSimple.cxx
#3326 bbtk_Transform3Ddicom_PKG
[creaImageIO.git] / bbtk_Transform3Ddicom_PKG / src / bbTransform3DdicomTransformSimple.cxx
1 #include "bbTransform3DdicomTransformSimple.h"
2 #include "bbTransform3DdicomPackage.h"
3
4
5
6 namespace bbTransform3Ddicom
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(Transform3Ddicom,TransformSimple)
10 BBTK_BLACK_BOX_IMPLEMENTATION(TransformSimple,bbtk::AtomicBlackBox);
11 void TransformSimple::Process()
12 {
13         vtkImageData *resultImage = NULL;
14         vtkTransform *transform = NULL;
15         if ( bbGetInputInImage()!=NULL )
16         {
17                 creaimage->SetvtkImageData( bbGetInputInImage() );
18                 creaimage->SetImagePositionPatient( bbGetInputIPP()[0] , bbGetInputIPP()[1] , bbGetInputIPP()[2] );
19                 creaimage->SetImageSpacing( bbGetInputPixelSpacing()[0] , bbGetInputPixelSpacing()[1] , bbGetInputPixelSpacing()[2]  );
20                 creaimage->SetImageOrientation(  bbGetInputIOP()[0] , bbGetInputIOP()[1] , bbGetInputIOP()[2] , 
21                                                                                 bbGetInputIOP()[3] , bbGetInputIOP()[4] , bbGetInputIOP()[5]  );
22                 creaimage->Update();
23                 transform = creaimage->GetvtkTransform(  );
24                 resultImage = creaimage->GetImage() ; 
25         }
26         bbSetOutputOut( transform ); 
27         bbSetOutputOutImage( resultImage ); 
28 }
29
30 /*
31 void TransformSimple::bbUserConstructor()
32 {  
33         creaimage = new CreaImage();
34         bbSetInputInImage(NULL);
35 }
36
37 void TransformSimple::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
38 {  
39 }
40
41 void TransformSimple::bbUserDestructor()
42 {
43 //      transform->Delete();
44 }
45 */
46
47
48
49 //===== 
50 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
51 //===== 
52 void TransformSimple::bbUserSetDefaultValues()
53 {
54         creaimage = new CreaImage();
55         bbSetInputInImage(NULL); 
56 }
57
58
59
60 //===== 
61 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
62 //===== 
63 void TransformSimple::bbUserInitializeProcessing()
64 {
65
66 //  THE INITIALIZATION METHOD BODY :
67 //    Here does nothing 
68 //    but this is where you should allocate the internal/output pointers 
69 //    if any 
70
71 }
72
73 //===== 
74 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
75 //===== 
76 void TransformSimple::bbUserFinalizeProcessing()
77 {
78
79 //  THE FINALIZATION METHOD BODY :
80 //    Here does nothing 
81 //    but this is where you should desallocate the internal/output pointers 
82 //    if any
83
84 }
85
86
87 }
88 // EO namespace bbTransform3Ddicom
89
90