IsImplicitVRLittleEndianTransferSyntax() ||
IsExplicitVRLittleEndianTransferSyntax() ||
IsExplicitVRBigEndianTransferSyntax() ||
- IsDeflatedExplicitVRLittleEndianTransferSyntax() ) {
-
+ IsDeflatedExplicitVRLittleEndianTransferSyntax() ) {
+
size_t ItemRead = fread(destination, lgrTotale, 1, fp);
if ( ItemRead != 1 ) {
CloseFile();
}
// Signe des Pixels
+ // 0 = Unsigned
+ // 1 = Signed
str_signe=GetPubElValByNumber(0x0028,0x0103);
if (str_signe == GDCM_UNFOUND ) {
- signe = 1;
+ signe = 0; // default is unsigned
} else {
signe = atoi(str_signe.c_str() );
}
// re arange bytes inside the integer
if (nb != 8)
SwapZone(destination, GetSwapCode(), lgrTotale, nb);
-
+
+ // to avoid pb with some xmedcon breakers images
+ if (nb==16 && nbu<nb && signe==0) {
+ int l = (int)lgrTotale / (nb/8);
+ guint16 *deb = (guint16 *)destination;
+ for(int i = 0; i<l; i++) {
+ if(*deb == 0xffff)
+ *deb=0;
+ deb++;
+ }
+ }
+
// re arange bits inside the bytes
if (nbu != nb){
int l = (int)lgrTotale / (nb/8);
}
}
+
// Just to 'see' was was actually read on disk :-(
// Some troubles expected