Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

gdcmHeaderEntry Class Reference

#include <gdcmHeaderEntry.h>

List of all members.

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.

gdcmDictEntryGetDictEntry (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

gdcmDictEntryentry
guint32 UsableLength
guint32 ReadLength
bool ImplicitVR
std::string value
void * voidArea
size_t Offset
int printLevel

Friends

class gdcmHeader


Constructor & Destructor Documentation

gdcmHeaderEntry::gdcmHeaderEntry gdcmDictEntry in  ) 
 

Constructor from a given gdcmDictEntry.

Parameters:
in Pointer to existing dictionary entry

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 }


Member Function Documentation

gdcmDictEntry* gdcmHeaderEntry::GetDictEntry void   )  [inline]
 

Gets the DicEntry of the current Dicom Element.

Returns:
the DicEntry of the current Dicom Element

Definition at line 85 of file gdcmHeaderEntry.h.

References entry.

00085 { return entry; }; 

guint16 gdcmHeaderEntry::GetElement void   )  [inline]
 

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();};

guint16 gdcmHeaderEntry::GetGroup void   )  [inline]
 

Definition at line 21 of file gdcmHeaderEntry.h.

Referenced by gdcmParser::CheckHeaderEntryVR(), gdcmParser::FindHeaderEntryLength(), gdcmParser::FixHeaderEntryFoundLength(), gdcmParser::IsHeaderEntryAnInteger(), gdcmParser::LoadHeaderEntry(), gdcmParser::ParseHeader(), Print(), and gdcmParser::UpdateGroupLength().

00021 { return entry->GetGroup();  };

std::string gdcmHeaderEntry::GetKey void   )  [inline]
 

Definition at line 23 of file gdcmHeaderEntry.h.

Referenced by gdcmParser::AddHeaderEntry().

00023 { return entry->GetKey();    };

guint32 gdcmHeaderEntry::GetLength void   )  [inline]
 

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;       };   

std::string gdcmHeaderEntry::GetName void   )  [inline]
 

Definition at line 24 of file gdcmHeaderEntry.h.

Referenced by gdcmParser::CheckHeaderEntryVR(), and Print().

00024 { return entry->GetName();   };

size_t gdcmHeaderEntry::GetOffset void   )  [inline]
 

Definition at line 29 of file gdcmHeaderEntry.h.

Referenced by gdcmParser::GetEntryOffsetByNumber(), gdcmHeader::GetPixelOffset(), gdcmParser::LoadEntryVoidArea(), gdcmParser::LoadHeaderEntry(), and Print().

00029 { return Offset;             };   

guint32 gdcmHeaderEntry::GetReadLength void   )  [inline]
 

Definition at line 38 of file gdcmHeaderEntry.h.

Referenced by Print().

00038 { return ReadLength;};

std::string gdcmHeaderEntry::GetValue void   )  [inline]
 

Definition at line 26 of file gdcmHeaderEntry.h.

Referenced by gdcmParser::GetHeaderEntryUnvalue(), gdcmParser::GetHeaderEntryValue(), gdcmParser::IsDeflatedExplicitVRLittleEndianTransferSyntax(), gdcmParser::IsExplicitVRBigEndianTransferSyntax(), gdcmParser::IsExplicitVRLittleEndianTransferSyntax(), gdcmParser::IsImplicitVRLittleEndianTransferSyntax(), gdcmHeader::IsJPEG2000(), gdcmHeader::IsJPEGBaseLineProcess1TransferSyntax(), gdcmHeader::IsJPEGExtendedProcess2_4TransferSyntax(), gdcmHeader::IsJPEGExtendedProcess3_5TransferSyntax(), gdcmHeader::IsJPEGLossless(), gdcmHeader::IsJPEGSpectralSelectionProcess6_8TransferSyntax(), gdcmHeader::IsRLELossLessTransferSyntax(), Print(), and gdcmDicomDir::SetElement().

00026 { return value;              };

void* gdcmHeaderEntry::GetVoidArea void   )  [inline]
 

Definition at line 28 of file gdcmHeaderEntry.h.

Referenced by gdcmParser::GetEntryVoidAreaByNumber().

00028 { return voidArea;           };

std::string gdcmHeaderEntry::GetVR void   )  [inline]
 

Definition at line 25 of file gdcmHeaderEntry.h.

Referenced by gdcmParser::CheckHeaderEntryVR(), gdcmParser::FindHeaderEntryLength(), gdcmParser::FixHeaderEntryFoundLength(), gdcmParser::GetEntryVRByName(), gdcmParser::GetEntryVRByNumber(), gdcmParser::GetHeaderEntryUnvalue(), gdcmParser::GetHeaderEntryValue(), gdcmParser::IsHeaderEntryAnInteger(), gdcmParser::LoadHeaderEntry(), Print(), gdcmParser::SetEntryByNumber(), and gdcmParser::UpdateGroupLength().

00025 { return entry->GetVR();     };

bool gdcmHeaderEntry::IsImplicitVR void   )  [inline]
 

tells us if the current Dicom Element was checked as ImplicitVr

Returns:
true 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; };

bool gdcmHeaderEntry::IsVRUnknown void   )  [inline]
 

tells us if the VR of the current Dicom Element is Unkonwn

Returns:
true if the VR 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(); };

void gdcmHeaderEntry::Print std::ostream &  os = std::cout  ) 
 

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 }

void gdcmHeaderEntry::SetDictEntry gdcmDictEntry NewEntry  )  [inline]
 

Sets the DicEntry of the current Dicom Element.

Parameters:
NewEntry pointer to the DictEntry

Definition at line 76 of file gdcmHeaderEntry.h.

References entry.

Referenced by gdcmParser::CheckHeaderEntryVR(), and gdcmParser::FindHeaderEntryLength().

00076                                                                     { 
00077       entry = NewEntry;
00078    };

void gdcmHeaderEntry::SetImplicitVR void   )  [inline]
 

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; };

void gdcmHeaderEntry::SetLength guint32  l  )  [inline]
 

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;};

void gdcmHeaderEntry::SetOffset size_t  of  )  [inline]
 

Sets the offset of the Dicom Element.

Warning:
: use with caution !
Parameters:
of offset to be set

Definition at line 49 of file gdcmHeaderEntry.h.

References Offset.

Referenced by gdcmParser::ReadNextHeaderEntry(), and gdcmDicomDir::SetElement().

00049 { Offset = of; };

void gdcmHeaderEntry::SetPrintLevel int  level  )  [inline]
 

Sets the print level for the Dicom Header Elements.

Note:
0 for Light Print; 1 for 'medium' Print, 2 for Heavy

Definition at line 92 of file gdcmHeaderEntry.h.

00092 { printLevel = level; };

void gdcmHeaderEntry::SetReadLength guint32  l  )  [inline]
 

Definition at line 36 of file gdcmHeaderEntry.h.

Referenced by gdcmParser::FixHeaderEntryFoundLength().

00036 { ReadLength   = l; };          

void gdcmHeaderEntry::SetUsableLength guint32  l  )  [inline]
 

Definition at line 37 of file gdcmHeaderEntry.h.

Referenced by gdcmParser::FixHeaderEntryFoundLength().

00037 { UsableLength = l; };          

void gdcmHeaderEntry::SetValue std::string  val  )  [inline]
 

Definition at line 40 of file gdcmHeaderEntry.h.

Referenced by gdcmParser::LoadHeaderEntry(), gdcmDicomDir::SetElement(), and gdcmParser::UpdateGroupLength().

00040 { value = val;      };

void gdcmHeaderEntry::SetVoidArea void *  area  )  [inline]
 

Definition at line 41 of file gdcmHeaderEntry.h.

00041 { voidArea = area;  };

void gdcmHeaderEntry::SetVR std::string  v  )  [inline]
 

Definition at line 32 of file gdcmHeaderEntry.h.

Referenced by gdcmParser::CheckHeaderEntryVR(), and gdcmParser::FindHeaderEntryVR().

00032 { entry->SetVR(v);          };    


Friends And Related Function Documentation

friend class gdcmHeader [friend]
 

Definition at line 98 of file gdcmHeaderEntry.h.


Member Data Documentation

gdcmDictEntry* gdcmHeaderEntry::entry [private]
 

Definition at line 101 of file gdcmHeaderEntry.h.

Referenced by gdcmHeaderEntry(), GetDictEntry(), IsVRUnknown(), and SetDictEntry().

bool gdcmHeaderEntry::ImplicitVR [private]
 

Definition at line 114 of file gdcmHeaderEntry.h.

Referenced by gdcmHeaderEntry(), IsImplicitVR(), and SetImplicitVR().

size_t gdcmHeaderEntry::Offset [private]
 

Definition at line 123 of file gdcmHeaderEntry.h.

Referenced by SetOffset().

int gdcmHeaderEntry::printLevel [private]
 

Definition at line 124 of file gdcmHeaderEntry.h.

Referenced by Print().

guint32 gdcmHeaderEntry::ReadLength [private]
 

Definition at line 106 of file gdcmHeaderEntry.h.

guint32 gdcmHeaderEntry::UsableLength [private]
 

Definition at line 102 of file gdcmHeaderEntry.h.

std::string gdcmHeaderEntry::value [private]
 

Definition at line 120 of file gdcmHeaderEntry.h.

void* gdcmHeaderEntry::voidArea [private]
 

Definition at line 121 of file gdcmHeaderEntry.h.

Referenced by gdcmHeaderEntry(), and Print().


The documentation for this class was generated from the following files:
Generated on Mon Feb 14 16:13:38 2005 for gdcm by doxygen 1.3.6