#include <gdcmDicomDirElement.h>
Public Member Functions | |
| gdcmDicomDirElement (void) | |
| constructor | |
| ~gdcmDicomDirElement (void) | |
| destructor | |
| void | Print (std::ostream &os) |
| Print all. | |
| ListMetaElem & | GetMetaElements (void) |
| ListPatientElem & | GetPatientElements (void) |
| ListStudyElem & | GetStudyElements (void) |
| ListSerieElem & | GetSerieElements (void) |
| ListImageElem & | GetImageElements (void) |
Private Attributes | |
| ListMetaElem | MetaList |
| ListPatientElem | PatientList |
| ListStudyElem | StudyList |
| ListSerieElem | SerieList |
| ListImageElem | ImageList |
|
|
constructor
Definition at line 29 of file gdcmDicomDirElement.cxx. References gdcmDictSet::BuildDictPath(), dbg, DICT_ELEM, eatwhite(), gdcmElement::elem, gdcmDebug::Error(), gdcmElement::group, ImageList, MetaList, PatientList, SerieList, StudyList, and gdcmElement::value.
00030 {
00031 std::string filename=gdcmDictSet::BuildDictPath() + std::string(DICT_ELEM);
00032 std::ifstream from(filename.c_str());
00033 dbg.Error(!from, "gdcmDicomDirElement::gdcmDicomDirElement: can't open dictionary",filename.c_str());
00034
00035 char buff[1024];
00036 std::string type;
00037 gdcmElement elem;
00038
00039 while (!from.eof()) {
00040 eatwhite(from);
00041 from.getline(buff, 1024, ' ');
00042 type = buff;
00043
00044 if( (type=="metaElem") || (type=="patientElem") ||
00045 (type=="studyElem") || (type=="serieElem") ||
00046 (type=="imageElem") )
00047 {
00048 from >> std::hex >> elem.group >> elem.elem;
00049
00050 eatwhite(from);
00051 from.getline(buff, 1024, '"');
00052 eatwhite(from);
00053 from.getline(buff, 1024, '"');
00054 elem.value = buff;
00055
00056 if(type=="metaElem")
00057 MetaList.push_back(elem);
00058 else if(type=="patientElem")
00059 PatientList.push_back(elem);
00060 else if(type=="studyElem")
00061 StudyList.push_back(elem);
00062 else if(type=="serieElem")
00063 SerieList.push_back(elem);
00064 else if(type=="imageElem")
00065 ImageList.push_back(elem);
00066 }
00067
00068 from.getline(buff, 1024, '\n');
00069 }
00070 from.close();
00071 }
|
|
|
destructor
Definition at line 77 of file gdcmDicomDirElement.cxx. References ImageList, MetaList, PatientList, SerieList, and StudyList.
00078 {
00079 MetaList.clear();
00080 PatientList.clear();
00081 StudyList.clear();
00082 SerieList.clear();
00083 ImageList.clear();
00084 }
|
|
|
Definition at line 42 of file gdcmDicomDirElement.h. References ListImageElem. Referenced by gdcmDicomDir::SetElement().
00042 {return(ImageList);};
|
|
|
Definition at line 38 of file gdcmDicomDirElement.h. References ListMetaElem. Referenced by gdcmDicomDir::SetElement().
00038 {return(MetaList);};
|
|
|
Definition at line 39 of file gdcmDicomDirElement.h. References ListPatientElem. Referenced by gdcmDicomDir::SetElement().
00039 {return(PatientList);};
|
|
|
Definition at line 41 of file gdcmDicomDirElement.h. References ListSerieElem. Referenced by gdcmDicomDir::SetElement().
00041 {return(SerieList);};
|
|
|
Definition at line 40 of file gdcmDicomDirElement.h. References ListStudyElem. Referenced by gdcmDicomDir::SetElement().
00040 {return(StudyList);};
|
|
|
Print all.
Definition at line 94 of file gdcmDicomDirElement.cxx. References ImageList, MetaList, PatientList, SerieList, and StudyList.
00095 {
00096 std::ostringstream s;
00097 std::list<gdcmElement>::iterator it;
00098 char greltag[10]; //group element tag
00099
00100 s << "Meta Elements :"<<std::endl;
00101 for (it = MetaList.begin();it!=MetaList.end();++it)
00102 {
00103 sprintf(greltag,"%04x|%04x ",it->group,it->elem);
00104 s << " ("<<greltag<<") = "<< it->value<<std::endl;
00105 }
00106
00107 s << "Patient Elements :"<<std::endl;
00108 for (it = PatientList.begin();it!=PatientList.end();++it)
00109 {
00110 sprintf(greltag,"%04x|%04x ",it->group,it->elem);
00111 s << " ("<<greltag<<") = "<< it->value<<std::endl;
00112 }
00113
00114 s << "Study Elements :"<<std::endl;
00115 for (it = StudyList.begin();it!=StudyList.end();++it)
00116 {
00117 sprintf(greltag,"%04x|%04x ",it->group,it->elem);
00118 s << " ("<<greltag<<") = "<< it->value<<std::endl;
00119 }
00120
00121 s << "Serie Elements :"<<std::endl;
00122 for (it = SerieList.begin();it!=SerieList.end();++it)
00123 {
00124 sprintf(greltag,"%04x|%04x ",it->group,it->elem);
00125 s << " ("<<greltag<<") = "<< it->value<<std::endl;
00126 }
00127
00128 s << "Image Elements :"<<std::endl;
00129 for (it = ImageList.begin();it!=ImageList.end();++it)
00130 {
00131 sprintf(greltag,"%04x|%04x ",it->group,it->elem);
00132 s << " ("<<greltag<<") = "<< it->value<<std::endl;
00133 }
00134
00135 os << s.str();
00136 }
|
|
|
Definition at line 49 of file gdcmDicomDirElement.h. Referenced by gdcmDicomDirElement(), Print(), and ~gdcmDicomDirElement(). |
|
|
Definition at line 45 of file gdcmDicomDirElement.h. Referenced by gdcmDicomDirElement(), Print(), and ~gdcmDicomDirElement(). |
|
|
Definition at line 46 of file gdcmDicomDirElement.h. Referenced by gdcmDicomDirElement(), Print(), and ~gdcmDicomDirElement(). |
|
|
Definition at line 48 of file gdcmDicomDirElement.h. Referenced by gdcmDicomDirElement(), Print(), and ~gdcmDicomDirElement(). |
|
|
Definition at line 47 of file gdcmDicomDirElement.h. Referenced by gdcmDicomDirElement(), Print(), and ~gdcmDicomDirElement(). |
1.3.6