Program: gdcm
Module: $RCSfile: gdcmDataEntry.cxx,v $
Language: C++
- Date: $Date: 2008/02/13 11:44:09 $
- Version: $Revision: 1.52 $
+ Date: $Date: 2008/04/10 12:15:35 $
+ Version: $Revision: 1.54 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include <stdlib.h> // for atof
#include <ctype.h> // for isdigit
#endif
+#include <string.h> // memcpy
+#include <stdlib.h> // atof
// Could be defined like MAX_SIZE_LOAD_ELEMENT_VALUE
#define GDCM_MAX_LENGTH_TO_CONVERT_TO_HEXA 8
NewBinArea();
memcpy(BinArea, value.c_str(), l);
if (l%2) // padded with blank except for UI
- if ( vr == "UI" )
- BinArea[l] = '\0';
- else
- BinArea[l] = ' ';
+ {
+ if ( vr == "UI" )
+ BinArea[l] = '\0';
+ else
+ BinArea[l] = ' ';
+ }
}
State = STATE_LOADED;
}
}
else if( vr == "FL" )
{
- float *data=(float *)BinArea;
+ unsigned char *toto=(unsigned char *)BinArea;
for (unsigned int i=0; i < GetValueCount(); i++)
{
- s2 << std::setw( 4 ) << std::setfill( '0' );
+ s2.str("");
if( i!=0 )
s2 << '\\';
- s2 << data[i];
+ unsigned int a4;
+ for(int iif=0; iif<4; iif++)
+ {
+ a4=toto[iif];
+ s2 << a4;
+ }
}
*StrHexaArea=s2.str();
}
else if( vr == "FD" )
{
- double *data=(double *)BinArea;
+ //double *data=(double *)BinArea;
+ unsigned char *toto=(unsigned char *)BinArea;
for (unsigned int i=0; i < GetValueCount(); i++)
{
- s2 << std::setw( 8 ) << std::setfill( '0' );
- if( i!=0 )
+ s2.str("");
+ if( i!=0 )
s2 << '\\';
- s2 << data[i];
+ //s2 << data[i];
+
+ unsigned int a4;
+ for(int iid=0; iid<8; iid++)
+ {
+ a4=toto[iid];
+ s2 << a4;
+ }
+
}
*StrHexaArea=s2.str();
}