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

gdcm::DicomDirImage Class Reference

describes an IMAGE within a SERIE (DicomDirSerie) of a given DICOMDIR (DicomDir) More...

#include <gdcmDicomDirImage.h>

Inheritance diagram for gdcm::DicomDirImage:

Inheritance graph
[legend]
Collaboration diagram for gdcm::DicomDirImage:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void Print (std::ostream &os=std::cout, std::string const &indent="")
 Prints the Object.
void WriteContent (std::ofstream *fp, FileType filetype)
 write any type of entry to the entry set
uint32_t ComputeFullLength ()
 Compute the full length of the SQItem (not only value length) depending on the VR.
bool AddEntry (DocEntry *Entry)
 Inserts *in the right place* any Entry (Dicom Element) into the Sequence Item.
bool RemoveEntry (DocEntry *EntryToRemove)
 Clear the std::list from given entry AND delete the entry.
void ClearEntry ()
 Remove all entry in the Sequence Item.
void MoveObject (SQItem *source)
 Move all the entries from a given Sequence Item.
DocEntryGetFirstEntry ()
 Get the first Dicom entry while visiting the SQItem.
DocEntryGetNextEntry ()
 Get the next Dicom entry while visiting the SQItem.
DocEntryGetDocEntry (uint16_t group, uint16_t elem)
 Gets a Dicom Element inside a SQ Item Entry.
bool IsEmpty ()
 tells us if the set contains no entry
int GetSQItemNumber ()
 returns the ordinal position of a given SQItem
void SetSQItemNumber (int itemNumber)
 Sets the ordinal position of a given SQItem.
int GetDepthLevel ()
 Accessor on SQDepthLevel.
void SetDepthLevel (int depth)
 Accessor on SQDepthLevel.
virtual std::string GetEntryString (uint16_t group, uint16_t elem)
 Get the "std::string representable" value of the Dicom entry.
virtual void * GetEntryBinArea (uint16_t group, uint16_t elem)
 Gets (from Header) a 'non string' element value.
virtual int GetEntryLength (uint16_t group, uint16_t elem)
 Searches within Header Entries (Dicom Elements) parsed with the public and private dictionaries for the value length of a given tag..
virtual std::string GetEntryForcedAsciiValue (uint16_t group, uint16_t elem)
 Return the value of the DataEntry if it's "std::string representable".
DataEntryGetDataEntry (uint16_t group, uint16_t elem)
 Same as Document::GetDocEntry except it only returns a result when the corresponding entry is of type DataEntry.
SeqEntryGetSeqEntry (uint16_t group, uint16_t elem)
 Same as Document::GetDocEntry except it only returns a result when the corresponding entry is of type SeqEntry.
bool SetEntryString (std::string const &content, uint16_t group, uint16_t elem)
 Accesses an existing DocEntry (i.e. a Dicom Element) through it's (group, element) and modifies it's content with the given value.
bool SetEntryString (std::string const &content, DataEntry *entry)
 Accesses an existing DocEntry (i.e. a Dicom Element) and modifies it's content with the given value.
bool SetEntryBinArea (uint8_t *content, int lgth, uint16_t group, uint16_t elem)
 Accesses an existing DocEntry (i.e. a Dicom Element) through it's (group, element) and modifies it's content with the given value.
bool SetEntryBinArea (uint8_t *content, int lgth, DataEntry *entry)
 Accesses an existing DataEntry (i.e. a Dicom Element) and modifies it's content with the given value.
DataEntryInsertEntryString (std::string const &value, uint16_t group, uint16_t elem, VRKey const &vr=GDCM_VRUNKNOWN)
 Modifies the value of a given Doc Entry (Dicom Element) when it exists. Create it with the given value when unexistant.
DataEntryInsertEntryBinArea (uint8_t *binArea, int lgth, uint16_t group, uint16_t elem, VRKey const &vr=GDCM_VRUNKNOWN)
 Modifies the value of a given Header Entry (Dicom Element) when it exists. Create it with the given value when unexistant. A copy of the binArea is made to be kept in the Document.
SeqEntryInsertSeqEntry (uint16_t group, uint16_t elem)
 Modifies the value of a given Doc Entry (Dicom Element) when it exists. Creates it when unexistant.
virtual bool CheckIfEntryExist (uint16_t group, uint16_t elem)
 Checks if a given Dicom Element exists within the H table.
DataEntryNewDataEntry (uint16_t group, uint16_t elem, VRKey const &vr=GDCM_VRUNKNOWN)
 Build a new Val Entry from all the low level arguments. Check for existence of dictionary entry, and build a default one when absent.
SeqEntryNewSeqEntry (uint16_t group, uint16_t elem)
 Build a new Seq Entry from all the low level arguments. Check for existence of dictionary entry, and build a default one when absent.
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 DicomDirImageNew (bool empty=false)
static SQItemNew (int depthLevel)

Protected Member Functions

 DicomDirImage (bool empty=false)
 Constructor.
 ~DicomDirImage ()
 Canonical destructor.
void FillObject (ListDicomDirMetaElem const &elemList)
 add the 'Object' related Dicom Elements to the listEntries of a partially created DICOMDIR
DictEntryGetDictEntry (uint16_t group, uint16_t elem)
 Searches [both] the public [and the shadow dictionary (when they exist)] for the presence of the DictEntry with given group and element. The public dictionary has precedence on the shadow one(s), if any.
DictEntryGetDictEntry (uint16_t group, uint16_t elem, VRKey const &vr)
 Searches [both] the public [and the shadow dictionary (when they exist)] for the presence of the DictEntry with given group and element, and create a new virtual DictEntry if necessary.

Protected Attributes

ListDocEntry DocEntries
 Chained list of Doc Entries.
ListDocEntry::iterator ItDocEntries
 Iterator, used to visit the entries.
ListDocEntry::iterator ItValEntries
 Iterator, used to visit the Val Entries (for Python users).
DocEntryPreviousDocEntry
 To be able to backtrack (Private Sequence, Implicit VR related pb).
int PrintLevel
 Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.

Private Member Functions

 gdcmTypeMacro (DicomDirImage)

Detailed Description

describes an IMAGE within a SERIE (DicomDirSerie) of a given DICOMDIR (DicomDir)

Definition at line 31 of file gdcmDicomDirImage.h.


Constructor & Destructor Documentation

gdcm::DicomDirImage::DicomDirImage bool  empty = false  )  [protected]
 

Constructor.

Note:
End user must use : DicomDirSerie::NewImage()

Definition at line 31 of file gdcmDicomDirImage.cxx.

References gdcm::DicomDirObject::FillObject(), gdcm::Global::GetDicomDirElements(), and gdcm::DicomDirElement::GetDicomDirImageElements().

00031                                       :
00032    DicomDirObject()
00033 {
00034    if ( !empty )
00035    {
00036       ListDicomDirImageElem const &elemList = 
00037          Global::GetDicomDirElements()->GetDicomDirImageElements();
00038       FillObject(elemList);
00039    }
00040 }

gdcm::DicomDirImage::~DicomDirImage  )  [protected]
 

Canonical destructor.

Definition at line 45 of file gdcmDicomDirImage.cxx.

00046 {
00047 }


Member Function Documentation

bool gdcm::SQItem::AddEntry DocEntry entry  )  [virtual, inherited]
 

Inserts *in the right place* any Entry (Dicom Element) into the Sequence Item.

Parameters:
entry Entry to add
Returns:
always true

Implements gdcm::DocEntrySet.

Definition at line 131 of file gdcmSQItem.cxx.

References gdcm::SQItem::DocEntries, gdcm::DocEntry::GetElement(), gdcm::DocEntry::GetGroup(), and gdcm::RefCounter::Register().

Referenced by gdcm::FileHelper::CheckMandatoryElements(), gdcm::DicomDirObject::FillObject(), gdcm::DicomDir::NewMeta(), and gdcm::DicomDir::SetElement().

00132 {   
00133    if (DocEntries.empty() )
00134    {
00135       DocEntries.push_back(entry);
00136       entry->Register();
00137       return true;
00138    }
00139  
00140    ListDocEntry::iterator insertSpot;
00141    ListDocEntry::iterator it = DocEntries.end();
00142    do
00143    {
00144       it--;
00145 
00146       if ( (*it)->IsItemDelimitor() )
00147       {
00148          continue;
00149       }
00150       if ( (*it)->GetGroup() < entry->GetGroup() )
00151          break;
00152       else
00153          if ( (*it)->GetGroup() == entry->GetGroup() &&
00154               (*it)->GetElement() < entry->GetElement() )
00155             break;
00156    } while (it != DocEntries.begin() );
00157   
00158    ++it;
00159    insertSpot = it;
00160    //++insertSpot; // ?!?
00161    DocEntries.insert(insertSpot, entry); 
00162    entry->Register();
00163    return true;
00164 }   

bool gdcm::DocEntrySet::CheckIfEntryExist uint16_t  group,
uint16_t  elem
[virtual, inherited]
 

Checks if a given Dicom Element exists within the H table.

Parameters:
group Group number of the searched Dicom Element
elem Element number of the searched Dicom Element
Returns:
true is found

Definition at line 430 of file gdcmDocEntrySet.cxx.

References gdcm::DocEntrySet::GetDocEntry().

00431 {
00432    return GetDocEntry(group,elem)!=NULL;
00433 }

void gdcm::SQItem::ClearEntry  )  [virtual, inherited]
 

Remove all entry in the Sequence Item.

Implements gdcm::DocEntrySet.

Definition at line 192 of file gdcmSQItem.cxx.

References gdcm::SQItem::DocEntries.

Referenced by gdcm::SQItem::~SQItem().

00193 {
00194    for(ListDocEntry::iterator cc = DocEntries.begin();
00195                               cc != DocEntries.end();
00196                             ++cc)
00197    {
00198       (*cc)->Unregister();
00199    }
00200    DocEntries.clear();
00201 }

uint32_t gdcm::SQItem::ComputeFullLength  )  [inherited]
 

Compute the full length of the SQItem (not only value length) depending on the VR.

Definition at line 106 of file gdcmSQItem.cxx.

References gdcm::SQItem::DocEntries.

00107 {
00108    uint32_t l = 8;  // Item Starter length
00109    for (ListDocEntry::iterator it = DocEntries.begin();  
00110                                it != DocEntries.end();
00111                              ++it)
00112    {   
00113       // we skip delimitors (start and end one) because 
00114       // we force them as 'no length'
00115       if ( (*it)->GetGroup() == 0xfffe )
00116       {
00117          continue;
00118       }
00119       l += (*it)->ComputeFullLength();
00120    }
00121    l += 8; // 'Item Delimitation' item 
00122    return l;  
00123 }

void gdcm::RefCounter::Delete  )  [inline, inherited]
 

Delete the object.

Remarks:
The object is deleted only if its reference counting is to zero

Definition at line 40 of file gdcmRefCounter.h.

Referenced by gdcm::SerieHelper::AddFileName(), gdcm::Document::Backtrack(), gdcm::FileHelper::CheckMandatoryElements(), gdcm::FileHelper::CheckMandatoryEntry(), gdcm::FileHelper::CopyMandatoryEntry(), gdcm::DicomDir::CreateDicomDirChainedList(), gdcm::File::DoTheLoadingJob(), gdcm::Dict::DoTheLoadingJob(), gdcm::DicomDirObject::FillObject(), gdcm::DocEntrySet::InsertEntryBinArea(), gdcm::DocEntrySet::InsertEntryString(), gdcm::DocEntrySet::InsertSeqEntry(), gdcm::DicomDir::NewMeta(), gdcm::DicomDirStudy::NewVisit(), gdcm::Document::ParseDES(), gdcm::Document::ParseSQ(), gdcm::Document::ReadNextDocEntry(), gdcm::DicomDir::SetElement(), gdcm::FileHelper::SetMandatoryEntry(), gdcm::FileHelper::SetWriteFileTypeToExplicitVR(), gdcm::FileHelper::SetWriteFileTypeToImplicitVR(), gdcm::FileHelper::SetWriteFileTypeToJPEG(), gdcm::FileHelper::SetWriteToLibido(), gdcm::FileHelper::SetWriteToNoLibido(), gdcm::FileHelper::SetWriteToRaw(), gdcm::FileHelper::SetWriteToRGB(), gdcm::DicomDir::~DicomDir(), and gdcm::Global::~Global().

00040 { Unregister(); }

void gdcm::DicomDirObject::FillObject ListDicomDirMetaElem const &  elemList  )  [protected, inherited]
 

add the 'Object' related Dicom Elements to the listEntries of a partially created DICOMDIR

Parameters:
elemList Element List to add at the right place

Definition at line 56 of file gdcmDicomDirObject.cxx.

References gdcm::SQItem::AddEntry(), gdcm::RefCounter::Delete(), gdcm::DictSet::GetDefaultPubDict(), gdcm::Global::GetDicts(), gdcm::Dict::GetEntry(), gdcm::DataEntry::New(), gdcm::DocEntry::SetOffset(), and gdcm::DataEntry::SetString().

Referenced by DicomDirImage(), gdcm::DicomDirMeta::DicomDirMeta(), gdcm::DicomDirPatient::DicomDirPatient(), gdcm::DicomDirSerie::DicomDirSerie(), gdcm::DicomDirStudy::DicomDirStudy(), and gdcm::DicomDirVisit::DicomDirVisit().

00057 {
00058   // FillObject fills up the SQItem that will be connected to the right place
00059    ListDicomDirMetaElem::const_iterator it;
00060    uint16_t tmpGr,tmpEl;
00061    DictEntry *dictEntry;
00062    DataEntry *entry;
00063       
00064    // for all the Elements found in they own part of the DicomDir dict.     
00065    for(it = elemList.begin(); it != elemList.end(); ++it)
00066    {
00067       tmpGr = it->Group;
00068       tmpEl = it->Elem;
00069       dictEntry = Global::GetDicts()->GetDefaultPubDict()->GetEntry(tmpGr,tmpEl);
00070       entry = DataEntry::New(dictEntry);
00071       entry->SetOffset(0); // just to avoid further missprinting
00072       entry->SetString(it->Value);
00073 
00074       AddEntry(entry);
00075       entry->Delete();
00076    } 
00077 } 

gdcm::DicomDirImage::gdcmTypeMacro DicomDirImage   )  [private]
 

DataEntry * gdcm::DocEntrySet::GetDataEntry uint16_t  group,
uint16_t  elem
[inherited]
 

Same as Document::GetDocEntry except it only returns a result when the corresponding entry is of type DataEntry.

Parameters:
group Group number of the searched Dicom Element
elem Element number of the searched Dicom Element
Returns:
When present, the corresponding DataEntry.

Definition at line 136 of file gdcmDocEntrySet.cxx.

References gdcm::DocEntrySet::GetDocEntry().

Referenced by gdcm::FileHelper::CheckMandatoryElements(), gdcm::FileHelper::CheckMandatoryEntry(), gdcm::Document::DoTheLoadingDocumentJob(), gdcm::File::GetBitsAllocated(), gdcm::File::GetBitsStored(), gdcm::DocEntrySet::GetEntryBinArea(), gdcm::File::GetHighBitPosition(), gdcm::File::GetPlanarConfiguration(), gdcm::File::GetRescaleIntercept(), gdcm::File::GetRescaleSlope(), gdcm::File::GetSamplesPerPixel(), gdcm::File::GetXOrigin(), gdcm::File::GetXSize(), gdcm::File::GetXSpacing(), gdcm::File::GetYOrigin(), gdcm::File::GetYSize(), gdcm::File::GetYSpacing(), gdcm::File::GetZOrigin(), gdcm::File::GetZSize(), gdcm::File::GetZSpacing(), gdcm::File::IsSignedPixelData(), gdcm::ElementSet::Print(), gdcm::DocEntrySet::SetEntryBinArea(), gdcm::DocEntrySet::SetEntryString(), gdcm::FileHelper::SetWriteToLibido(), gdcm::FileHelper::SetWriteToNoLibido(), gdcm::FileHelper::Write(), gdcm::File::Write(), and gdcm::DicomDirMeta::WriteContent().

00137 {
00138    DocEntry *currentEntry = GetDocEntry(group, elem);
00139    if ( !currentEntry )
00140       return NULL;
00141 
00142    return dynamic_cast<DataEntry*>(currentEntry);
00143 }

int gdcm::SQItem::GetDepthLevel  )  [inline, inherited]
 

Accessor on SQDepthLevel.

Definition at line 70 of file gdcmSQItem.h.

00070 { return SQDepthLevel; }                                                                             

DictEntry * gdcm::DocEntrySet::GetDictEntry uint16_t  group,
uint16_t  elem,
VRKey const &  vr
[protected, inherited]
 

Searches [both] the public [and the shadow dictionary (when they exist)] for the presence of the DictEntry with given group and element, and create a new virtual DictEntry if necessary.

Parameters:
group group number of the searched DictEntry
elem element number of the searched DictEntry
vr V(alue) R(epresentation) to use, if necessary
Returns:
Corresponding DictEntry when it exists, NULL otherwise.
Remarks:
The returned DictEntry is registered

Definition at line 520 of file gdcmDocEntrySet.cxx.

References gdcm::GDCM_VRUNKNOWN, gdcm::DocEntrySet::GetDictEntry(), gdcm::DicomEntry::GetVR(), gdcm::DictEntry::New(), gdcm::RefCounter::Register(), and gdcm::RefCounter::Unregister().

00522 {
00523    DictEntry *dictEntry = GetDictEntry(group,elem);
00524    DictEntry *goodEntry = dictEntry;
00525    VRKey goodVR = vr;
00526 
00527    if (elem == 0x0000) 
00528       goodVR="UL";
00529 
00530    if ( goodEntry )
00531    {
00532       if ( goodVR != goodEntry->GetVR()
00533         && goodVR != GDCM_VRUNKNOWN )
00534       {
00535          goodEntry = NULL;
00536       }
00537       dictEntry->Unregister();
00538    }
00539 
00540    // Create a new virtual DictEntry if necessary
00541    if (!goodEntry)
00542    {
00543       if (dictEntry)
00544       {
00545          goodEntry = DictEntry::New(group, elem, goodVR, "FIXME", 
00546                                     dictEntry->GetName() );
00547       }
00548       else
00549       {
00550          goodEntry = DictEntry::New(group, elem, goodVR);
00551       }
00552    }
00553    else
00554    {
00555       goodEntry->Register();
00556    }
00557    return goodEntry;
00558 }

DictEntry * gdcm::DocEntrySet::GetDictEntry uint16_t  group,
uint16_t  elem
[protected, inherited]
 

Searches [both] the public [and the shadow dictionary (when they exist)] for the presence of the DictEntry with given group and element. The public dictionary has precedence on the shadow one(s), if any.

Parameters:
group Group number of the searched DictEntry
elem Element number of the searched DictEntry
Returns:
Corresponding DictEntry when it exists, NULL otherwise.
Remarks:
The returned DictEntry is registered when existing

Definition at line 493 of file gdcmDocEntrySet.cxx.

References gdcmWarningMacro, gdcm::DictSet::GetDefaultPubDict(), gdcm::Global::GetDicts(), gdcm::Dict::GetEntry(), and gdcm::RefCounter::Register().

Referenced by gdcm::DocEntrySet::GetDictEntry(), gdcm::DocEntrySet::NewDataEntry(), gdcm::DocEntrySet::NewSeqEntry(), and gdcm::Document::ReadNextDocEntry().

00494 {
00495    DictEntry *found = 0;
00496    Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();
00497    if (!pubDict) 
00498    {
00499       gdcmWarningMacro( "We SHOULD have a default dictionary");
00500    }
00501    else
00502    {
00503       found = pubDict->GetEntry(group, elem);
00504       if( found )
00505          found->Register();
00506    }
00507    return found;
00508 }

DocEntry * gdcm::SQItem::GetDocEntry uint16_t  group,
uint16_t  elem
[virtual, inherited]
 

Gets a Dicom Element inside a SQ Item Entry.

Parameters:
group Group number of the Entry
elem Element number of the Entry
Returns:
Entry whose (group,elem) was passed. 0 if not found

Implements gdcm::DocEntrySet.

Definition at line 242 of file gdcmSQItem.cxx.

References gdcm::SQItem::DocEntries.

Referenced by gdcm::DicomDir::CreateDicomDir().

00243 {
00244    for(ListDocEntry::iterator i =  DocEntries.begin();
00245                               i != DocEntries.end(); 
00246                             ++i)
00247    {
00248       if ( (*i)->GetGroup() == group && (*i)->GetElement() == elem )
00249          return *i;
00250    }
00251    return NULL;
00252 }

void * gdcm::DocEntrySet::GetEntryBinArea uint16_t  group,
uint16_t  elem
[virtual, inherited]
 

Gets (from Header) a 'non string' element value.

Parameters:
group group number of the Entry
elem element number of the Entry
Returns:
Pointer to the 'non string' area

Definition at line 69 of file gdcmDocEntrySet.cxx.

References gdcm::DataEntry::GetBinArea(), and gdcm::DocEntrySet::GetDataEntry().

Referenced by gdcm::PixelReadConvert::GrabInformationsFromFile().

00070 {
00071    DataEntry *entry = GetDataEntry(group, elem);
00072    if ( entry )
00073       return entry->GetBinArea();
00074    return 0;
00075 }

std::string gdcm::DocEntrySet::GetEntryForcedAsciiValue uint16_t  group,
uint16_t  elem
[virtual, inherited]
 

Return the value of the DataEntry if it's "std::string representable".

Parameters:
group Group number of the searched tag.
elem Element number of the searched tag.
Returns:
Corresponding element value when it's "std::string representable" and the string GDCM_NOTASCII otherwise.

Definition at line 84 of file gdcmDocEntrySet.cxx.

References gdcm::Util::CreateCleanString(), gdcm::GDCM_NOTASCII, gdcm::GDCM_NOTLOADED, gdcm::GDCM_UNFOUND, gdcm::GDCM_UNREAD, gdcm::DataEntry::GetBinArea(), gdcm::DocEntrySet::GetDocEntry(), gdcm::DocEntry::GetLength(), gdcm::DataEntry::GetString(), gdcm::DocEntry::GetVR(), gdcm::Global::GetVR(), gdcm::Util::IsCleanArea(), gdcm::DataEntry::IsNotLoaded(), gdcm::DataEntry::IsUnfound(), gdcm::DataEntry::IsUnread(), and gdcm::VR::IsVROfStringRepresentable().

00085 {
00086    DocEntry *d = GetDocEntry(group,elem);
00087    if ( !d )
00088       return GDCM_UNFOUND;
00089 
00090    DataEntry *de = dynamic_cast<DataEntry *>(d);
00091    if ( de )
00092    {
00093       if( de->IsNotLoaded() )
00094          return GDCM_NOTLOADED;
00095       if( de->IsUnfound() )
00096          return GDCM_UNFOUND;
00097       if( de->IsUnread() )
00098          return GDCM_UNREAD;
00099    }
00100 
00101    if( Global::GetVR()->IsVROfStringRepresentable( de->GetVR() ) )
00102       return de->GetString();
00103    else
00104    {
00105       uint8_t *a = de->GetBinArea();
00106       if( Util::IsCleanArea(a, de->GetLength()) )
00107          return  Util::CreateCleanString(a, de->GetLength());
00108    }
00109    return GDCM_NOTASCII;
00110 }

int gdcm::DocEntrySet::GetEntryLength uint16_t  group,
uint16_t  elem
[virtual, inherited]
 

Searches within Header Entries (Dicom Elements) parsed with the public and private dictionaries for the value length of a given tag..

Parameters:
group Group number of the searched tag.
elem Element number of the searched tag.
Returns:
Corresponding element length; -2 if not found

Definition at line 120 of file gdcmDocEntrySet.cxx.

References gdcm::DocEntrySet::GetDocEntry(), and gdcm::DocEntry::GetLength().

Referenced by gdcm::DicomDir::SetElement(), and gdcm::File::Write().

00121 {
00122    DocEntry *entry = GetDocEntry(group, elem);
00123    if ( entry )
00124       return entry->GetLength();
00125    return -1;
00126 }

std::string gdcm::DocEntrySet::GetEntryString uint16_t  group,
uint16_t  elem
[virtual, inherited]
 

Get the "std::string representable" value of the Dicom entry.

Parameters:
group Group number of the searched tag.
elem Element number of the searched tag.
Returns:
Corresponding element value when it exists, and the string GDCM_UNFOUND otherwise.

Definition at line 47 of file gdcmDocEntrySet.cxx.

References gdcm::GDCM_NOTLOADED, gdcm::GDCM_UNFOUND, gdcm::GDCM_UNREAD, gdcm::DocEntrySet::GetDocEntry(), gdcm::DataEntry::GetString(), gdcm::DataEntry::IsNotLoaded(), gdcm::DataEntry::IsUnfound(), and gdcm::DataEntry::IsUnread().

Referenced by gdcm::SerieHelper::AddFileName(), gdcm::File::AnonymizeFile(), gdcm::FileHelper::CheckMandatoryElements(), gdcm::Document::DoTheLoadingDocumentJob(), gdcm::File::DoTheLoadingJob(), gdcm::File::GetImageNumber(), gdcm::File::GetImageOrientationPatient(), gdcm::File::GetLUTNbits(), gdcm::File::GetModality(), gdcm::File::GetNumberOfScalarComponents(), gdcm::File::GetNumberOfScalarComponentsRaw(), gdcm::File::GetPixelSize(), gdcm::File::GetPixelType(), gdcm::Document::GetTransferSyntaxName(), gdcm::PixelReadConvert::GrabInformationsFromFile(), gdcm::File::IsMonochrome(), gdcm::File::IsMonochrome1(), gdcm::File::IsPaletteColor(), gdcm::File::IsReadable(), gdcm::File::IsYBRFull(), gdcm::Document::operator<(), and gdcm::DicomDir::SetElement().

00048 {
00049    DataEntry *entry = dynamic_cast<DataEntry *>(GetDocEntry(group,elem));
00050    if ( entry )
00051    {
00052       if( entry->IsNotLoaded() )
00053          return GDCM_NOTLOADED;
00054       if( entry->IsUnfound() )
00055          return GDCM_UNFOUND;
00056       if( entry->IsUnread() )
00057          return GDCM_UNREAD;
00058       return entry->GetString();
00059    }
00060    return GDCM_UNFOUND;
00061 }

DocEntry * gdcm::SQItem::GetFirstEntry  )  [virtual, inherited]
 

Get the first Dicom entry while visiting the SQItem.

Returns:
The first DocEntry if found, otherwhise 0

Implements gdcm::DocEntrySet.

Definition at line 216 of file gdcmSQItem.cxx.

References gdcm::SQItem::DocEntries, and gdcm::SQItem::ItDocEntries.

Referenced by gdcm::DicomDirMeta::ComputeGroup0002Length().

00217 {
00218    ItDocEntries = DocEntries.begin();
00219    if ( ItDocEntries != DocEntries.end() )
00220       return *ItDocEntries;
00221    return 0;   
00222 }

DocEntry * gdcm::SQItem::GetNextEntry  )  [virtual, inherited]
 

Get the next Dicom entry while visiting the SQItem.

Returns:
The next DocEntry if found, otherwhise NULL

Implements gdcm::DocEntrySet.

Definition at line 228 of file gdcmSQItem.cxx.

References gdcm::SQItem::DocEntries, and gdcm::SQItem::ItDocEntries.

Referenced by gdcm::DicomDirMeta::ComputeGroup0002Length().

00229 {
00230    ++ItDocEntries;
00231    if ( ItDocEntries != DocEntries.end() )
00232       return  *ItDocEntries;
00233    return NULL;
00234 }

int gdcm::Base::GetPrintLevel  )  [inline, inherited]
 

Gets the print level for the Dicom Entries.

Definition at line 50 of file gdcmBase.h.

00050 { return PrintLevel; }

const unsigned long& gdcm::RefCounter::GetRefCount  )  const [inline, inherited]
 

Get the reference counting.

Returns:
Reference count

Definition at line 57 of file gdcmRefCounter.h.

00058    {
00059       return RefCount;
00060    }

SeqEntry * gdcm::DocEntrySet::GetSeqEntry uint16_t  group,
uint16_t  elem
[inherited]
 

Same as Document::GetDocEntry except it only returns a result when the corresponding entry is of type SeqEntry.

Parameters:
group Group number of the searched Dicom Element
elem Element number of the searched Dicom Element
Returns:
When present, the corresponding SeqEntry.

Definition at line 153 of file gdcmDocEntrySet.cxx.

References gdcm::DocEntrySet::GetDocEntry().

Referenced by gdcm::Document::DoTheLoadingDocumentJob().

00154 {
00155    DocEntry *currentEntry = GetDocEntry(group, elem);
00156    if ( !currentEntry )
00157       return NULL;
00158       
00159    return dynamic_cast<SeqEntry*>(currentEntry);
00160 }

int gdcm::SQItem::GetSQItemNumber  )  [inline, inherited]
 

returns the ordinal position of a given SQItem

Definition at line 65 of file gdcmSQItem.h.

00065 { return SQItemNumber; }

DataEntry * gdcm::DocEntrySet::InsertEntryBinArea uint8_t *  binArea,
int  lgth,
uint16_t  group,
uint16_t  elem,
VRKey const &  vr = GDCM_VRUNKNOWN
[inherited]
 

Modifies the value of a given Header Entry (Dicom Element) when it exists. Create it with the given value when unexistant. A copy of the binArea is made to be kept in the Document.

Parameters:
binArea (binary) value to be set
lgth length of the Bin Area we want to set
group Group number of the Entry
elem Element number of the Entry
vr V(alue) R(epresentation) of the Entry -if private Entry-
Returns:
pointer to the modified/created Header Entry (NULL when creation failed).

Definition at line 308 of file gdcmDocEntrySet.cxx.

References gdcm::DocEntrySet::AddEntry(), gdcm::RefCounter::Delete(), gdcmWarningMacro, gdcm::DocEntrySet::GetDocEntry(), gdcm::DocEntry::GetVR(), gdcm::DocEntrySet::NewDataEntry(), gdcm::DocEntrySet::RemoveEntry(), and gdcm::DocEntrySet::SetEntryBinArea().

Referenced by gdcm::FileHelper::InsertEntryBinArea().

00311 {
00312    DataEntry *dataEntry = 0;
00313    DocEntry *currentEntry = GetDocEntry( group, elem );
00314 
00315    // Verify the currentEntry
00316    if (currentEntry)
00317    {
00318       dataEntry = dynamic_cast<DataEntry *>(currentEntry);
00319 
00320       // Verify the VR
00321       if ( dataEntry )
00322          if ( dataEntry->GetVR()!=vr )
00323             dataEntry = NULL;
00324 
00325       // if currentEntry doesn't correspond to the requested dataEntry
00326       if ( !dataEntry)
00327       {
00328          if ( !RemoveEntry(currentEntry) )
00329          {
00330             gdcmWarningMacro( "Removal of previous DocEntry failed.");
00331             return NULL;
00332          }
00333       }
00334    }
00335 
00336    // Create a new dataEntry if necessary
00337    if ( !dataEntry)
00338    {
00339       dataEntry = NewDataEntry(group, elem, vr);
00340 
00341       if ( !AddEntry(dataEntry) )
00342       {
00343          gdcmWarningMacro( "AddEntry failed although this is a creation.");
00344          dataEntry->Delete();
00345          return NULL;
00346       }
00347       dataEntry->Delete();
00348    }
00349 
00350    // Set the dataEntry value
00351    uint8_t *tmpArea;
00352    if ( lgth>0 && binArea )
00353    {
00354       tmpArea = new uint8_t[lgth];
00355       memcpy(tmpArea,binArea,lgth);
00356    }
00357    else
00358    {
00359       tmpArea = 0;
00360    }
00361    if ( !SetEntryBinArea(tmpArea,lgth,dataEntry) )
00362    {
00363       if ( tmpArea )
00364       {
00365          delete[] tmpArea;
00366       }
00367    }
00368 
00369    return dataEntry;
00370 }  

DataEntry * gdcm::DocEntrySet::InsertEntryString std::string const &  value,
uint16_t  group,
uint16_t  elem,
VRKey const &  vr = GDCM_VRUNKNOWN
[inherited]
 

Modifies the value of a given Doc Entry (Dicom Element) when it exists. Create it with the given value when unexistant.

Parameters:
value (string) Value to be set
group Group number of the Entry
elem Element number of the Entry
vr V(alue) R(epresentation) of the Entry -if private Entry-
Returns:
pointer to the modified/created Header Entry (NULL when creation failed).

Definition at line 250 of file gdcmDocEntrySet.cxx.

References gdcm::DocEntrySet::AddEntry(), gdcm::RefCounter::Delete(), gdcmWarningMacro, gdcm::DocEntrySet::GetDocEntry(), gdcm::DocEntry::GetVR(), gdcm::DocEntrySet::NewDataEntry(), gdcm::DocEntrySet::RemoveEntry(), and gdcm::DocEntrySet::SetEntryString().

Referenced by gdcm::FileHelper::InsertEntryString(), gdcm::FileHelper::Write(), and gdcm::File::Write().

00253 {
00254    DataEntry *dataEntry = 0;
00255    DocEntry *currentEntry = GetDocEntry( group, elem );
00256    
00257    if (currentEntry)
00258    {
00259       dataEntry = dynamic_cast<DataEntry *>(currentEntry);
00260 
00261       // Verify the VR
00262       if ( dataEntry )
00263          if ( dataEntry->GetVR()!=vr )
00264             dataEntry = NULL;
00265 
00266       // if currentEntry doesn't correspond to the requested dataEntry
00267       if ( !dataEntry)
00268       {
00269          if ( !RemoveEntry(currentEntry) )
00270          {
00271             gdcmWarningMacro( "Removal of previous DocEntry failed.");
00272             return NULL;
00273          }
00274       }
00275    }
00276 
00277    // Create a new dataEntry if necessary
00278    if ( !dataEntry )
00279    {
00280       dataEntry = NewDataEntry( group, elem, vr );
00281 
00282       if ( !AddEntry(dataEntry) )
00283       {
00284          gdcmWarningMacro("AddEntry failed although this is a creation.");
00285          dataEntry->Delete();
00286          return NULL;
00287       }
00288       dataEntry->Delete();
00289    }
00290 
00291    // Set the dataEntry value
00292    SetEntryString(value, dataEntry); // The std::string value
00293    return dataEntry;
00294 }

SeqEntry * gdcm::DocEntrySet::InsertSeqEntry uint16_t  group,
uint16_t  elem
[inherited]
 

Modifies the value of a given Doc Entry (Dicom Element) when it exists. Creates it when unexistant.

Parameters:
group Group number of the Entry
elem Element number of the Entry
Returns:
pointer to the modified/created SeqEntry (NULL when creation failed).

Definition at line 380 of file gdcmDocEntrySet.cxx.

References gdcm::DocEntrySet::AddEntry(), gdcm::RefCounter::Delete(), gdcmWarningMacro, gdcm::DocEntrySet::GetDocEntry(), gdcm::DocEntrySet::NewSeqEntry(), and gdcm::DocEntrySet::RemoveEntry().

Referenced by gdcm::FileHelper::InsertSeqEntry().

00381 {
00382    SeqEntry *seqEntry = 0;
00383    DocEntry *currentEntry = GetDocEntry( group, elem );
00384 
00385    // Verify the currentEntry
00386    if ( currentEntry )
00387    {
00388       seqEntry = dynamic_cast<SeqEntry *>(currentEntry);
00389 
00390       // Verify the VR
00391       if ( seqEntry )
00392          seqEntry = NULL;
00393 
00394       // if currentEntry doesn't correspond to the requested seqEntry
00395       if ( !seqEntry )
00396       {
00397          if (!RemoveEntry(currentEntry))
00398          {
00399             gdcmWarningMacro( "Removal of previous DocEntry failed.");
00400 
00401             return NULL;
00402          }
00403       }
00404    }
00405    // Create a new seqEntry if necessary
00406    if ( !seqEntry )
00407    {
00408       seqEntry = NewSeqEntry(group, elem);
00409 
00410       if ( !AddEntry(seqEntry) )
00411       {
00412          gdcmWarningMacro( "AddEntry failed although this is a creation.");
00413          seqEntry->Delete();
00414          return NULL;
00415       }
00416       seqEntry->Delete();
00417    }
00418 
00419    // TODO : Find a trick to insert a SequenceDelimitationItem 
00420    //       in the SeqEntry, at the end.
00421    return seqEntry;
00422 } 

bool gdcm::SQItem::IsEmpty  )  [inline, virtual, inherited]
 

tells us if the set contains no entry

Implements gdcm::DocEntrySet.

Definition at line 62 of file gdcmSQItem.h.

00062 { return DocEntries.empty(); }

void gdcm::SQItem::MoveObject SQItem source  )  [inherited]
 

Move all the entries from a given Sequence Item.

Definition at line 206 of file gdcmSQItem.cxx.

References gdcm::SQItem::DocEntries.

Referenced by gdcm::DicomDir::CreateDicomDir().

00207 {
00208    DocEntries = source->DocEntries;
00209    source->DocEntries.clear();
00210 }

static SQItem* gdcm::SQItem::New int  depthLevel  )  [inline, static, inherited]
 

Definition at line 46 of file gdcmSQItem.h.

Referenced by gdcm::FileHelper::CheckMandatoryElements(), and gdcm::Document::ParseSQ().

00046 {return new SQItem(depthLevel);}

static DicomDirImage* gdcm::DicomDirImage::New bool  empty = false  )  [inline, static]
 

Definition at line 36 of file gdcmDicomDirImage.h.

Referenced by gdcm::DicomDir::CreateDicomDir(), gdcm::DicomDirSerie::NewImage(), and gdcm::DicomDir::SetElement().

00036 {return new DicomDirImage(empty);}

DataEntry * gdcm::DocEntrySet::NewDataEntry uint16_t  group,
uint16_t  elem,
VRKey const &  vr = GDCM_VRUNKNOWN
[inherited]
 

Build a new Val Entry from all the low level arguments. Check for existence of dictionary entry, and build a default one when absent.

Parameters:
group Group number of the new Entry
elem Element number of the new Entry
vr V(alue) R(epresentation) of the new Entry
Remarks:
The user of this method must destroy the DataEntry when unused

Definition at line 444 of file gdcmDocEntrySet.cxx.

References gdcmWarningMacro, gdcm::DocEntrySet::GetDictEntry(), gdcm::DataEntry::New(), and gdcm::RefCounter::Unregister().

Referenced by gdcm::FileHelper::CopyDataEntry(), gdcm::DocEntrySet::InsertEntryBinArea(), gdcm::DocEntrySet::InsertEntryString(), and gdcm::Document::ReadNextDocEntry().

00446 {
00447    DictEntry *dictEntry = GetDictEntry(group, elem, vr);
00448 
00449    DataEntry *newEntry = DataEntry::New(dictEntry);
00450    dictEntry->Unregister(); // GetDictEntry register it
00451    if (!newEntry) 
00452    {
00453       gdcmWarningMacro( "Failed to allocate DataEntry");
00454       return 0;
00455    }
00456    return newEntry;
00457 }

SeqEntry * gdcm::DocEntrySet::NewSeqEntry uint16_t  group,
uint16_t  elem
[inherited]
 

Build a new Seq Entry from all the low level arguments. Check for existence of dictionary entry, and build a default one when absent.

Parameters:
group Group number of the new Entry
elem Element number of the new Entry
Remarks:
The user of this method must destroy the SeqEntry when unused

Definition at line 467 of file gdcmDocEntrySet.cxx.

References gdcmWarningMacro, gdcm::DocEntrySet::GetDictEntry(), gdcm::SeqEntry::New(), and gdcm::RefCounter::Unregister().

Referenced by gdcm::Document::Backtrack(), gdcm::DocEntrySet::InsertSeqEntry(), and gdcm::Document::ReadNextDocEntry().

00468 {
00469    DictEntry *dictEntry = GetDictEntry(group, elem, "SQ");
00470 
00471    SeqEntry *newEntry = SeqEntry::New( dictEntry );
00472    dictEntry->Unregister(); // GetDictEntry register it
00473    if (!newEntry)
00474    {
00475       gdcmWarningMacro( "Failed to allocate SeqEntry");
00476       return 0;
00477    }
00478    return newEntry;
00479 }

void gdcm::DicomDirImage::Print std::ostream &  os = std::cout,
std::string const &  indent = ""
[virtual]
 

Prints the Object.

Parameters:
os ostream to write to
indent Indentation string to be prepended during printing
Returns:

Reimplemented from gdcm::SQItem.

Definition at line 66 of file gdcmDicomDirImage.cxx.

References gdcm::SQItem::DocEntries, and gdcm::SQItem::Print().

00067 {
00068    os << "IMAGE : ";
00069    for(ListDocEntry::iterator i = DocEntries.begin();
00070                               i!= DocEntries.end();
00071                               ++i)
00072    {
00073       if ( (*i)->GetGroup() == 0x0004 && (*i)->GetElement() == 0x1500 )
00074       {
00075          if( dynamic_cast<DataEntry *>(*i) )
00076             os << (dynamic_cast<DataEntry *>(*i))->GetString();
00077       }
00078    }
00079    os << std::endl;
00080 
00081    DicomDirObject::Print(os);
00082 }

void gdcm::RefCounter::Register  )  [inline, inherited]
 

Register the object.

Remarks:
It increments the reference counting

Definition at line 45 of file gdcmRefCounter.h.

Referenced by gdcm::SQItem::AddEntry(), gdcm::ElementSet::AddEntry(), gdcm::Dict::AddEntry(), gdcm::SeqEntry::AddSQItem(), gdcm::DocEntry::DocEntry(), gdcm::FileHelper::FileHelper(), gdcm::DocEntrySet::GetDictEntry(), gdcm::DocEntryArchive::Push(), gdcm::Dict::ReplaceEntry(), and gdcm::SeqEntry::SetDelimitationItem().

00045 { RefCount++; }

bool gdcm::SQItem::RemoveEntry DocEntry entryToRemove  )  [virtual, inherited]
 

Clear the std::list from given entry AND delete the entry.

Parameters:
entryToRemove Entry to remove AND delete.
Returns:
true if the entry was found and removed; false otherwise

Implements gdcm::DocEntrySet.

Definition at line 171 of file gdcmSQItem.cxx.

References gdcm::SQItem::DocEntries, gdcmDebugMacro, gdcmWarningMacro, gdcm::DocEntry::GetKey(), and gdcm::RefCounter::Unregister().

00172 {
00173    for(ListDocEntry::iterator it = DocEntries.begin();
00174                               it != DocEntries.end();
00175                             ++it)
00176    {
00177       if ( *it == entryToRemove )
00178       {
00179          DocEntries.erase(it);
00180          gdcmDebugMacro( "One element erased: " << entryToRemove->GetKey() );
00181          entryToRemove->Unregister();
00182          return true;
00183       }
00184    }
00185    gdcmWarningMacro( "Entry not found: " << entryToRemove->GetKey() );
00186    return false ;
00187 }

void gdcm::SQItem::SetDepthLevel int  depth  )  [inline, inherited]
 

Accessor on SQDepthLevel.

Definition at line 73 of file gdcmSQItem.h.

00073 { SQDepthLevel = depth; }

bool gdcm::DocEntrySet::SetEntryBinArea uint8_t *  content,
int  lgth,
DataEntry entry
[inherited]
 

Accesses an existing DataEntry (i.e. a Dicom Element) and modifies it's content with the given value.

Parameters:
content new value (void* -> uint8_t*) to substitute with
entry Entry to be modified
lgth new value length

Definition at line 229 of file gdcmDocEntrySet.cxx.

References gdcm::DataEntry::SetBinArea(), and gdcm::DocEntry::SetLength().

00230 {
00231    if (entry)
00232    {
00233       entry->SetLength(lgth);
00234       entry->SetBinArea(content);  
00235       return true;
00236    }
00237    return false;
00238 }

bool gdcm::DocEntrySet::SetEntryBinArea uint8_t *  content,
int  lgth,
uint16_t  group,
uint16_t  elem
[inherited]
 

Accesses an existing DocEntry (i.e. a Dicom Element) through it's (group, element) and modifies it's content with the given value.

Parameters:
content new value (void* -> uint8_t*) to substitute with
lgth new value length
group group number of the Dicom Element to modify
elem element number of the Dicom Element to modify

Definition at line 192 of file gdcmDocEntrySet.cxx.

References gdcmWarningMacro, and gdcm::DocEntrySet::GetDataEntry().

Referenced by gdcm::DocEntrySet::InsertEntryBinArea(), and gdcm::FileHelper::SetEntryBinArea().

00194 {
00195    DataEntry *entry = GetDataEntry(group, elem);
00196    if (!entry )
00197    {
00198       gdcmWarningMacro( "No corresponding DataEntry " << std::hex << group <<
00199                         "," << elem << " element (try promotion first).");
00200       return false;
00201    }
00202 
00203    return SetEntryBinArea(content,lgth,entry);
00204 } 

bool gdcm::DocEntrySet::SetEntryString std::string const &  content,
DataEntry entry
[inherited]
 

Accesses an existing DocEntry (i.e. a Dicom Element) and modifies it's content with the given value.

Parameters:
content new value (string) to substitute with
entry Entry to be modified

Definition at line 212 of file gdcmDocEntrySet.cxx.

References gdcm::DataEntry::SetString().

00213 {
00214    if (entry)
00215    {
00216       entry->SetString(content);
00217       return true;
00218    }
00219    return false;
00220 }

bool gdcm::DocEntrySet::SetEntryString std::string const &  content,
uint16_t  group,
uint16_t  elem
[inherited]
 

Accesses an existing DocEntry (i.e. a Dicom Element) through it's (group, element) and modifies it's content with the given value.

Parameters:
content new value (string) to substitute with
group group number of the Dicom Element to modify
elem element number of the Dicom Element to modify

Definition at line 170 of file gdcmDocEntrySet.cxx.

References gdcmWarningMacro, and gdcm::DocEntrySet::GetDataEntry().

Referenced by gdcm::File::AnonymizeFile(), gdcm::Document::DoTheLoadingDocumentJob(), gdcm::DocEntrySet::InsertEntryString(), and gdcm::FileHelper::SetEntryString().

00172 {
00173    DataEntry *entry = GetDataEntry(group, elem);
00174    if (!entry )
00175    {
00176       gdcmWarningMacro( "No corresponding DataEntry " << std::hex << group <<
00177                          "," << elem << " element (try promotion first).");
00178       return false;
00179    }
00180    return SetEntryString(content,entry);
00181 }

void gdcm::Base::SetPrintLevel int  level  )  [inline, inherited]
 

Sets the print level for the Dicom Header Elements.

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

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

void gdcm::SQItem::SetSQItemNumber int  itemNumber  )  [inline, inherited]
 

Sets the ordinal position of a given SQItem.

Definition at line 67 of file gdcmSQItem.h.

Referenced by gdcm::SeqEntry::AddSQItem(), and gdcm::DicomDir::NewMeta().

00067 { SQItemNumber = itemNumber; }

void gdcm::RefCounter::Unregister  )  [inline, inherited]
 

Unregister the object.

Remarks:
It decrements the reference counting

Definition at line 49 of file gdcmRefCounter.h.

Referenced by gdcm::SeqEntry::ClearSQItem(), gdcm::DocEntrySet::GetDictEntry(), 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().

00050    {
00051       RefCount--;
00052       if(RefCount<=0)
00053          delete this;
00054    }

void gdcm::SQItem::WriteContent std::ofstream *  fp,
FileType  filetype
[virtual, inherited]
 

write any type of entry to the entry set

Implements gdcm::DocEntrySet.

Reimplemented in gdcm::DicomDirMeta, gdcm::DicomDirPatient, gdcm::DicomDirSerie, and gdcm::DicomDirStudy.

Definition at line 57 of file gdcmSQItem.cxx.

References gdcm::binary_write(), and gdcm::SQItem::DocEntries.

Referenced by gdcm::DicomDirStudy::WriteContent(), gdcm::DicomDirSerie::WriteContent(), and gdcm::DicomDirPatient::WriteContent().

00058 {
00059    int j;
00060    uint16_t item[4] = { 0xfffe, 0xe000, 0xffff, 0xffff };
00061    uint16_t itemt[4]= { 0xfffe, 0xe00d, 0xffff, 0xffff };
00062 
00063     //we force the writting of an 'Item' Start Element
00064     // because we want to write the Item as a 'no Length' item
00065    for(j=0;j<4;++j)
00066    {
00067       binary_write( *fp, item[j]);  // fffe e000 ffff ffff 
00068    }
00069      
00070    for (ListDocEntry::iterator it = DocEntries.begin();  
00071                                it != DocEntries.end();
00072                              ++it)
00073    {   
00074       // we skip delimitors (start and end one) because 
00075       // we force them as 'no length'
00076       if ( (*it)->GetGroup() == 0xfffe )
00077       {
00078          continue;
00079       }
00080 
00081       // Fix in order to make some MR PHILIPS images e-film readable
00082       // see gdcmData/gdcm-MR-PHILIPS-16-Multi-Seq.dcm:
00083       // we just *always* ignore spurious fffe|0000 tag ! 
00084       if ( (*it)->GetGroup() == 0xfffe && (*it)->GetElement() == 0x0000 )
00085       {
00086           break; // FIXME : break or continue; ?!?  
00087                  // --> makes no difference since the only bugged file we have
00088                  // contains 'impossible tag' fffe|0000 in last position !                            
00089       }
00090 
00091       (*it)->WriteContent(fp, filetype);
00092    }
00093       
00094     //we force the writting of an 'Item Delimitation' item
00095     // because we wrote the Item as a 'no Length' item
00096    for(j=0;j<4;++j)
00097    {
00098       binary_write( *fp, itemt[j]);  // fffe e000 ffff ffff 
00099    } 
00100 }


Member Data Documentation

ListDocEntry gdcm::SQItem::DocEntries [protected, inherited]
 

Chained list of Doc Entries.

Definition at line 81 of file gdcmSQItem.h.

Referenced by gdcm::SQItem::AddEntry(), gdcm::SQItem::ClearEntry(), gdcm::SQItem::ComputeFullLength(), gdcm::SQItem::GetDocEntry(), gdcm::SQItem::GetFirstEntry(), gdcm::SQItem::GetNextEntry(), gdcm::SQItem::MoveObject(), gdcm::SQItem::Print(), gdcm::DicomDirVisit::Print(), gdcm::DicomDirMeta::Print(), Print(), gdcm::SQItem::RemoveEntry(), gdcm::SQItem::WriteContent(), and gdcm::DicomDirMeta::WriteContent().

ListDocEntry::iterator gdcm::SQItem::ItDocEntries [protected, inherited]
 

Iterator, used to visit the entries.

Definition at line 83 of file gdcmSQItem.h.

Referenced by gdcm::SQItem::GetFirstEntry(), and gdcm::SQItem::GetNextEntry().

ListDocEntry::iterator gdcm::SQItem::ItValEntries [protected, inherited]
 

Iterator, used to visit the Val Entries (for Python users).

Definition at line 85 of file gdcmSQItem.h.

DocEntry* gdcm::DocEntrySet::PreviousDocEntry [protected, inherited]
 

To be able to backtrack (Private Sequence, Implicit VR related pb).

Definition at line 124 of file gdcmDocEntrySet.h.

Referenced by gdcm::Document::Backtrack(), gdcm::DocEntrySet::DocEntrySet(), and gdcm::Document::ParseDES().

int gdcm::Base::PrintLevel [protected, inherited]
 

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().


The documentation for this class was generated from the following files:
Generated on Fri Nov 18 15:58:10 2005 for gdcm by  doxygen 1.4.4