// gdcmFile.cxx
+//This is needed when compiling in debug mode
+#ifdef _MSC_VER
+// 'type' : forcing value to bool 'true' or 'false' (performance warning)
+//#pragma warning ( disable : 4800 )
+// 'identifier' : class 'type' needs to have dll-interface to be used by
+// clients of class 'type2'
+#pragma warning ( disable : 4251 )
+// 'identifier' : identifier was truncated to 'number' characters in the
+// debug information
+#pragma warning ( disable : 4786 )
+#endif //_MSC_VER
+
#include "gdcmFile.h"
#include "gdcmUtil.h"
#include "iddcmjpeg.h" // for the 'LibIDO' Jpeg LossLess
string str_nb;
str_nb=gdcmHeader::GetPubElValByNumber(0x0028,0x0100);
- if (str_nb == "gdcm::Unfound" ) {
+ if (str_nb == GDCM_UNFOUND ) {
nb = 16;
} else {
nb = atoi(str_nb.c_str() );
int nb;
string str_nb=gdcmHeader::GetPubElValByNumber(0x0028,0x0100);
- if (str_nb == "gdcm::Unfound" ) {
+ if (str_nb == GDCM_UNFOUND ) {
nb = 16;
} else {
nb = atoi(str_nb.c_str() );
int nb;
string str_nb=gdcmHeader::GetPubElValByNumber(0x0028,0x0100);
- if (str_nb == "gdcm::Unfound" ) {
+ if (str_nb == GDCM_UNFOUND ) {
nb = 16;
} else {
nb = atoi(str_nb.c_str() );
// FIXME : will work only when each fragment corresponds to a Frame :-(
- (char *) destination += taille * nBytes; // location in user's memory
+ destination = (char *)destination + taille * nBytes; // location in user's memory
// for next fragment (if any)
// TODO : find a suitable file (multifragment/single Frame Jpeg file) to check
// Nombre de Bits Alloues pour le stockage d'un Pixel
str_nb = GetPubElValByNumber(0x0028,0x0100);
- if (str_nb == "gdcm::Unfound" ) {
+ if (str_nb == GDCM_UNFOUND ) {
nb = 16;
} else {
nb = atoi(str_nb.c_str() );
// Nombre de Bits Utilises
str_nbu=GetPubElValByNumber(0x0028,0x0101);
- if (str_nbu == "gdcm::Unfound" ) {
+ if (str_nbu == GDCM_UNFOUND ) {
nbu = nb;
} else {
nbu = atoi(str_nbu.c_str() );
// Position du Bit de Poids Fort
str_highBit=GetPubElValByNumber(0x0028,0x0102);
- if (str_highBit == "gdcm::Unfound" ) {
+ if (str_highBit == GDCM_UNFOUND ) {
highBit = nb - 1;
} else {
highBit = atoi(str_highBit.c_str() );
// Signe des Pixels
str_signe=GetPubElValByNumber(0x0028,0x0103);
- if (str_signe == "gdcm::Unfound" ) {
+ if (str_signe == GDCM_UNFOUND ) {
signe = 1;
} else {
signe = atoi(str_signe.c_str() );
fwrite("DICM",4,1,fp1);
}
+ // --------------------------------------------------------------
+ // Special Patch to allow gdcm to re-write ACR-LibIDO formated images
+ //
+ // if recognition code tells us we dealt with a LibIDO image
+ // we reproduce on disk the switch between lineNumber and columnNumber
+ // just before writting ...
+
+ std::string rows, columns;
+ if ( filetype == ACR_LIBIDO){
+ rows = GetPubElValByNumber(0x0028, 0x0010);
+ columns = GetPubElValByNumber(0x0028, 0x0011);
+ SetPubElValByNumber(columns, 0x0028, 0x0010);
+ SetPubElValByNumber(rows , 0x0028, 0x0011);
+ }
+ // ----------------- End of Special Patch ----------------
+
gdcmHeader::Write(fp1, type);
+
+ // --------------------------------------------------------------
+ // Special Patch to allow gdcm to re-write ACR-LibIDO formated images
+ //
+ // ...and we restore the Header to be Dicom Compliant again
+ // just after writting
+
+ if (filetype == ACR_LIBIDO){
+ SetPubElValByNumber(rows , 0x0028, 0x0010);
+ SetPubElValByNumber(columns, 0x0028, 0x0011);
+ }
+ // ----------------- End of Special Patch ----------------
+
fwrite(PixelData, lgrTotale, 1, fp1);
fclose (fp1);
return(1);