#include <gdcmDicomDirElement.h>
Inheritance diagram for gdcm::DicomDirElement:
Public Member Functions | |
virtual void | Print (std::ostream &os=std::cout, std::string const &indent="") |
Print all. | |
ListDicomDirMetaElem const & | GetDicomDirMetaElements () const |
returns a reference to the chained List related to the META Elements of a DICOMDIR. | |
ListDicomDirPatientElem const & | GetDicomDirPatientElements () const |
returns a reference to the chained List related to the PATIENT Elements of a DICOMDIR. | |
ListDicomDirStudyElem const & | GetDicomDirStudyElements () const |
returns a reference to the chained List related to the STUDY Elements of a DICOMDIR. | |
ListDicomDirVisitElem const & | GetDicomDirVisitElements () const |
returns a reference to the chained List related to the VISIT Elements of a DICOMDIR. | |
ListDicomDirSerieElem const & | GetDicomDirSerieElements () const |
returns a reference to the chained List related to the SERIE Elements of a DICOMDIR. | |
ListDicomDirImageElem const & | GetDicomDirImageElements () const |
returns a reference to the chained List related to the IMAGE Elements of a DICOMDIR. | |
bool | AddEntry (DicomDirType type, DicomElement const &elem) |
Add an entry to one of the DicomDir Elements (Patient, Study, Serie, Image). | |
void | AddDicomDirElement (DicomDirType type, uint16_t group, uint16_t elem) |
Add an entry to one of the DicomDir Elements (Patient, Study, Serie, Image). | |
void | Delete () |
Delete the object. | |
void | Register () |
Register the object. | |
void | Unregister () |
Unregister the object. | |
const unsigned long & | GetRefCount () const |
Get the reference counting. | |
void | SetPrintLevel (int level) |
Sets the print level for the Dicom Header Elements. | |
int | GetPrintLevel () |
Gets the print level for the Dicom Entries. | |
Static Public Member Functions | |
static DicomDirElement * | New () |
Contructs a DicomDirElement with a RefCounter. | |
Protected Member Functions | |
DicomDirElement () | |
constructor : populates the chained lists from the file 'Dicts/DicomDir.dic' | |
~DicomDirElement () | |
canonical destructor | |
Protected Attributes | |
int | PrintLevel |
Amount of printed details for each Dicom Entries : 0 : stands for the least detail level. | |
Private Member Functions | |
gdcmTypeMacro (DicomDirElement) | |
Private Attributes | |
ListDicomDirMetaElem | DicomDirMetaList |
Elements chained list, related to the MetaElements of DICOMDIR. | |
ListDicomDirPatientElem | DicomDirPatientList |
Elements chained list, related to the PatientElements of DICOMDIR. | |
ListDicomDirStudyElem | DicomDirStudyList |
Elements chained list, related to the StudyElements of DICOMDIR. | |
ListDicomDirVisitElem | DicomDirVisitList |
Elements chained list, related to the VisitElements of DICOMDIR. | |
ListDicomDirSerieElem | DicomDirSerieList |
Elements chained list, related to the SerieElements of DICOMDIR. | |
ListDicomDirImageElem | DicomDirImageList |
Elements chained list, related to the ImageElements of DICOMDIR. |
Definition at line 68 of file gdcmDicomDirElement.h.
|
constructor : populates the chained lists from the file 'Dicts/DicomDir.dic'
Definition at line 40 of file gdcmDicomDirElement.cxx. References AddEntry(), gdcm::DictSet::BuildDictPath(), gdcm::DD_IMAGE, gdcm::DD_META, gdcm::DD_PATIENT, gdcm::DD_SERIE, gdcm::DD_STUDY, gdcm::DD_UNKNOWN, DICT_ELEM, gdcm::DicomElement::Elem, gdcm::FillDefaultDIRDict(), gdcmWarningMacro, gdcm::DicomElement::Group, and gdcm::DicomElement::Value. 00041 { 00042 std::string filename = DictSet::BuildDictPath() + DICT_ELEM; 00043 std::ifstream from(filename.c_str()); 00044 if ( !from ) 00045 { 00046 gdcmWarningMacro( "Can't open DicomDirElement dictionary" 00047 << filename.c_str()); 00048 FillDefaultDIRDict( this ); 00049 } 00050 else 00051 { 00052 char buff[1024]; 00053 std::string strType; 00054 DicomElement elem; 00055 DicomDirType type; 00056 00057 while (!from.eof()) 00058 { 00059 from >> std::ws; 00060 from.getline(buff, 1024, ' '); 00061 strType = buff; 00062 00063 if ( strType == "imageElem" ) 00064 type = DD_IMAGE; 00065 else if ( strType == "serieElem" ) 00066 type = DD_SERIE; 00067 else if ( strType == "studyElem" ) 00068 type = DD_STUDY; 00069 else if ( strType == "patientElem" ) 00070 type = DD_PATIENT; 00071 else if ( strType == "metaElem" ) 00072 type = DD_META; 00073 else 00074 { 00075 gdcmWarningMacro("Unknown type (" << strType 00076 << ") found in the file : " 00077 << filename.c_str()); 00078 type = DD_UNKNOWN; 00079 } 00080 00081 if ( type!=DD_UNKNOWN ) 00082 { 00083 from >> std::hex >> elem.Group >> elem.Elem; 00084 00085 from >> std::ws; 00086 from.getline(buff, 1024, '"'); 00087 from >> std::ws; 00088 from.getline(buff, 1024, '"'); 00089 elem.Value = buff; 00090 00091 AddEntry(type, elem); 00092 } 00093 from.getline(buff, 1024, '\n'); 00094 } 00095 from.close(); 00096 } 00097 }
|
|
canonical destructor
Definition at line 102 of file gdcmDicomDirElement.cxx. References DicomDirImageList, DicomDirMetaList, DicomDirPatientList, DicomDirSerieList, and DicomDirStudyList. 00103 { 00104 DicomDirMetaList.clear(); 00105 DicomDirPatientList.clear(); 00106 DicomDirStudyList.clear(); 00107 DicomDirSerieList.clear(); 00108 DicomDirImageList.clear(); 00109 }
|
|
Add an entry to one of the DicomDir Elements (Patient, Study, Serie, Image).
Definition at line 151 of file gdcmDicomDirElement.cxx. References AddEntry(), gdcm::DicomElement::Elem, gdcm::DicomElement::Group, and gdcm::DicomElement::Value. 00153 { 00154 DicomElement el; 00155 el.Group = group; 00156 el.Elem = elem; 00157 el.Value = ""; 00158 AddEntry(type, el); 00159 }
|
|
Add an entry to one of the DicomDir Elements (Patient, Study, Serie, Image).
Definition at line 119 of file gdcmDicomDirElement.cxx. References gdcm::DD_IMAGE, gdcm::DD_META, gdcm::DD_PATIENT, gdcm::DD_SERIE, gdcm::DD_STUDY, DicomDirImageList, DicomDirMetaList, DicomDirPatientList, DicomDirSerieList, and DicomDirStudyList. Referenced by AddDicomDirElement(), and DicomDirElement(). 00120 { 00121 switch( type ) 00122 { 00123 case DD_IMAGE : 00124 DicomDirImageList.push_back(elem); 00125 break; 00126 case DD_SERIE : 00127 DicomDirSerieList.push_back(elem); 00128 break; 00129 case DD_STUDY : 00130 DicomDirStudyList.push_back(elem); 00131 break; 00132 case DD_PATIENT : 00133 DicomDirPatientList.push_back(elem); 00134 break; 00135 case DD_META : 00136 DicomDirMetaList.push_back(elem); 00137 break; 00138 default : 00139 return false; 00140 } 00141 return true; 00142 }
|
|
|
|
|
returns a reference to the chained List related to the IMAGE Elements of a DICOMDIR.
Definition at line 120 of file gdcmDicomDirElement.h. Referenced by gdcm::DicomDirImage::DicomDirImage(), and gdcm::DicomDir::SetElement(). 00121 { return DicomDirImageList; }
|
|
returns a reference to the chained List related to the META Elements of a DICOMDIR.
Definition at line 86 of file gdcmDicomDirElement.h. Referenced by gdcm::DicomDirMeta::DicomDirMeta(), and gdcm::DicomDir::SetElement(). 00087 { return DicomDirMetaList; }
|
|
returns a reference to the chained List related to the PATIENT Elements of a DICOMDIR.
Definition at line 93 of file gdcmDicomDirElement.h. Referenced by gdcm::DicomDirPatient::DicomDirPatient(), and gdcm::DicomDir::SetElement(). 00094 { return DicomDirPatientList; }
|
|
returns a reference to the chained List related to the SERIE Elements of a DICOMDIR.
Definition at line 113 of file gdcmDicomDirElement.h. Referenced by gdcm::DicomDirSerie::DicomDirSerie(), and gdcm::DicomDir::SetElement(). 00114 { return DicomDirSerieList; }
|
|
returns a reference to the chained List related to the STUDY Elements of a DICOMDIR.
Definition at line 100 of file gdcmDicomDirElement.h. Referenced by gdcm::DicomDirStudy::DicomDirStudy(), and gdcm::DicomDir::SetElement(). 00101 { return DicomDirStudyList; }
|
|
returns a reference to the chained List related to the VISIT Elements of a DICOMDIR.
Definition at line 107 of file gdcmDicomDirElement.h. Referenced by gdcm::DicomDirVisit::DicomDirVisit(). 00108 { return DicomDirVisitList; }
|
|
Gets the print level for the Dicom Entries.
Definition at line 50 of file gdcmBase.h. 00050 { return PrintLevel; }
|
|
Get the reference counting.
Definition at line 56 of file gdcmRefCounter.h. 00057 { 00058 return RefCount; 00059 }
|
|
Contructs a DicomDirElement with a RefCounter.
Definition at line 74 of file gdcmDicomDirElement.h. Referenced by gdcm::Global::Global(). 00074 {return new DicomDirElement();}
|
|
Print all.
Reimplemented from gdcm::Base. Definition at line 173 of file gdcmDicomDirElement.cxx. References DicomDirImageList, DicomDirMetaList, DicomDirPatientList, DicomDirSerieList, DicomDirStudyList, gdcm::TagKey::str(), and gdcm::DictEntry::TranslateToKey(). 00174 { 00175 std::ostringstream s; 00176 std::list<DicomElement>::iterator it; 00177 //char greltag[10]; //group element tag 00178 TagKey greltag; 00179 00180 s << "Meta Elements :"<<std::endl; 00181 for (it = DicomDirMetaList.begin(); it != DicomDirMetaList.end(); ++it) 00182 { 00183 greltag = DictEntry::TranslateToKey(it->Group,it->Elem); 00184 s << " (" << greltag << ") = " << it->Value << std::endl; 00185 } 00186 00187 s << "Patient Elements :"<<std::endl; 00188 for (it = DicomDirPatientList.begin(); it != DicomDirPatientList.end(); ++it) 00189 { 00190 greltag = DictEntry::TranslateToKey(it->Group,it->Elem); 00191 s << " (" << greltag << ") = " << it->Value << std::endl; 00192 } 00193 00194 s << "Study Elements :"<<std::endl; 00195 for (it = DicomDirStudyList.begin(); it != DicomDirStudyList.end(); ++it) 00196 { 00197 greltag = DictEntry::TranslateToKey(it->Group, it->Elem); 00198 s << " (" << greltag << ") = " << it->Value << std::endl; 00199 } 00200 00201 s << "Serie Elements :"<<std::endl; 00202 for (it = DicomDirSerieList.begin(); it != DicomDirSerieList.end(); ++it) 00203 { 00204 greltag = DictEntry::TranslateToKey( it->Group, it->Elem); 00205 s << " (" << greltag << ") = " << it->Value << std::endl; 00206 } 00207 00208 s << "Image Elements :"<<std::endl; 00209 for (it = DicomDirImageList.begin(); it != DicomDirImageList.end(); ++it) 00210 { 00211 greltag = DictEntry::TranslateToKey(it->Group, it->Elem); 00212 s << " (" << greltag << ") = " << it->Value << std::endl; 00213 } 00214 00215 os << s.str(); 00216 }
|
|
Register the object.
Definition at line 44 of file gdcmRefCounter.h. Referenced by gdcm::SQItem::AddEntry(), gdcm::ElementSet::AddEntry(), gdcm::Dict::AddEntry(), gdcm::SeqEntry::AddSQItem(), gdcm::SeqEntry::Copy(), gdcm::DicomDir::Copy(), gdcm::DocEntry::DocEntry(), gdcm::FileHelper::FileHelper(), gdcm::DocEntrySet::GetDictEntry(), gdcm::CommandManager::InSetCommand(), gdcm::DocEntryArchive::Push(), gdcm::Dict::ReplaceEntry(), and gdcm::SeqEntry::SetDelimitationItem(). 00044 { RefCount++; }
|
|
Sets the print level for the Dicom Header Elements.
Definition at line 47 of file gdcmBase.h. Referenced by gdcm::SQItem::Print(), gdcm::SeqEntry::Print(), gdcm::FileHelper::Print(), gdcm::ElementSet::Print(), and gdcm::DicomDir::Print(). 00047 { PrintLevel = level; }
|
|
Unregister the object.
Definition at line 48 of file gdcmRefCounter.h. Referenced by gdcm::SeqEntry::ClearSQItem(), gdcm::DicomDir::Copy(), gdcm::DocEntrySet::GetDictEntry(), gdcm::CommandManager::InSetCommand(), gdcm::DocEntrySet::NewDataEntry(), gdcm::DocEntrySet::NewSeqEntry(), gdcm::Document::ReadNextDocEntry(), gdcm::SQItem::RemoveEntry(), gdcm::ElementSet::RemoveEntry(), gdcm::SeqEntry::SetDelimitationItem(), gdcm::DocEntry::~DocEntry(), and gdcm::FileHelper::~FileHelper().
|
|
Elements chained list, related to the ImageElements of DICOMDIR.
Definition at line 146 of file gdcmDicomDirElement.h. Referenced by AddEntry(), Print(), and ~DicomDirElement(). |
|
Elements chained list, related to the MetaElements of DICOMDIR.
Definition at line 136 of file gdcmDicomDirElement.h. Referenced by AddEntry(), Print(), and ~DicomDirElement(). |
|
Elements chained list, related to the PatientElements of DICOMDIR.
Definition at line 138 of file gdcmDicomDirElement.h. Referenced by AddEntry(), Print(), and ~DicomDirElement(). |
|
Elements chained list, related to the SerieElements of DICOMDIR.
Definition at line 144 of file gdcmDicomDirElement.h. Referenced by AddEntry(), Print(), and ~DicomDirElement(). |
|
Elements chained list, related to the StudyElements of DICOMDIR.
Definition at line 140 of file gdcmDicomDirElement.h. Referenced by AddEntry(), Print(), and ~DicomDirElement(). |
|
Elements chained list, related to the VisitElements of DICOMDIR.
Definition at line 142 of file gdcmDicomDirElement.h. |
|
Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.
Definition at line 55 of file gdcmBase.h. Referenced by gdcm::SQItem::Print(), gdcm::SeqEntry::Print(), gdcm::FileHelper::Print(), gdcm::ElementSet::Print(), gdcm::DocEntry::Print(), gdcm::DictEntry::Print(), gdcm::DicomDirStudy::Print(), gdcm::DicomDirSerie::Print(), gdcm::DicomDirPatient::Print(), gdcm::DicomDirMeta::Print(), gdcm::DicomDir::Print(), and gdcm::DataEntry::Print(). |