]> Creatis software - gdcm.git/blobdiff - src/gdcmHeader.cxx
BUG: Try to fix JP patch
[gdcm.git] / src / gdcmHeader.cxx
index 9eadf2c706b8eb4e8710de6255e92516a1f0a4c8..cab302f3e8423f5ca5cdd296225cd9f2d3165958 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/10 17:09:49 $
-  Version:   $Revision: 1.228 $
+  Date:      $Date: 2005/01/14 15:06:37 $
+  Version:   $Revision: 1.232 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -22,6 +22,7 @@
 #include "gdcmDebug.h"
 #include "gdcmTS.h"
 #include "gdcmValEntry.h"
+#include "gdcmBinEntry.h"
 #include <stdio.h> //sscanf
 
 #include <vector>
@@ -194,8 +195,41 @@ bool Header::Write(std::string fileName, FileType filetype)
           RemoveEntryNoDestroy(e);
       }
    }
+
+/*
+#ifdef GDCM_WORDS_BIGENDIAN
+   // Super Super hack that will make gdcm a BOMB ! but should
+   // Fix temporarily the dashboard
+   BinEntry *b = GetBinEntry(GrPixel,NumPixel);
+   if ( GetPixelSize() ==  16 )
+   {
+      uint16_t *im16 = (uint16_t*)b->GetBinArea();
+      int lgr = b->GetLength();
+      for( int i = 0; i < lgr / 2; i++ )
+      {
+         im16[i]= (im16[i] >> 8) | (im16[i] << 8 );
+      }
+   }
+#endif //GDCM_WORDS_BIGENDIAN
+*/
+
    Document::WriteContent(fp,filetype);
 
+/*
+#ifdef GDCM_WORDS_BIGENDIAN
+   // Flip back the pixel ... I told you this is a hack
+   if ( GetPixelSize() ==  16 )
+   {
+      uint16_t *im16 = (uint16_t*)b->GetBinArea();
+      int lgr = b->GetLength();
+      for( int i = 0; i < lgr / 2; i++ )
+      {
+         im16[i]= (im16[i] >> 8) | (im16[i] << 8 );
+      }
+   }
+#endif //GDCM_WORDS_BIGENDIAN
+*/
+
    fp->close();
    delete fp;
 
@@ -1163,39 +1197,6 @@ int Header::GetLUTNbits()
    return lutNbits;
 }
 
-/**
- * \brief Accesses the info from 0002,0010 : Transfert Syntax and TS
- *        else 1.
- * @return The full Transfert Syntax Name (as opposed to Transfert Syntax UID)
- */
-std::string Header::GetTransfertSyntaxName()
-{
-   // use the TS (TS : Transfert Syntax)
-   std::string transfertSyntax = GetEntry(0x0002,0x0010);
-
-   if ( transfertSyntax == GDCM_NOTLOADED )
-   {
-      gdcmVerboseMacro( "Transfert Syntax not loaded. " << std::endl
-               << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE" );
-      return "Uncompressed ACR-NEMA";
-   }
-   if ( transfertSyntax == GDCM_UNFOUND )
-   {
-      gdcmVerboseMacro( "Unfound Transfert Syntax (0002,0010)");
-      return "Uncompressed ACR-NEMA";
-   }
-
-   while ( ! isdigit((unsigned char)transfertSyntax[transfertSyntax.length()-1]) )
-   {
-      transfertSyntax.erase(transfertSyntax.length()-1, 1);
-   }
-   // we do it only when we need it
-   TS* ts         = Global::GetTS();
-   std::string tsName = ts->GetValue( transfertSyntax );
-
-   //delete ts; /// \todo Seg Fault when deleted ?!
-   return tsName;
-}
 
 //-----------------------------------------------------------------------------
 // Protected