]> Creatis software - creaImageIO.git/blob - bbtk_Transform3Ddicom_PKG/src/bbTransform3DdicomMetaImageWriter_DicomInfo.cxx
#3326 bbtk_Transform3Ddicom_PKG
[creaImageIO.git] / bbtk_Transform3Ddicom_PKG / src / bbTransform3DdicomMetaImageWriter_DicomInfo.cxx
1 #include "bbTransform3DdicomMetaImageWriter_DicomInfo.h"
2 #include "bbTransform3DdicomPackage.h"
3 namespace bbTransform3Ddicom
4 {
5
6 BBTK_ADD_BLACK_BOX_TO_PACKAGE(Transform3Ddicom,MetaImageWriter_DicomInfo)
7 BBTK_BLACK_BOX_IMPLEMENTATION(MetaImageWriter_DicomInfo,bbtk::AtomicBlackBox);
8 void MetaImageWriter_DicomInfo::Process()
9 {
10
11         FILE *ff = fopen( bbGetInputFilename().c_str() ,"w+");
12         fprintf(ff, "ImagaPositionPatient %f %f %f", bbGetInputIPP()[0], bbGetInputIPP()[1], bbGetInputIPP()[2]);
13         fprintf(ff, "ImageOrientationPatient %f %f %f %f %f %f", bbGetInputIOP()[0], bbGetInputIOP()[1], bbGetInputIOP()[2], bbGetInputIOP()[3], bbGetInputIOP()[4], bbGetInputIOP()[5]);
14         fprintf(ff, "Spacing %f %f %f", bbGetInputPixelSpacing()[0], bbGetInputPixelSpacing()[1], bbGetInputPixelSpacing()[2]);
15     fclose(ff);  
16 }
17
18 /*
19 void MetaImageWriter_DicomInfo::bbUserConstructor()
20 {
21     bbSetInputFilename("");
22 }
23 void MetaImageWriter_DicomInfo::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
24
25 }
26 void MetaImageWriter_DicomInfo::bbUserDestructor()
27 {  
28 }
29 */
30
31
32
33 //===== 
34 // 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)
35 //===== 
36 void MetaImageWriter_DicomInfo::bbUserSetDefaultValues()
37 {
38     bbSetInputFilename("");
39 }
40
41
42
43
44 //===== 
45 // 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)
46 //===== 
47 void MetaImageWriter_DicomInfo::bbUserInitializeProcessing()
48 {
49
50 //  THE INITIALIZATION METHOD BODY :
51 //    Here does nothing 
52 //    but this is where you should allocate the internal/output pointers 
53 //    if any 
54
55         
56 }
57 //===== 
58 // 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)
59 //===== 
60 void MetaImageWriter_DicomInfo::bbUserFinalizeProcessing()
61 {
62
63 //  THE FINALIZATION METHOD BODY :
64 //    Here does nothing 
65 //    but this is where you should desallocate the internal/output pointers 
66 //    if any
67   
68 }
69
70
71
72
73 }
74 // EO namespace bbTransform3Ddicom
75
76