#include <gdcmHeaderEntry.h>
Public Member Functions | |
| gdcmHeaderEntry (gdcmDictEntry *) | |
| Constructor from a given gdcmDictEntry. | |
| guint16 | GetGroup (void) |
| guint16 | GetElement (void) |
| std::string | GetKey (void) |
| std::string | GetName (void) |
| std::string | GetVR (void) |
| std::string | GetValue (void) |
| void * | GetVoidArea (void) |
| size_t | GetOffset (void) |
| guint32 | GetLength (void) |
| void | SetVR (std::string v) |
| void | SetLength (guint32 l) |
| void | SetReadLength (guint32 l) |
| void | SetUsableLength (guint32 l) |
| guint32 | GetReadLength (void) |
| void | SetValue (std::string val) |
| void | SetVoidArea (void *area) |
| void | SetOffset (size_t of) |
| Sets the offset of the Dicom Element. | |
| void | SetImplicitVR (void) |
| Sets to TRUE the ImplicitVr flag of the current Dicom Element. | |
| bool | IsImplicitVR (void) |
| tells us if the current Dicom Element was checked as ImplicitVr | |
| bool | IsVRUnknown (void) |
| tells us if the VR of the current Dicom Element is Unkonwn | |
| void | SetDictEntry (gdcmDictEntry *NewEntry) |
| Sets the DicEntry of the current Dicom Element. | |
| gdcmDictEntry * | GetDictEntry (void) |
| Gets the DicEntry of the current Dicom Element. | |
| void | SetPrintLevel (int level) |
| Sets the print level for the Dicom Header Elements. | |
| void | Print (std::ostream &os=std::cout) |
| canonical Printer | |
Private Attributes | |
| gdcmDictEntry * | entry |
| guint32 | UsableLength |
| guint32 | ReadLength |
| bool | ImplicitVR |
| std::string | value |
| void * | voidArea |
| size_t | Offset |
| int | printLevel |
Friends | |
| class | gdcmHeader |
|
|
Constructor from a given gdcmDictEntry.
Definition at line 26 of file gdcmHeaderEntry.cxx. References entry, ImplicitVR, and voidArea.
00026 {
00027 ImplicitVR = false;
00028 voidArea = NULL; // unsecure memory area to hold 'non string' values
00029 entry = in;
00030 }
|
|
|
Gets the DicEntry of the current Dicom Element.
Definition at line 85 of file gdcmHeaderEntry.h. References entry.
00085 { return entry; };
|
|
|
Definition at line 22 of file gdcmHeaderEntry.h. Referenced by gdcmParser::CheckHeaderEntryVR(), gdcmParser::FindHeaderEntryLength(), gdcmParser::FixHeaderEntryFoundLength(), gdcmParser::IsHeaderEntryAnInteger(), Print(), and gdcmParser::UpdateGroupLength().
00022 { return entry->GetElement();};
|
|
|
|
Definition at line 23 of file gdcmHeaderEntry.h. Referenced by gdcmParser::AddHeaderEntry().
|
|
|
Definition at line 30 of file gdcmHeaderEntry.h. Referenced by gdcmParser::GetHeaderEntryValue(), gdcmHeader::GetPixelAreaLength(), gdcmParser::IsHeaderEntryAnInteger(), gdcmParser::LoadEntryVoidArea(), gdcmParser::LoadHeaderEntry(), Print(), gdcmParser::SkipHeaderEntry(), and gdcmParser::UpdateGroupLength().
00030 { return UsableLength; };
|
|
|
Definition at line 24 of file gdcmHeaderEntry.h. Referenced by gdcmParser::CheckHeaderEntryVR(), and Print().
|
|
|
Definition at line 29 of file gdcmHeaderEntry.h. Referenced by gdcmParser::GetEntryOffsetByNumber(), gdcmHeader::GetPixelOffset(), gdcmParser::LoadEntryVoidArea(), gdcmParser::LoadHeaderEntry(), and Print().
00029 { return Offset; };
|
|
|
Definition at line 38 of file gdcmHeaderEntry.h. Referenced by Print().
00038 { return ReadLength;};
|
|
|
|
Definition at line 28 of file gdcmHeaderEntry.h. Referenced by gdcmParser::GetEntryVoidAreaByNumber().
00028 { return voidArea; };
|
|
|
|
tells us if the current Dicom Element was checked as ImplicitVr
Definition at line 62 of file gdcmHeaderEntry.h. References ImplicitVR. Referenced by gdcmParser::FindHeaderEntryLength(), gdcmParser::GetHeaderEntryUnvalue(), and gdcmParser::GetHeaderEntryValue().
00062 { return ImplicitVR; };
|
|
|
tells us if the VR of the current Dicom Element is Unkonwn
Definition at line 69 of file gdcmHeaderEntry.h. References entry, and gdcmDictEntry::IsVRUnknown(). Referenced by gdcmParser::CheckHeaderEntryVR(), and gdcmParser::FindHeaderEntryVR().
00069 { return entry->IsVRUnknown(); };
|
|
|
canonical Printer
Definition at line 38 of file gdcmHeaderEntry.cxx. References _CreateCleanString(), GetElement(), GetGroup(), GetLength(), GetName(), GetOffset(), GetReadLength(), gdcmGlobal::GetTS(), gdcmTS::GetValue(), GetValue(), GetVR(), MAX_SIZE_PRINT_ELEMENT_VALUE, printLevel, TSKey, and voidArea.
00038 {
00039 size_t o;
00040 unsigned short int g, e;
00041 char st[20];
00042 TSKey v;
00043 std::string d2, vr;
00044 gdcmTS * ts = gdcmGlobal::GetTS();
00045 std::ostringstream s;
00046 guint32 lgth;
00047 char greltag[10]; //group element tag
00048
00049 g = GetGroup();
00050 e = GetElement();
00051 v = GetValue();
00052 o = GetOffset();
00053 vr = GetVR();
00054 sprintf(greltag,"%04x|%04x ",g,e);
00055 s << greltag ;
00056
00057 d2 = _CreateCleanString(v); // replace non printable characters by '.'
00058 if (printLevel>=2) {
00059 s << "lg : ";
00060 lgth = GetReadLength(); // ReadLength, as opposed to UsableLength
00061 if (lgth == 0xffffffff) {
00062 sprintf(st,"x(ffff)"); // I said : "x(ffff)" !
00063 s.setf(std::ios::left);
00064 s << std::setw(10-strlen(st)) << " ";
00065 s << st << " ";
00066 s.setf(std::ios::left);
00067 s << std::setw(8) << "-1";
00068 } else {
00069 sprintf(st,"x(%x)",lgth);
00070 s.setf(std::ios::left);
00071 s << std::setw(10-strlen(st)) << " ";
00072 s << st << " ";
00073 s.setf(std::ios::left);
00074 s << std::setw(8) << lgth;
00075 }
00076 s << " Off.: ";
00077 sprintf(st,"x(%x)",o);
00078 s << std::setw(10-strlen(st)) << " ";
00079 s << st << " ";
00080 s << std::setw(8) << o;
00081 }
00082
00083 s << "[" << vr << "] ";
00084
00085 if (printLevel>=1) {
00086 s.setf(std::ios::left);
00087 s << std::setw(66-GetName().length()) << " ";
00088 }
00089
00090 s << "[" << GetName()<< "]";
00091
00092 if (voidArea != NULL) {
00093 s << " [gdcm::Non String Data Loaded in Unsecure Area ("
00094 << GetLength() << ") ]";
00095 }
00096
00097 else {
00098 if( (GetLength()<MAX_SIZE_PRINT_ELEMENT_VALUE) ||
00099 (printLevel>=3) ||
00100 (d2.find("gdcm::NotLoaded.") < d2.length()) )
00101 s << " [" << d2 << "]";
00102 else
00103 s << " [gdcm::too long for print (" << GetLength() << ") ]";
00104 }
00105
00106 // Display the UID value (instead of displaying the rough code)
00107 if (g == 0x0002) { // Any more to be displayed ?
00108 if ( (e == 0x0010) || (e == 0x0002) )
00109 s << " ==>\t[" << ts->GetValue(v) << "]";
00110 } else {
00111 if (g == 0x0008) {
00112 if ( (e == 0x0016) || (e == 0x1150) )
00113 s << " ==>\t[" << ts->GetValue(v) << "]";
00114 } else {
00115 if (g == 0x0004) {
00116 if ( (e == 0x1510) || (e == 0x1512) )
00117 s << " ==>\t[" << ts->GetValue(v) << "]";
00118 }
00119 }
00120 }
00121 //if (e == 0x0000) { // elem 0x0000 --> group length
00122 if ( (vr == "UL") || (vr == "US") || (vr == "SL") || (vr == "SS") ) {
00123 if (v == "4294967295") // to avoid troubles in convertion
00124 sprintf (st," x(ffffffff)");
00125 else
00126 sprintf(st," x(%x)",(unsigned long)atof(v.c_str()));
00127 s << st;
00128 }
00129 s << std::endl;
00130 os << s.str();
00131 }
|
|
|
Sets the DicEntry of the current Dicom Element.
Definition at line 76 of file gdcmHeaderEntry.h. References entry. Referenced by gdcmParser::CheckHeaderEntryVR(), and gdcmParser::FindHeaderEntryLength().
00076 {
00077 entry = NewEntry;
00078 };
|
|
|
Sets to TRUE the ImplicitVr flag of the current Dicom Element.
Definition at line 55 of file gdcmHeaderEntry.h. References ImplicitVR. Referenced by gdcmParser::FindHeaderEntryVR().
00055 { ImplicitVR = true; };
|
|
|
Definition at line 33 of file gdcmHeaderEntry.h. Referenced by gdcmParser::FindHeaderEntryLength(), gdcmParser::LoadHeaderEntry(), gdcmDicomDir::SetElement(), gdcmParser::SetEntryByNumber(), gdcmHeader::SetImageDataSize(), gdcmParser::UpdateGroupLength(), and gdcmFile::WriteBase().
00033 { ReadLength=UsableLength=l;};
|
|
|
Sets the offset of the Dicom Element.
Definition at line 49 of file gdcmHeaderEntry.h. References Offset. Referenced by gdcmParser::ReadNextHeaderEntry(), and gdcmDicomDir::SetElement().
00049 { Offset = of; };
|
|
|
Sets the print level for the Dicom Header Elements.
Definition at line 92 of file gdcmHeaderEntry.h.
00092 { printLevel = level; };
|
|
|
Definition at line 36 of file gdcmHeaderEntry.h. Referenced by gdcmParser::FixHeaderEntryFoundLength().
00036 { ReadLength = l; };
|
|
|
Definition at line 37 of file gdcmHeaderEntry.h. Referenced by gdcmParser::FixHeaderEntryFoundLength().
00037 { UsableLength = l; };
|
|
|
Definition at line 40 of file gdcmHeaderEntry.h. Referenced by gdcmParser::LoadHeaderEntry(), gdcmDicomDir::SetElement(), and gdcmParser::UpdateGroupLength().
00040 { value = val; };
|
|
|
Definition at line 41 of file gdcmHeaderEntry.h.
00041 { voidArea = area; };
|
|
|
Definition at line 32 of file gdcmHeaderEntry.h. Referenced by gdcmParser::CheckHeaderEntryVR(), and gdcmParser::FindHeaderEntryVR().
|
|
|
Definition at line 98 of file gdcmHeaderEntry.h. |
|
|
Definition at line 101 of file gdcmHeaderEntry.h. Referenced by gdcmHeaderEntry(), GetDictEntry(), IsVRUnknown(), and SetDictEntry(). |
|
|
Definition at line 114 of file gdcmHeaderEntry.h. Referenced by gdcmHeaderEntry(), IsImplicitVR(), and SetImplicitVR(). |
|
|
Definition at line 123 of file gdcmHeaderEntry.h. Referenced by SetOffset(). |
|
|
Definition at line 124 of file gdcmHeaderEntry.h. Referenced by Print(). |
|
|
Definition at line 106 of file gdcmHeaderEntry.h. |
|
|
Definition at line 102 of file gdcmHeaderEntry.h. |
|
|
Definition at line 120 of file gdcmHeaderEntry.h. |
|
|
Definition at line 121 of file gdcmHeaderEntry.h. Referenced by gdcmHeaderEntry(), and Print(). |
1.3.6