]> Creatis software - gdcm.git/commitdiff
Check whether we want ACR or not if moved fro of WriteEntry to WriteEntries,
authorjpr <jpr>
Mon, 29 Mar 2004 09:51:28 +0000 (09:51 +0000)
committerjpr <jpr>
Mon, 29 Mar 2004 09:51:28 +0000 (09:51 +0000)
src/gdcmDicomDir.cxx
src/gdcmDicomDir.h
src/gdcmDicomDirElement.cxx
src/gdcmDicomDirElement.h
src/gdcmParser.cxx

index 48ddeb5c3f2085ecbfc59519de98848ec869335f..db6f357fadb67a9e1e560cf8cc3bac36660b70e6 100644 (file)
@@ -25,6 +25,7 @@
 //  PS 3.3-2003, pages 731-750
 //-----------------------------------------------------------------------------
 
+
 // Constructor / Destructor
 
 /**
index 7f3fb538fd985c26a8adf572c511b2b3dd710845..d86216416c595c74eaac45e5846c51469e20db9f 100644 (file)
@@ -18,11 +18,13 @@ typedef std::vector<gdcmHeader *>  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,
index a8309d84a87bb7bcf2b1bde63a90709cdce289b0..e9558e9b0d6447f4760f2c275f086fdb8647c5e9 100644 (file)
 #endif
 #define DICT_ELEM "DicomDir.dic"
 
-
+/**
+ * \ingroup gdcmDicomDirElement
+ * \brief   Class for the chained lists from the file 'Dicts/DicomDir.dic'
+ */
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 
index 0099c1dfcef13d32076b94c8ecd158dc6a49491c..cfbb4c638d0aa0df54af3dd1d08bf42bad4eb8ac 100644 (file)
@@ -25,8 +25,8 @@ typedef std::list<gdcmElement> ListDicomDirSerieElem;
 typedef std::list<gdcmElement> ListDicomDirImageElem;
 
 //-----------------------------------------------------------------------------
-/*
- * \defgroup gdcmDicomDirElement
+/**
+ * \ingroup gdcmDicomDirElement
  * \brief    gdcmDicomDirElement represents elements contained in a dicom dir
  *
  */
index 510742a5687f9505c38f48efb905cab7f51d55ef..8c3ca926c578762074aa707bed9751ebc6c7a8d0 100644 (file)
@@ -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;