X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmUtil.cxx;h=35384b64b2dd1ebbf2ac592d2ebd140fe0200490;hb=4073467af614547a6cdd2b5d09d481fbea1a1f0c;hp=224c9d5d84df101fb044e01bb41a54569d4bbf02;hpb=04e8ab90af5ff69eb35e51d56177a4d4c487e300;p=gdcm.git diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 224c9d5d..35384b64 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmUtil.cxx,v $ Language: C++ - Date: $Date: 2005/08/31 16:24:19 $ - Version: $Revision: 1.162 $ + Date: $Date: 2005/10/24 22:49:57 $ + Version: $Revision: 1.168 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -95,7 +95,13 @@ namespace gdcm //------------------------------------------------------------------------- const std::string Util::GDCM_UID = "1.2.826.0.1.3680043.2.1143"; std::string Util::RootUID = GDCM_UID; -const uint16_t Util::FMIV = 0x0001; +/* + * File Meta Information Version (0002,0001) shall contain a two byte OB + * value consisting of a 0x00 byte, followed by 0x01 byte, and not the + * value 0x0001 encoded as a little endian 16 bit short value, + * which would be the other way around... + */ +const uint16_t Util::FMIV = 0x0100; uint8_t *Util::FileMetaInformationVersion = (uint8_t *)&FMIV; std::string Util::GDCM_MAC_ADRESS = GetMACAddress(); @@ -186,16 +192,16 @@ int Util::CountSubstring (const std::string &str, */ bool Util::IsCleanString(std::string const &s) { - std::cout<< std::endl << s << std::endl; + std::cout<< std::endl << s << std::endl; for(unsigned int i=0; i> 8 ) & 0x00ff ) ); - //save CPU time - swap = ( val << 8 | val >> 8 ); + swap = ( val << 8 | val >> 8 ); return os.write(reinterpret_cast(&swap), 2); #else @@ -959,9 +962,6 @@ std::ostream &binary_write(std::ostream &os, const uint32_t &val) { #if defined(GDCM_WORDS_BIGENDIAN) || defined(GDCM_FORCE_BIGENDIAN_EMULATION) uint32_t swap; -// swap = ( ((val<<24) & 0xff000000) | ((val<<8) & 0x00ff0000) | -// ((val>>8) & 0x0000ff00) | ((val>>24) & 0x000000ff) ); -// save CPU time swap = ( (val<<24) | ((val<<8) & 0x00ff0000) | ((val>>8) & 0x0000ff00) | (val>>24) ); return os.write(reinterpret_cast(&swap), 4);