]> Creatis software - gdcm.git/blobdiff - src/gdcmSerieHelper.cxx
COMP: Fix comp on weird os
[gdcm.git] / src / gdcmSerieHelper.cxx
index 06ffc2db18380350e524d34904f262e98c19f5e2..df093b33c7bb4fb917e759b686ad6f64bdd1a136 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSerieHelper.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/26 06:23:37 $
-  Version:   $Revision: 1.31 $
+  Date:      $Date: 2005/11/21 09:46:27 $
+  Version:   $Revision: 1.35 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -213,32 +213,21 @@ void SerieHelper::AddGdcmFile(File *header)
  * directory which would have a particular EchoTime==4.0.
  * This method is a user level, value is not required to be formatted as a DICOM
  * string
- * @param   group  Group number of the target tag.
- * @param   elem Element number of the target tag.
+ * @param   key  Target tag we want restrict on a given value
  * @param value value to be checked to exclude File
  * @param op  operator we want to use to check
  */
-void SerieHelper::AddRestriction(uint16_t group, uint16_t elem
+void SerieHelper::AddRestriction(TagKey const &key
                                  std::string const &value, int op)
 {
    ExRule r;
-   r.group = group;
-   r.elem  = elem;
+   r.group = key[0];
+   r.elem  = key[1];
    r.value = value;
    r.op    = op;
    ExRestrictions.push_back( r ); 
 }
 
-#ifndef GDCM_LEGACY_REMOVE
-void SerieHelper::AddRestriction(TagKey const &key, std::string const &value)
-{
-   Rule r;
-   r.first = key;
-   r.second = value;
-   Restrictions.push_back( r ); 
-}
-#endif
-
 /**
  * \brief Sets the root Directory
  * @param   dir Name of the directory to deal with
@@ -296,10 +285,10 @@ bool SerieHelper::IsCoherent(FileList *fileSet)
 
    FileList::const_iterator it = fileSet->begin();
 
-   int nX = (*it)->GetXSize();
-   int nY = (*it)->GetYSize();
-   int pixelSize = (*it)->GetPixelSize();
-
+   int nX =               (*it)->GetXSize();
+   int nY =               (*it)->GetYSize();
+   int pixelSize =        (*it)->GetPixelSize();
+   bool signedPixelData = (*it)->IsSignedPixelData();
    it ++;
    for ( ;
          it != fileSet->end();
@@ -311,7 +300,9 @@ bool SerieHelper::IsCoherent(FileList *fileSet)
          return false;
       if ( (*it)->GetPixelSize() != pixelSize )
          return false;
-      // probabely more is to be checked (?)
+      if ( (*it)->IsSignedPixelData() != signedPixelData )
+         return false;
+      // probabely more is to be checked (?)      
    }
    return true;
 }
@@ -497,7 +488,8 @@ XCoherentFileSetmap SerieHelper::SplitOnPosition(FileList *fileSet)
         ossPosition << pos[i]; 
       }      
       strPosition = ossPosition.str();
-      
+      ossPosition.str("");
+            
       if ( CoherentFileSet.count(strPosition) == 0 )
       {
          gdcmDebugMacro(" New Position :[" << strPosition << "]");
@@ -560,11 +552,12 @@ XCoherentFileSetmap SerieHelper::SplitOnTagValue(FileList *fileSet,
 //-----------------------------------------------------------------------------
 // Private
 /**
- * \brief sorts the images, according to their Patient Position
+ * \brief sorts the images, according to their Patient Position.
+ *
  *  We may order, considering :
  *   -# Image Position Patient
  *   -# Image Number
- *   -# File Name
+ *   -# file name
  *   -# More to come :-)
  * \note : FileList = std::vector<File* >
  * @param fileList Coherent File list (same Serie UID) to sort