From 15ae15e0823296963bd3ec948dea87c0551a7a6d Mon Sep 17 00:00:00 2001 From: jpr Date: Mon, 29 Mar 2004 09:51:28 +0000 Subject: [PATCH] Check whether we want ACR or not if moved fro of WriteEntry to WriteEntries, --- src/gdcmDicomDir.cxx | 1 + src/gdcmDicomDir.h | 8 +++++--- src/gdcmDicomDirElement.cxx | 6 +++++- src/gdcmDicomDirElement.h | 4 ++-- src/gdcmParser.cxx | 28 ++++++++++++++++++---------- 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index 48ddeb5c..db6f357f 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -25,6 +25,7 @@ // PS 3.3-2003, pages 731-750 //----------------------------------------------------------------------------- + // Constructor / Destructor /** diff --git a/src/gdcmDicomDir.h b/src/gdcmDicomDir.h index 7f3fb538..d8621641 100644 --- a/src/gdcmDicomDir.h +++ b/src/gdcmDicomDir.h @@ -18,11 +18,13 @@ typedef std::vector ListHeader; typedef GDCM_EXPORT void(gdcmMethod)(void * = NULL); //----------------------------------------------------------------------------- -/* - * \defgroup gdcmDicomDir + +/** + * \ingroup gdcmDicomDir * \brief gdcmDicomDir defines an object representing a DICOMDIR in memory. * */ + class GDCM_EXPORT gdcmDicomDir: public gdcmParser { public: @@ -97,7 +99,7 @@ public: // Write bool Write(std::string fileName); -// Types +/// Types of the gdcmObject within the gdcmDicomDir typedef enum { GDCM_DICOMDIR_NONE, diff --git a/src/gdcmDicomDirElement.cxx b/src/gdcmDicomDirElement.cxx index a8309d84..e9558e9b 100644 --- a/src/gdcmDicomDirElement.cxx +++ b/src/gdcmDicomDirElement.cxx @@ -20,7 +20,11 @@ #endif #define DICT_ELEM "DicomDir.dic" - +/** + * \ingroup gdcmDicomDirElement + * \brief Class for the chained lists from the file 'Dicts/DicomDir.dic' + */ + //----------------------------------------------------------------------------- // Constructor / Destructor diff --git a/src/gdcmDicomDirElement.h b/src/gdcmDicomDirElement.h index 0099c1df..cfbb4c63 100644 --- a/src/gdcmDicomDirElement.h +++ b/src/gdcmDicomDirElement.h @@ -25,8 +25,8 @@ typedef std::list ListDicomDirSerieElem; typedef std::list ListDicomDirImageElem; //----------------------------------------------------------------------------- -/* - * \defgroup gdcmDicomDirElement +/** + * \ingroup gdcmDicomDirElement * \brief gdcmDicomDirElement represents elements contained in a dicom dir * */ diff --git a/src/gdcmParser.cxx b/src/gdcmParser.cxx index 510742a5..8c3ca926 100644 --- a/src/gdcmParser.cxx +++ b/src/gdcmParser.cxx @@ -1020,16 +1020,6 @@ void gdcmParser::WriteEntry(gdcmHeaderEntry *tag, FILE *_fp,FileType type) tag->SetValue(tag->GetValue()+"\0"); tag->SetLength(tag->GetReadLength()+1); } - - if ( type == ACR ) - { - if (gr < 0x0008) return; // ignore pure DICOM V3 groups - if (gr %2) return; // ignore shadow groups - if (vr == "SQ" ) return; // ignore Sequences - // TODO : find a trick to *skip* the SeQuences ! - // Not only ignore the SQ element - if (gr == 0xfffe ) return; // ignore delimiters - } fwrite ( &gr,(size_t)2 ,(size_t)1 ,_fp); //group fwrite ( &el,(size_t)2 ,(size_t)1 ,_fp); //element @@ -1149,6 +1139,15 @@ void gdcmParser::WriteEntries(FILE *_fp,FileType type) tag2 != listEntries.end(); ++tag2) { + if ( type == ACR ){ + if ((*tag2)->GetGroup() < 0x0008) continue; // ignore pure DICOM V3 groups + if ((*tag2)->GetElement() %2) continue; // ignore shadow groups + if ((*tag2)->GetVR() == "SQ" ) continue; // ignore Sequences + // TODO : find a trick to *skip* the SeQuences ! + // Not only ignore the SQ element + // --> will be done with the next organization + if ((*tag2)->GetGroup() == 0xfffe ) continue; // ignore delimiters + } WriteEntry(*tag2,_fp,type); if (itsTimeToWritePixels) break; @@ -1179,6 +1178,15 @@ void gdcmParser::WriteEntriesDeprecated(FILE *_fp,FileType type) { for (TagHeaderEntryHT::iterator tag2=tagHT.begin(); tag2 != tagHT.end(); ++tag2){ + if ( type == ACR ){ + if ((*tag2->second).GetGroup() < 0x0008) continue; // ignore pure DICOM V3 groups + if ((*tag2->second).GetElement() %2) continue; // ignore shadow groups + if ((*tag2->second).GetVR() == "SQ" ) continue; // ignore Sequences + // TODO : find a trick to *skip* the SeQuences ! + // Not only ignore the SQ element + // --> will be done with the next organization + if ((*tag2->second).GetGroup() == 0xfffe ) continue; // ignore delimiters + } WriteEntry(tag2->second,_fp,type); if (itsTimeToWritePixels) break; -- 2.48.1