X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSQItem.cxx;h=073093641b8136986ca139f6472152158983c87b;hb=edfc14dd195f9759cf02da0959d96d1499d572be;hp=329a5a6dd95c0adc1638ef27ae0ea87ed4f873fe;hpb=9649936f884197f6f6260aae051d33729bce07d5;p=gdcm.git diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index 329a5a6d..07309364 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.cxx,v $ Language: C++ - Date: $Date: 2004/10/28 03:10:58 $ - Version: $Revision: 1.33 $ + Date: $Date: 2004/11/25 15:46:11 $ + Version: $Revision: 1.38 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -60,6 +60,7 @@ SQItem::~SQItem() */ void SQItem::Print(std::ostream& os) { + os << "S "; std::ostringstream s; if (SQDepthLevel > 0) @@ -96,22 +97,26 @@ SQItem::~SQItem() * \ingroup SQItem * \brief canonical Writer */ -void SQItem::Write(std::ofstream* fp, FileType filetype) +void SQItem::WriteContent(std::ofstream* fp, FileType filetype) { + int j; uint16_t item[4] = { 0xfffe, 0xe000, 0xffff, 0xffff }; uint16_t itemt[4]= { 0xfffe, 0xe00d, 0xffff, 0xffff }; //we force the writting of an 'Item' Start Element // because we want to write the Item as a 'no Length' item - fp->write((char*)&item[0],8); // fffe e000 ffff ffff + for(j=0;j<4;++j) + { + binary_write( *fp, item[j]); // fffe e000 ffff ffff + } - for (ListDocEntry::iterator i = DocEntries.begin(); - i != DocEntries.end(); - ++i) + for (ListDocEntry::iterator it = DocEntries.begin(); + it != DocEntries.end(); + ++it) { // we skip delimitors (start and end one) because // we force them as 'no length' - if ( (*i)->GetGroup() == 0xfffe ) + if ( (*it)->GetGroup() == 0xfffe ) { continue; } @@ -119,18 +124,21 @@ void SQItem::Write(std::ofstream* fp, FileType filetype) // Fix in order to make some MR PHILIPS images e-film readable // see gdcmData/gdcm-MR-PHILIPS-16-Multi-Seq.dcm: // we just *always* ignore spurious fffe|0000 tag ! - if ( (*i)->GetGroup() == 0xfffe && (*i)->GetElement() == 0x0000 ) + if ( (*it)->GetGroup() == 0xfffe && (*it)->GetElement() == 0x0000 ) { break; // FIXME : continue; ?!? } - (*i)->Write(fp, filetype); + (*it)->WriteContent(fp, filetype); } //we force the writting of an 'Item Delimitation' item // because we wrote the Item as a 'no Length' item - fp->write((char*)&itemt[0],8); // fffe e000 ffff ffff - + for(j=0;j<4;++j) + { + binary_write( *fp, itemt[j]); // fffe e000 ffff ffff + } + } //-----------------------------------------------------------------------------