]> Creatis software - creaImageIO.git/blob - bbtk/src/bbcreaImageIOGetDicomAttributesFromMaps.cxx
#3188 creaImageIO Bug New Normal - DICOM tags
[creaImageIO.git] / bbtk / src / bbcreaImageIOGetDicomAttributesFromMaps.cxx
1 //===== 
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)
3 //===== 
4 #include "bbcreaImageIOGetDicomAttributesFromMaps.h"
5 #include "bbcreaImageIOPackage.h"
6 namespace bbcreaImageIO
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaImageIO,GetDicomAttributesFromMaps)
10 BBTK_BLACK_BOX_IMPLEMENTATION(GetDicomAttributesFromMaps,bbtk::AtomicBlackBox);
11 //===== 
12 // 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)
13 //===== 
14 void GetDicomAttributesFromMaps::Process()
15 {
16 // THE MAIN PROCESSING METHOD BODY
17 //   Here we simply set the input 'In' value to the output 'Out'
18 //   And print out the output value
19 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
20 //    void bbSet{Input|Output}NAME(const TYPE&)
21 //    const TYPE& bbGet{Input|Output}NAME() const 
22 //    Where :
23 //    * NAME is the name of the input/output
24 //      (the one provided in the attribute 'name' of the tag 'input')
25 //    * TYPE is the C++ type of the input/output
26 //      (the one provided in the attribute 'type' of the tag 'input')
27
28     std::vector< std::string > lstResult;
29     std::map <std::string,std::string> tmpMap;
30     int i,size=bbGetInputIn().size();
31
32 // The MAP.find() function   is not working in all the cases
33
34     for (i=0;i<size;i++)
35     { 
36                 tmpMap = bbGetInputIn()[i];
37                 std::map<std::string, std::string>::iterator it;
38                 for ( it = tmpMap.begin(); it != tmpMap.end(); it++ )
39                 {
40                         if (it->first==bbGetInputKeyDicom())
41                         {
42                                 lstResult.push_back( it->second );
43                         } // if it->first
44                 }//for it
45     } // for i
46     bbSetOutputOut( lstResult );
47 }
48 //===== 
49 // 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)
50 //===== 
51 void GetDicomAttributesFromMaps::bbUserSetDefaultValues()
52 {
53
54 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
55 //    Here we initialize the input 'In' to 0
56 //   bbSetInputIn(0);
57   
58 }
59 //===== 
60 // 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)
61 //===== 
62 void GetDicomAttributesFromMaps::bbUserInitializeProcessing()
63 {
64
65 //  THE INITIALIZATION METHOD BODY :
66 //    Here does nothing 
67 //    but this is where you should allocate the internal/output pointers 
68 //    if any 
69
70   
71 }
72 //===== 
73 // 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)
74 //===== 
75 void GetDicomAttributesFromMaps::bbUserFinalizeProcessing()
76 {
77
78 //  THE FINALIZATION METHOD BODY :
79 //    Here does nothing 
80 //    but this is where you should desallocate the internal/output pointers 
81 //    if any
82   
83 }
84 }
85 // EO namespace bbcreaImageIO
86
87