]> Creatis software - gdcm.git/blobdiff - src/gdcmHeader.cxx
* Test/ : rename VTK tests to have a best name for the tests
[gdcm.git] / src / gdcmHeader.cxx
index b5b3b07afc4f050ee386c8d8a574ed27e313d6a6..c26b4bc6a5bf1ae93e62a7f878891e4ce5faa655 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/11 23:06:35 $
-  Version:   $Revision: 1.231 $
+  Date:      $Date: 2005/01/18 16:23:52 $
+  Version:   $Revision: 1.234 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -61,7 +61,7 @@ Header::Header( std::string const &filename ):
    }   
 
    // sometimes Image Location value doesn't follow 
-   // the supposed processor endianity
+   // the supposed processor endianness
    // see gdcmData/cr172241.dcm      
    if ( GrPixel == 0xe07f )
    {
@@ -196,11 +196,12 @@ bool Header::Write(std::string fileName, FileType filetype)
       }
    }
 
+/*
 #ifdef GDCM_WORDS_BIGENDIAN
-   // Super Duper hack that will make gdcm a BOMB ! but should
+   // Super Super hack that will make gdcm a BOMB ! but should
    // Fix temporarily the dashboard
-   BinEntry *b = GetBinEntry(0x7fe0,0x0010);
-   if ( GetEntry(0x0028,0x0100) ==  "16")
+   BinEntry *b = GetBinEntry(GrPixel,NumPixel);
+   if ( GetPixelSize() ==  16 )
    {
       uint16_t *im16 = (uint16_t*)b->GetBinArea();
       int lgr = b->GetLength();
@@ -210,12 +211,14 @@ bool Header::Write(std::string fileName, FileType filetype)
       }
    }
 #endif //GDCM_WORDS_BIGENDIAN
+*/
 
    Document::WriteContent(fp,filetype);
 
+/*
 #ifdef GDCM_WORDS_BIGENDIAN
    // Flip back the pixel ... I told you this is a hack
-   if ( GetEntry(0x0028,0x0100) ==  "16")
+   if ( GetPixelSize() ==  16 )
    {
       uint16_t *im16 = (uint16_t*)b->GetBinArea();
       int lgr = b->GetLength();
@@ -225,6 +228,7 @@ bool Header::Write(std::string fileName, FileType filetype)
       }
    }
 #endif //GDCM_WORDS_BIGENDIAN
+*/
 
    fp->close();
    delete fp;
@@ -800,7 +804,7 @@ ModalityType Header::GetModality()
       else
       {
          /// \todo throw error return value ???
-         /// specified <> unknow in our database
+         /// specified <> unknown in our database
          return Unknow;
       }
    }
@@ -844,7 +848,7 @@ int Header::GetHighBitPosition()
 }
 
 /**
- * \brief   Check wether the pixels are signed or UNsigned data.
+ * \brief   Check whether the pixels are signed or UNsigned data.
  * \warning The method defaults to false (UNsigned) when information is Missing.
  *          The responsability of checking this value is left to the caller.
  * @return  True when signed, false when UNsigned
@@ -902,7 +906,7 @@ int Header::GetSamplesPerPixel()
 }
 
 /**
- * \brief   Check wether this a monochrome picture or not by accessing
+ * \brief   Check whether this a monochrome picture or not by accessing
  *          the "Photometric Interpretation" tag ( 0x0028, 0x0004 ).
  * @return  true when "MONOCHROME1" or "MONOCHROME2". False otherwise.
  */
@@ -922,7 +926,7 @@ bool Header::IsMonochrome()
 }
 
 /**
- * \brief   Check wether this a "PALETTE COLOR" picture or not by accessing
+ * \brief   Check whether this a "PALETTE COLOR" picture or not by accessing
  *          the "Photometric Interpretation" tag ( 0x0028, 0x0004 ).
  * @return  true when "PALETTE COLOR". False otherwise.
  */
@@ -941,7 +945,7 @@ bool Header::IsPaletteColor()
 }
 
 /**
- * \brief   Check wether this a "YBR_FULL" color picture or not by accessing
+ * \brief   Check whether this a "YBR_FULL" color picture or not by accessing
  *          the "Photometric Interpretation" tag ( 0x0028, 0x0004 ).
  * @return  true when "YBR_FULL". False otherwise.
  */
@@ -1028,7 +1032,7 @@ std::string Header::GetPixelType()
    if ( bitsAlloc == GDCM_UNFOUND )
    {
       gdcmVerboseMacro( "Missing  Bits Allocated (0028,0100)");
-      bitsAlloc = "16";
+      bitsAlloc = "16"; // default and arbitrary value, not to polute the output
    }
 
    if ( bitsAlloc == "64" )
@@ -1051,7 +1055,7 @@ std::string Header::GetPixelType()
    if (sign == GDCM_UNFOUND )
    {
       gdcmVerboseMacro( "Missing Pixel Representation (0028,0103)");
-      bitsAlloc = "0";
+      sign = "U"; // default and arbitrary value, not to polute the output
    }
    else if ( sign == "0" )
    {