+2004-09-13 Eric Boix <Eric.Boix@creatis.insa-lyon.fr>
+ * Preparation of writing a gdcmHeader iterator: generalisation of gdcmTagKey
+ - The following is the doxygen comment of the typedef declaration
+ of gdcmagKey in src/gdcmCommon.h:
+ gdcmTagKey is made to old an "universal" (as in URL, Universal
+ Ressource Locator) key to a gdcmDocEntry i.e. a dicom tag.
+ A dicom tag allways has a group and an element, but a set of tags
+ embeded in various (optionally nested) sequences and sharing
+ the same group and element all share the same (group, element)
+ "identifier". Hence the (group, element) cannot be used as an
+ identifier (in gdcm we shall refer to a "TagKey") of a tag.
+ In order to construct a proper tag identifier (i.e. a key) we
+ consider the following definition of a TagKey:
+ - let Group, Element be the string representation of the
+ group and element dicom tag members,
+ - let ItemNumber be the string representation of the integer
+ index of the considered item number of a sequence,
+ Let the key of a tag embeded in a sequence, noted SeqTag, be
+ the form:
+ /ItemNumber#Group|Element
+ where "/", "#" and "|" are characters acting as separators.
+ Then the general form of a gdcmTagKey is given by:
+ Group|Element<SeqTag>
+ where <SeqTag> means NO or many instances of SeqTag.
+ Hence the gdcmTagKey of a tag not "leaving" in a sequence is the
+ string e.g.
+ 0028|1201
+ but the gdcmTagKey of a tag "embeded" is the first item of
+ a sequence, itself nested in the third item of a sequence is the
+ string e.g.
+ 0004|1220/2#0008|0082/0#0008|0090
+ - src/gdcmDocEntry.h: added a new Key (of type gdcmTagKey) member, in
+ order to hold the new sequence compatible key. Previously, the
+ GetKey() method would look in the underlying gdcmDictEntry.
+ - src/gdcmDocEntry.cxx:
+ -- constructor now copies the underlying DictEntry key, in the local
+ Key member.
+ -- ::Print: displays the member Key, instead of the (group, element).
+ - src/gdcmCommon.h: added some comments on typedef gdcmTagKey.
+ - src/gdcmDocEntrySet.h:xi
+ -- ::ParseDES() now setups the gdcmTagKey of the sequence it is parsing.
+ -- now has a new BaseTagKey member.
+ -- STYLE.
+ * src/gdcmValEntry.[h|cxx], src/gdcmBinEntry.[h|cxx]: the member VoidArea,
+ previously a member of gdcmValEntry, moved to gdcmBinEntry were is
+ truly belongs.
+ This poses the problem with the semantics of the following lines
+ LoadEntryVoidArea(0x0028,0x1201); // R LUT
+ LoadEntryVoidArea(0x0028,0x1202); // G LUT
+ LoadEntryVoidArea(0x0028,0x1203); // B LUT
+ in gdcmDocument::gdcmDocument(std::string const & ). Please refer
+ to the long FIXME note for what the problem is. Nevertheless in
+ order to get things working the dicom dictionary was altered !
+ Please fix things urgently...
+ * Dicts/dicomV3.dic WRONGLY altered (this means we introduced a uncorrect
+ information), see above note on moving the member VoidArea. Nevertheless
+ the following entries previously correctly set as US are now inproperly
+ set to OW:
+ 0028 1201 OW IMG Red Palette Color Lookup Table Data
+ 0028 1202 OW IMG Green Palette Color Lookup Table Data
+ 0028 1203 OW IMG Blue Palette Color Lookup Table Data
+ * src/gdcmDocEntry.[h|cxx], src/gdcmSeqEntry.h: SQDepthLevel member
+ of gdcmDocEntry moved to gdcmSeqEntry.
+ * src/gdcmSeqEntry.cxx: STYLE.
+
2004-08-04 Eric Boix <Eric.Boix@creatis.insa-lyon.fr>
* Test/TestAllEntryVerify.cxx minor fix and added comments.
0028 1103 US IMG Blue Palette Color Lookup Table Descriptor
0028 1199 UI IMG Palette Color Lookup Table UID
0028 1200 US IMG Gray Lookup Table Data (RET)
-0028 1201 US IMG Red Palette Color Lookup Table Data
-0028 1202 US IMG Green Palette Color Lookup Table Data
-0028 1203 US IMG Blue Palette Color Lookup Table Data
+0028 1201 OW IMG Red Palette Color Lookup Table Data
+0028 1202 OW IMG Green Palette Color Lookup Table Data
+0028 1203 OW IMG Blue Palette Color Lookup Table Data
0028 1221 OW IMG Segmented Red Palette Color Lookup Table Data
0028 1222 OW IMG Segmented Green Palette Color Lookup Table Data
0028 1223 OW IMG Segmented Blue Palette Color Lookup Table Data
binary IO are available at
http://www.angelfire.com/country/aldev0/cpphowto/cpp_BinaryFileIO.html
-----------------------------------------------------------------------------
+* Clean up src/gdcmValEntry.[h|cxx] from VoidArea
* vtk/vtkGdcmHeader.cxx: if speed becomes a concern some changes can
be made at the cost of memory consumption (refer to header of
vtk/vtkGdcmHeader.cxx)
Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
- Date: $Date: 2004/09/10 14:32:04 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2004/09/13 12:10:53 $
+ Version: $Revision: 1.26 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
gdcmBinEntry::gdcmBinEntry(gdcmDictEntry* e) : gdcmValEntry(e)
{
- VoidArea = NULL;
+ VoidArea = 0;
}
/**
ImplicitVR = e->IsImplicitVR();
Offset = e->GetOffset();
PrintLevel = e->GetPrintLevel();
- SQDepthLevel = e->GetDepthLevel();
+ //FIXME
+ //SQDepthLevel = e->GetDepthLevel();
VoidArea = 0; // let's be carefull !
}
/// \brief Sets the value (non string) of the current Dicom Header Entry
-void gdcmBinEntry::SetVoidArea(void* area)
+void gdcmBinEntry::SetVoidArea( void* area )
{
if (VoidArea)
free(VoidArea);
Program: gdcm
Module: $RCSfile: gdcmBinEntry.h,v $
Language: C++
- Date: $Date: 2004/09/10 14:32:04 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2004/09/13 12:10:53 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// \brief Returns the area value of the current Dicom Header Entry
/// when it's not string-translatable (e.g : a LUT table)
- void* GetVoidArea() { return VoidArea; };
- void SetVoidArea(void* area);
+ void* GetVoidArea() { return VoidArea; }
+ void SetVoidArea( void* area );
protected:
// Variables
/// \brief unsecure memory area to hold 'non string' values
- /// (ie : Lookup Tables, overlays, icons)
- // void *VoidArea;
+ /// (ie : Lookup Tables, overlays, icons)
+ void *VoidArea;
};
Program: gdcm
Module: $RCSfile: gdcmCommon.h,v $
Language: C++
- Date: $Date: 2004/09/09 17:49:24 $
- Version: $Revision: 1.30 $
+ Date: $Date: 2004/09/13 12:10:53 $
+ Version: $Revision: 1.31 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
const std::string GDCM_NOTLOADED = "gdcm::NotLoaded";
const std::string GDCM_UNREAD = "gdcm::UnRead";
+/// \brief gdcmTagKey is made to old an "universal" (as in URL, Universal
+/// Ressource Locator) key to a gdcmDocEntry i.e. a dicom tag.
+/// A dicom tag allways has a group and an element, but a set of tags
+/// embeded in various (optionally nested) sequences and sharing
+/// the same group and element all share the same (group, element)
+/// "identifier". Hence the (group, element) cannot be used as an
+/// identifier (in gdcm we shall refer to a "TagKey") of a tag.
+/// In order to construct a proper tag identifier (i.e. a key) we
+/// consider the following definition of a TagKey:
+/// - let Group, Element be the string representation of the
+/// group and element dicom tag members,
+/// - let ItemNumber be the string representation of the integer
+/// index of the considered item number of a sequence,
+/// Let the key of a tag embeded in a sequence, noted SeqTag, be
+/// the form:
+/// /ItemNumber#Group|Element
+/// where "/", "#" and "|" are characters acting as separators.
+/// Then the general form of a gdcmTagKey is given by:
+/// Group|Element<SeqTag>
+/// where <SeqTag> means NO or many instances of SeqTag.
+/// Hence the gdcmTagKey of a tag not "leaving" in a sequence is the
+/// string e.g.
+/// 0028|1201
+/// but the gdcmTagKey of a tag "embeded" is the first item of
+/// a sequence, itself nested in the third item of a sequence is the
+/// string e.g.
+/// 0004|1220/2#0008|0082/0#0008|0090
typedef std::string gdcmTagKey;
typedef std::string TagName;
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2004/09/09 17:49:24 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2004/09/13 12:10:53 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
ImplicitVR = false;
DictEntry = in;
+ SetKey( in->GetKey( ) );
Offset = 0 ; // To avoid further missprinting
}
std::string d2, vr;
std::ostringstream s;
uint32_t lgth;
- char greltag[10]; //group element tag
g = GetGroup();
e = GetElement();
o = GetOffset();
vr = GetVR();
- sprintf(greltag,"%04x|%04x ",g,e);
- s << greltag ;
+
+ s << GetKey();
if (PrintLevel >= 2)
{
Program: gdcm
Module: $RCSfile: gdcmDocEntry.h,v $
Language: C++
- Date: $Date: 2004/09/03 20:27:44 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2004/09/13 12:10:53 $
+ Version: $Revision: 1.20 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
uint16_t GetElement() { return DictEntry->GetElement();};
/// Returns the 'key' of the current Dicom Header Entry
- std::string GetKey() { return DictEntry->GetKey(); };
+ void SetKey( gdcmTagKey key ) { Key = key; }
+
+ /// Returns the 'key' of the current Dicom Header Entry
+ std::string GetKey() { return Key; }
/// \brief Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom
/// Dictionnary of the current Dicom Header Entry
bool IsItemDelimitor();
bool IsSequenceDelimitor();
- /// \brief Gets the depth level of a Dicom header entry embedded in
- /// a SeQuence
- int GetDepthLevel() { return SQDepthLevel; }
-
- /// \brief Sets the depth level of a Dicom header entry embedded in
- /// a SeQuence
- void SetDepthLevel(int depth) { SQDepthLevel = depth; }
-
private:
// FIXME: In fact we should be more specific and use :
// friend gdcmDocEntry * gdcmHeader::ReadNextElement(void);
/// How many details are to be printed (value : 0,1,2)
int PrintLevel;
-
- /// Gives the depth level of elements inside SeQuences
- int SQDepthLevel;
+
+ /// \brief Generalized key (i.e. a gdcmBaseTagKey prepending a gdcmTagKey)
+ /// of this gdcmDocEntry
+ gdcmTagKey Key;
};
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.h,v $
Language: C++
- Date: $Date: 2004/08/26 15:29:52 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2004/09/13 12:10:53 $
+ Version: $Revision: 1.16 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmException.h"
#include "gdcmDocEntry.h"
+typedef std::string gdcmBaseTagKey;
//-----------------------------------------------------------------------------
class GDCM_EXPORT gdcmDocEntrySet
/// SeQuence
void SetDepthLevel(int depth) { SQDepthLevel = depth; }
+ void SetBaseTagKey( gdcmBaseTagKey key ) { BaseTagKey = key; }
+ gdcmBaseTagKey GetBaseTagKey( ) { return BaseTagKey; }
+
virtual gdcmDocEntry* GetDocEntryByNumber(uint16_t group,
uint16_t element) = 0;
gdcmDocEntry *GetDocEntryByName(std::string const & name);
/// Gives the depth level of the element set inside SeQuences
int SQDepthLevel;
+
+ /// \brief A TagKey of a gdcmDocEntry nested in a sequence is prepended
+ /// with this BaseTagKey.
+ gdcmBaseTagKey BaseTagKey;
private:
};
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/09/13 07:49:36 $
- Version: $Revision: 1.75 $
+ Date: $Date: 2004/09/13 12:10:53 $
+ Version: $Revision: 1.76 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
SQDepthLevel = 0;
- long l = ParseDES( this, beg, lgt, false); // le Load sera fait a la volee
- (void)l; //is l used anywhere ?
+ (void)ParseDES( this, beg, lgt, false); // le Load sera fait a la volee
rewind(Fp);
if( PhotometricInterpretation == "PALETTE COLOR " )
{
LoadEntryVoidArea(0x0028,0x1200); // gray LUT
+ /// FIXME FIXME FIXME
+ /// The tags refered by the three following lines used to be CORRECTLY
+ /// defined as having an US Value Representation in the public
+ /// dictionnary. BUT the semantics implied by the three following
+ /// lines state that the corresponding tag contents are in fact
+ /// the ones of a gdcmBinEntry.
+ /// In order to fix things "Quick and Dirty" the dictionnary was
+ /// altered on PURPOUS but now contains a WRONG value.
+ /// In order to fix things and restore the dictionary to its
+ /// correct value, one needs to decided of the semantics by deciding
+ /// wether the following tags are either:
+ /// - multivaluated US, and hence loaded as gdcmValEntry, but afterwards
+ /// also used as gdcmBinEntry, which requires the proper conversion,
+ /// - OW, and hence loaded as gdcmBinEntry, but afterwards also used
+ /// as gdcmValEntry, which requires the proper conversion.
LoadEntryVoidArea(0x0028,0x1201); // R LUT
LoadEntryVoidArea(0x0028,0x1202); // G LUT
LoadEntryVoidArea(0x0028,0x1203); // B LUT
- LoadEntryVoidArea(0x0028,0x1221); // Segmented Red Palette Color LUT Data
- LoadEntryVoidArea(0x0028,0x1222); // Segmented Green Palette Color LUT Data
- LoadEntryVoidArea(0x0028,0x1223); // Segmented Blue Palette Color LUT Data
+ // Segmented Red Palette Color LUT Data
+ LoadEntryVoidArea(0x0028,0x1221);
+ // Segmented Green Palette Color LUT Data
+ LoadEntryVoidArea(0x0028,0x1222);
+ // Segmented Blue Palette Color LUT Data
+ LoadEntryVoidArea(0x0028,0x1223);
}
//FIXME later : how to use it?
LoadEntryVoidArea(0x0028,0x3006); //LUT Data (CTX dependent)
* @param group group number of the Entry
* @param elem element number of the Entry
*/
-void *gdcmDocument::LoadEntryVoidArea(uint16_t group, uint16_t elem)
+void* gdcmDocument::LoadEntryVoidArea(uint16_t group, uint16_t elem)
{
gdcmDocEntry *docElement = GetDocEntryByNumber(group, elem);
if ( !docElement )
return NULL;
}
/// \TODO Drop any already existing void area! JPR
- SetEntryVoidAreaByNumber(a, group, elem);
+ if( !SetEntryVoidAreaByNumber( a, group, elem ) );
+ {
+ dbg.Verbose(0, "gdcmDocument::LoadEntryVoidArea setting failed.");
+ }
return a;
}
uint16_t group,
uint16_t element)
{
- gdcmTagKey key = gdcmDictEntry::TranslateToKey(group, element);
- if ( !TagHT.count(key))
+ gdcmDocEntry* currentEntry = GetDocEntryByNumber(group, element);
+ if ( !currentEntry )
{
return false;
}
-
- // This was for multimap ?
- (( gdcmBinEntry *)( ((TagHT.equal_range(key)).first)->second ))->SetVoidArea(area);
-
+ if ( gdcmBinEntry* binEntry = dynamic_cast<gdcmBinEntry*>(currentEntry) )
+ {
+ binEntry->SetVoidArea( area );
+ return true;
+ }
return true;
}
bool delim_mode)
{
gdcmDocEntry *newDocEntry = 0;
- gdcmValEntry *newValEntry = 0;
unsigned long l = 0;
int depth = set->GetDepthLevel();
if ( gdcmGlobal::GetVR()->IsVROfGdcmStringRepresentable(vr) )
{
/////// ValEntry
- newValEntry = new gdcmValEntry(newDocEntry->GetDictEntry());
- newValEntry->Copy(newDocEntry);
- newValEntry->SetDepthLevel(depth);
- set->AddEntry(newValEntry);
- LoadDocEntry(newValEntry);
+ gdcmValEntry* newValEntry =
+ new gdcmValEntry( newDocEntry->GetDictEntry() );
+ newValEntry->Copy( newDocEntry );
+ newValEntry->SetKey( set->GetBaseTagKey() + newValEntry->GetKey() );
+ set->AddEntry( newValEntry );
+ LoadDocEntry( newValEntry );
if (newValEntry->IsItemDelimitor())
{
break;
}
////// BinEntry or UNKOWN VR:
- gdcmBinEntry *bn = new gdcmBinEntry(newDocEntry->GetDictEntry());
- bn->Copy(newDocEntry);
- set->AddEntry(bn);
- LoadDocEntry(bn);
+ gdcmBinEntry* newBinEntry =
+ new gdcmBinEntry( newDocEntry->GetDictEntry() );
+ newBinEntry->Copy( newDocEntry );
+ newBinEntry->SetKey( set->GetBaseTagKey() + newBinEntry->GetKey() );
+ set->AddEntry( newBinEntry );
+ LoadDocEntry( newBinEntry );
}
if (newDocEntry->GetGroup() == 0x7fe0 &&
}
}
// no other way to create it ...
- gdcmSeqEntry *sq = new gdcmSeqEntry(newDocEntry->GetDictEntry(),
- set->GetDepthLevel());
- sq->Copy(newDocEntry);
- sq->SetDelimitorMode(delim_mode);
- sq->SetDepthLevel(depth);
+ gdcmSeqEntry* newSeqEntry =
+ new gdcmSeqEntry( newDocEntry->GetDictEntry(),
+ set->GetDepthLevel() );
+ newSeqEntry->Copy( newDocEntry );
+ newSeqEntry->SetDelimitorMode( delim_mode );
+ newSeqEntry->SetDepthLevel( depth );
+ newSeqEntry->SetKey( set->GetBaseTagKey() + newSeqEntry->GetKey() );
if ( l != 0 )
{ // Don't try to parse zero-length sequences
- long lgt = ParseSQ( sq,
- newDocEntry->GetOffset(),
- l, delim_mode);
- (void)lgt; //not used...
+ (void)ParseSQ( newSeqEntry,
+ newDocEntry->GetOffset(),
+ l, delim_mode);
}
- set->AddEntry(sq);
+ set->AddEntry( newSeqEntry );
if ( !delim_mode && (ftell(Fp)-offset) >= l_max)
{
break;
* \brief Parses a Sequence ( SeqEntry after SeqEntry)
* @return parsed length for this level
*/
-long gdcmDocument::ParseSQ(gdcmSeqEntry *set,
- long offset, long l_max, bool delim_mode)
+long gdcmDocument::ParseSQ( gdcmSeqEntry* seqEntry,
+ long offset, long l_max, bool delim_mode)
{
int SQItemNumber = 0;
bool dlm_mod;
- //int depth = set->GetDepthLevel();
- //(void)depth; //not used
while (true)
{
- gdcmDocEntry *newDocEntry = ReadNextDocEntry();
+ gdcmDocEntry* newDocEntry = ReadNextDocEntry();
if ( !newDocEntry )
{
// FIXME Should warn user
{
if ( newDocEntry->IsSequenceDelimitor() )
{
- set->SetSequenceDelimitationItem( newDocEntry );
+ seqEntry->SetSequenceDelimitationItem( newDocEntry );
break;
}
}
break;
}
- gdcmSQItem *itemSQ = new gdcmSQItem(set->GetDepthLevel());
- itemSQ->AddEntry(newDocEntry);
+ gdcmSQItem *itemSQ = new gdcmSQItem( seqEntry->GetDepthLevel() );
+ std::ostringstream newBase;
+ newBase << seqEntry->GetKey()
+ << "/"
+ << SQItemNumber
+ << "#";
+ itemSQ->SetBaseTagKey( newBase.str() );
unsigned int l = newDocEntry->GetReadLength();
if ( l == 0xffffffff )
dlm_mod = false;
}
- int lgr = ParseDES(itemSQ, newDocEntry->GetOffset(), l, dlm_mod);
- (void)lgr; //FIXME not used
+ (void)ParseDES(itemSQ, newDocEntry->GetOffset(), l, dlm_mod);
- set->AddEntry(itemSQ, SQItemNumber);
+ seqEntry->AddEntry( itemSQ, SQItemNumber );
SQItemNumber++;
- if ( !delim_mode && (ftell(Fp)-offset) >= l_max)
+ if ( !delim_mode && ( ftell(Fp) - offset ) >= l_max )
{
break;
}
if ( IsDocEntryAnInteger(entry) )
{
uint32_t NewInt;
- //std::ostringstream s; //shadow previous declaration
int nbInt;
// When short integer(s) are expected, read and convert the following
// n *two characters properly i.e. consider them as short integers as
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.cxx,v $
Language: C++
- Date: $Date: 2004/08/31 14:24:47 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2004/09/13 12:10:53 $
+ Version: $Revision: 1.27 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
gdcmSeqEntry::gdcmSeqEntry(gdcmDictEntry* e, int depth)
: gdcmDocEntry(e)
{
- delimitor_mode = false;
- seq_term = NULL;
- SQDepthLevel = depth;
UsableLength = 0;
ReadLength = 0xffffffff;
+ SQDepthLevel = depth;
+
+ delimitor_mode = false;
+ seq_term = NULL;
}
/**
* @param e Pointer to existing Doc entry
* @param depth depth level of the current Seq entry
*/
-gdcmSeqEntry::gdcmSeqEntry(gdcmDocEntry* e, int depth) : gdcmDocEntry(e->GetDictEntry())
+gdcmSeqEntry::gdcmSeqEntry( gdcmDocEntry* e, int depth )
+ : gdcmDocEntry( e->GetDictEntry() )
{
this->UsableLength = 0;
this->ReadLength = 0xffffffff;
+ SQDepthLevel = depth;
+
this->ImplicitVR = e->IsImplicitVR();
this->Offset = e->GetOffset();
- //this->printLevel = e->GetPrintLevel(); // no longer exists ?!?
- this->SQDepthLevel = depth;
}
+
/**
* \brief Canonical destructor.
*/
delete seq_term;
}
-/*
+/**
* \brief canonical Printer
*/
-void gdcmSeqEntry::Print(std::ostream &os){
-
+void gdcmSeqEntry::Print(std::ostream &os)
+{
// First, Print the Dicom Element itself.
SetPrintLevel(2);
gdcmDocEntry::Print(os);
(*cc)->Write(fp, filetype);
}
- //we force the writting of a Sequence Delimitation item
- // because we wrote the Sequence as a 'no Length' sequence
+ // we force the writting of a Sequence Delimitation item
+ // because we wrote the Sequence as a 'no Length' sequence
fwrite ( &seq_term_gr,(size_t)2 ,(size_t)1 ,fp);
fwrite ( &seq_term_el,(size_t)2 ,(size_t)1 ,fp);
fwrite ( &seq_term_lg,(size_t)4 ,(size_t)1 ,fp);
//-----------------------------------------------------------------------------
// Public
- /// \brief adds the passed ITEM to the ITEM chained List for this SeQuence.
-void gdcmSeqEntry::AddEntry(gdcmSQItem *sqItem, int itemNumber) {
+/// \brief adds the passed ITEM to the ITEM chained List for this SeQuence.
+void gdcmSeqEntry::AddEntry(gdcmSQItem *sqItem, int itemNumber)
+{
sqItem->SetSQItemNumber(itemNumber);
items.push_back(sqItem);
}
-/// \brief Sets the depth level of a Sequence Entry embedded in a SeQuence
-void gdcmSeqEntry::SetDepthLevel(int depth) {
- SQDepthLevel = depth;
-}
-
-/// \brief return a pointer to the SQItem referenced by its ordinal number
-/// (returns the first one if ordinal number is <0
-/// returns the last one if ordinal number is > item number
-
-gdcmSQItem *gdcmSeqEntry::GetSQItemByOrdinalNumber(int nb) {
+/**
+ * \brief return a pointer to the SQItem referenced by its ordinal number.
+ * Returns the first item when argument is negative.
+ * Returns the last item when argument is bigget than the total
+ * item number.
+ */
+gdcmSQItem *gdcmSeqEntry::GetSQItemByOrdinalNumber(int nb)
+{
if (nb<0)
return (*(items.begin()));
int count = 0 ;
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.h,v $
Language: C++
- Date: $Date: 2004/08/26 15:29:53 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2004/09/13 12:10:53 $
+ Version: $Revision: 1.16 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void AddEntry(gdcmSQItem *it, int itemNumber);
gdcmSQItem *GetSQItemByOrdinalNumber(int itemNumber);
- void SetDepthLevel(int depth);
-
+ /// Gets the depth level
+ int GetDepthLevel() { return SQDepthLevel; }
+
+ /// Sets the depth level of a Sequence Entry embedded in a SeQuence
+ void SetDepthLevel(int depth) { SQDepthLevel = depth; }
protected:
private:
/// sequence terminator item
gdcmDocEntry *seq_term;
+
+ /// Gives the depth level of elements inside SeQuences
+ int SQDepthLevel;
};
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2004/09/10 18:54:39 $
- Version: $Revision: 1.24 $
+ Date: $Date: 2004/09/13 12:10:53 $
+ Version: $Revision: 1.25 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
gdcmValEntry::gdcmValEntry(gdcmDictEntry* e) : gdcmDocEntry(e)
{
- VoidArea = NULL; // will be in BinEntry ?
}
/**
* \brief Constructor from a given gdcmDocEntry
* @param e Pointer to existing Doc entry
*/
-gdcmValEntry::gdcmValEntry(gdcmDocEntry* e) : gdcmDocEntry(e->GetDictEntry())
+gdcmValEntry::gdcmValEntry(gdcmDocEntry* e)
+ : gdcmDocEntry(e->GetDictEntry())
{
UsableLength = e->GetLength();
ReadLength = e->GetReadLength();
ImplicitVR = e->IsImplicitVR();
Offset = e->GetOffset();
PrintLevel = e->GetPrintLevel();
- SQDepthLevel = e->GetDepthLevel();
-
- VoidArea = NULL; // will be in BinEntry ?
}
*/
gdcmValEntry::~gdcmValEntry ()
{
- if (!VoidArea) // will be in BinEntry
- {
- free(VoidArea);
- VoidArea = NULL; // let's be carefull !
- }
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmValEntry.h,v $
Language: C++
- Date: $Date: 2004/09/03 20:27:44 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2004/09/13 12:10:53 $
+ Version: $Revision: 1.22 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// Sets the value (string) of the current Dicom Document Entry
void SetValue(std::string const & val) { Value = val; };
- /// Sets the value (void *) of the current Dicom Document Entry
- void SetVoidArea(void * val) { VoidArea = val; };
-
virtual void Print(std::ostream &os = std::cout);
virtual void Write(FILE *fp, FileType filetype);
protected:
- /// \brief for 'non string' values. Will be move to gdcmBinEntry, later
- void* VoidArea; // clean it out later
private:
// Members :