2 // 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)
4 #include "bbTransform3DdicomCreateAxesTreeData.h"
5 #include "bbTransform3DdicomPackage.h"
8 namespace bbTransform3Ddicom
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(Transform3Ddicom,CreateAxesTreeData)
12 BBTK_BLACK_BOX_IMPLEMENTATION(CreateAxesTreeData,bbtk::AtomicBlackBox);
14 // 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)
16 void CreateAxesTreeData::Process()
19 // THE MAIN PROCESSING METHOD BODY
20 // Here we simply set the input 'In' value to the output 'Out'
21 // And print out the output value
22 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
23 // void bbSet{Input|Output}NAME(const TYPE&)
24 // const TYPE& bbGet{Input|Output}NAME() const
26 // * NAME is the name of the input/output
27 // (the one provided in the attribute 'name' of the tag 'input')
28 // * TYPE is the C++ type of the input/output
29 // (the one provided in the attribute 'type' of the tag 'input')
31 // bbSetOutputOut( bbGetInputIn() );
32 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
34 std::vector<double> LstX;
35 std::vector<double> LstY;
36 std::vector<double> LstZ;
37 std::vector<int> LstIndex;
38 std::vector<double> LstColor;
39 if ((bbGetInputIPP().size()==3) && (bbGetInputIOP().size()==6) )
42 LstX.push_back( bbGetInputIPP()[0] );
43 LstY.push_back( bbGetInputIPP()[1] );
44 LstZ.push_back( bbGetInputIPP()[2] );
45 LstX.push_back( bbGetInputIPP()[0]+20 );
46 LstY.push_back( bbGetInputIPP()[1] );
47 LstZ.push_back( bbGetInputIPP()[2] );
48 LstIndex.push_back(2);
49 LstColor.push_back(1);
50 LstColor.push_back(0);
51 LstColor.push_back(0);
53 LstX.push_back( bbGetInputIPP()[0] );
54 LstY.push_back( bbGetInputIPP()[1] );
55 LstZ.push_back( bbGetInputIPP()[2] );
56 LstX.push_back( bbGetInputIPP()[0] );
57 LstY.push_back( bbGetInputIPP()[1]+20 );
58 LstZ.push_back( bbGetInputIPP()[2] );
59 LstIndex.push_back(2);
60 LstColor.push_back(1);
61 LstColor.push_back(1);
62 LstColor.push_back(0);
64 LstX.push_back( bbGetInputIPP()[0] );
65 LstY.push_back( bbGetInputIPP()[1] );
66 LstZ.push_back( bbGetInputIPP()[2] );
67 LstX.push_back( bbGetInputIPP()[0] );
68 LstY.push_back( bbGetInputIPP()[1] );
69 LstZ.push_back( bbGetInputIPP()[2]+20 );
70 LstIndex.push_back(2);
71 LstColor.push_back(1);
72 LstColor.push_back(0);
73 LstColor.push_back(1);
75 LstX.push_back( bbGetInputIPP()[0] );
76 LstY.push_back( bbGetInputIPP()[1] );
77 LstZ.push_back( bbGetInputIPP()[2] );
78 double sizeX = (bbGetInputImageSize()[0]-1)*bbGetInputImageSpacing()[0];
79 LstX.push_back( bbGetInputIPP()[0] + bbGetInputIOP()[0]*sizeX);
80 LstY.push_back( bbGetInputIPP()[1] + bbGetInputIOP()[1]*sizeX);
81 LstZ.push_back( bbGetInputIPP()[2] + bbGetInputIOP()[2]*sizeX);
82 LstIndex.push_back(2);
83 LstColor.push_back(1);
84 LstColor.push_back(1);
85 LstColor.push_back(1);
87 LstX.push_back( bbGetInputIPP()[0] );
88 LstY.push_back( bbGetInputIPP()[1] );
89 LstZ.push_back( bbGetInputIPP()[2] );
90 double sizeY = (bbGetInputImageSize()[1]-1)*bbGetInputImageSpacing()[1];
91 LstX.push_back( bbGetInputIPP()[0] + bbGetInputIOP()[3]*sizeY);
92 LstY.push_back( bbGetInputIPP()[1] + bbGetInputIOP()[4]*sizeY);
93 LstZ.push_back( bbGetInputIPP()[2] + bbGetInputIOP()[5]*sizeY);
94 LstIndex.push_back(2);
95 LstColor.push_back(0.7);
96 LstColor.push_back(0.7);
97 LstColor.push_back(0.7);
99 bbSetOutputLstX( LstX );
100 bbSetOutputLstY( LstY );
101 bbSetOutputLstZ( LstZ );
102 bbSetOutputLstIndex( LstIndex );
103 bbSetOutputLstColor( LstColor );
107 // 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)
109 void CreateAxesTreeData::bbUserSetDefaultValues()
111 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
112 // Here we initialize the input 'In' to 0
117 // 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)
119 void CreateAxesTreeData::bbUserInitializeProcessing()
121 // THE INITIALIZATION METHOD BODY :
123 // but this is where you should allocate the internal/output pointers
128 // 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)
130 void CreateAxesTreeData::bbUserFinalizeProcessing()
132 // THE FINALIZATION METHOD BODY :
134 // but this is where you should desallocate the internal/output pointers
138 } // EO namespace bbTransform3Ddicom