diff --git a/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt index 26d2fee0b49..df5b2ec1a9a 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt +++ b/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt @@ -43,7 +43,7 @@ set(GDCM_PACKAGE_CONTACT "GDCM Developers ::iterator it = getInstanceMap().find(id); diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmDirectory.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmDirectory.cxx index db27359e192..045cf2a1ee9 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmDirectory.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmDirectory.cxx @@ -40,7 +40,7 @@ unsigned int Directory::Load(FilenameType const &name, bool recursive) Toplevel = name; return Explore( Toplevel, recursive ); } - return false; + return 0; } unsigned int Directory::Explore(FilenameType const &name, bool recursive) diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmSystem.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmSystem.cxx index 4a07aa8fbcd..a5c1cef9686 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmSystem.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmSystem.cxx @@ -158,8 +158,8 @@ bool System::MakeDirectory(const char *path) bool ok = true; while(ok && (pos = dir.find('/', pos)) != std::string::npos) { - topdir = dir.substr(0, pos); - ok = ok && Mkdir(topdir.c_str()); + topdir = dir.substr(0, pos+1); + ok = ok && (System::FileIsDirectory(topdir.c_str()) || 0 == Mkdir(topdir.c_str())); pos++; } if( !ok ) return false; diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmTerminal.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmTerminal.cxx index 8a8b8ca286d..700346ae123 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmTerminal.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmTerminal.cxx @@ -17,7 +17,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include /* SetConsoleTextAttribute */ #endif @@ -40,7 +40,7 @@ class ConsoleImp { private: // console implementation details: -#ifdef WIN32 +#ifdef _WIN32 HANDLE hConsoleHandle; CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo; WORD wNormalAttributes; @@ -52,7 +52,7 @@ class ConsoleImp public: ConsoleImp() { -#ifdef WIN32 +#ifdef _WIN32 hConsoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hConsoleHandle, &ConsoleInfo); wNormalAttributes = ConsoleInfo.wAttributes; @@ -61,7 +61,7 @@ class ConsoleImp } ~ConsoleImp() { -#ifdef WIN32 +#ifdef _WIN32 SetConsoleTextAttribute(hConsoleHandle, wNormalAttributes); } WORD get_attributes() { @@ -85,7 +85,7 @@ class ConsoleImp return command; } void set_attributes(int color) { -#ifdef WIN32 +#ifdef _WIN32 static const int colors[8] = { 0, 4, 2, 6, 1, 5, 3, 7 }; WORD wAttributes; @@ -154,7 +154,7 @@ class ConsoleImp SetConsoleTextAttribute(hConsoleHandle, wAttributes); #else (void)color; -#endif //WIN32 +#endif //_WIN32 } }; diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmWin32.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmWin32.h index 022a8233ee4..12f51056751 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmWin32.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmWin32.h @@ -20,7 +20,7 @@ #endif //----------------------------------------------------------------------------- // http://gcc.gnu.org/wiki/Visibility -#if defined(WIN32) && defined(GDCM_BUILD_SHARED_LIBS) +#if defined(_WIN32) && defined(GDCM_BUILD_SHARED_LIBS) #if (defined(gdcmCommon_EXPORTS) || defined(gdcmDICT_EXPORTS) || defined(gdcmDSED_EXPORTS) || defined(gdcmIOD_EXPORTS) || defined(gdcmMSFF_EXPORTS) || defined(gdcmMEXD_EXPORTS)|| defined(_gdcmswig_EXPORTS)) || defined(vtkgdcm_EXPORTS) #define GDCM_EXPORT __declspec( dllexport ) #else diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/zipstreamimpl.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/zipstreamimpl.h index 59858b94953..49f77a29ee4 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/zipstreamimpl.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/Common/zipstreamimpl.h @@ -64,7 +64,7 @@ zran.c #include -#ifdef WIN32 /* Window 95 & Windows NT */ +#ifdef _WIN32 /* Window 95 & Windows NT */ # define OS_CODE 0x0b #endif #if defined(MACOS) || defined(TARGET_OS_MAC) diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary/gdcmDefaultDicts.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary/gdcmDefaultDicts.cxx index fd9653ba9c3..20f109c8e3d 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary/gdcmDefaultDicts.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary/gdcmDefaultDicts.cxx @@ -24,7 +24,8 @@ #include "gdcmDict.h" #include "gdcmDictEntry.h" -namespace gdcm { +namespace { +using namespace gdcm; typedef struct { uint16_t group; @@ -13275,6 +13276,9 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0xffff,0xffff,VR::INVALID,VM::VM0,"","",true }, // dummy {0xffff,0xffff,VR::INVALID,VM::VM0,0,0,true } // Gard }; +} // end anonymous namespace + +namespace gdcm { void Dict::LoadDefault() { diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx index 6813eed7277..8019af98feb 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx @@ -24,7 +24,8 @@ #include "gdcmDict.h" #include "gdcmDictEntry.h" -namespace gdcm { +namespace { +using namespace gdcm; typedef struct { uint16_t group; @@ -161,7 +162,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x7501,0x0002,"CoActiv_PvtTags",VR::LO,VM::VM1,"?IP Address?",false }, {0x7501,0x0003,"CoActiv_PvtTags",VR::UI,VM::VM1,"?Transfer Syntax UID?",false }, {0x7501,0x0004,"CoActiv_PvtTags",VR::LO,VM::VM1,"?Transfer Syntax Name?",false }, - {0x0009,0x0002,"PMTF INFORMATION DATA^10",VR::SH,VM::VM1,"?",false }, + {0x0009,0x0002,"PMTF INFORMATION DATA^10",VR::SH,VM::VM1,"Device Serial Number",false }, {0x0011,0x0003,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, {0x0011,0x0004,"PMTF INFORMATION DATA^10",VR::SQ,VM::VM1,"?",false }, {0x0011,0x0005,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, @@ -181,7 +182,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x0004,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x0004,"PMTF INFORMATION DATA^12",VR::SL,VM::VM1,"?",false }, {0x0019,0x0005,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, - {0x0019,0x0005,"PMTF INFORMATION DATA^12",VR::SH,VM::VM1,"?",false }, + {0x0019,0x0005,"PMTF INFORMATION DATA^12",VR::SH,VM::VM1,"?Sequence Variant?",false }, {0x0019,0x0006,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x0006,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, {0x0019,0x0007,"PMTF INFORMATION DATA^10",VR::FL,VM::VM3,"?",false }, @@ -225,6 +226,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x0019,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x0019,"PMTF INFORMATION DATA^11",VR::SQ,VM::VM1,"?",false }, {0x0019,0x001a,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, + {0x0019,0x001a,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, {0x0019,0x001b,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x001c,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x001d,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, @@ -238,9 +240,9 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x0028,"PMTF INFORMATION DATA^12",VR::DS,VM::VM1,"?",false }, {0x0019,0x0029,"PMTF INFORMATION DATA^10",VR::SH,VM::VM1,"?",false }, {0x0019,0x0029,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, - {0x0019,0x002a,"PMTF INFORMATION DATA^10",VR::DS,VM::VM3,"?",false }, /* may re-use ^12 in actual dataset, hard to handle */ + {0x0019,0x002a,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, /* may re-use ^12 in actual dataset, hard to handle */ {0x0019,0x002a,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, - {0x0019,0x002a,"PMTF INFORMATION DATA^12",VR::TM,VM::VM1,"?",false }, + {0x0019,0x002a,"PMTF INFORMATION DATA^12",VR::DS /* TM*/,VM::VM3 /* 1 */,"?",false }, /* dual TM,1 or DS,3 !!! */ {0x0019,0x002b,"PMTF INFORMATION DATA^10",VR::SH,VM::VM1,"?",false }, {0x0019,0x002b,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, {0x0019,0x002b,"PMTF INFORMATION DATA^12",VR::SQ,VM::VM1,"?",false }, @@ -257,7 +259,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x0031,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x0032,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, {0x0019,0x0032,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, - {0x0019,0x0032,"PMTF INFORMATION DATA^12",VR::SH,VM::VM1,"?",false }, + {0x0019,0x0032,"PMTF INFORMATION DATA^12",VR::SH,VM::VM1,"Sequence Name",false }, {0x0019,0x0033,"PMTF INFORMATION DATA^10",VR::SL,VM::VM3,"?",false }, {0x0019,0x0034,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x0034,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, @@ -276,6 +278,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x003c,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x003c,"PMTF INFORMATION DATA^11",VR::FL,VM::VM3,"?",false }, {0x0019,0x003d,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, + {0x0019,0x003d,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x003e,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x003e,"PMTF INFORMATION DATA^11",VR::FL,VM::VM9,"?",false }, {0x0019,0x003f,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, @@ -300,7 +303,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x004c,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, {0x0019,0x004c,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x004d,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, - {0x0019,0x004d,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, + {0x0019,0x004d,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?postproc series?",false }, {0x0019,0x004e,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, {0x0019,0x004e,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x004f,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, @@ -310,6 +313,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x0054,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, {0x0019,0x0055,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, {0x0019,0x0055,"PMTF INFORMATION DATA^11",VR::LO,VM::VM1,"?",false }, + {0x0019,0x0056,"PMTF INFORMATION DATA^10",VR::FL,VM::VM3,"?",false }, {0x0019,0x0057,"PMTF INFORMATION DATA^10",VR::FL,VM::VM3,"?",false }, {0x0019,0x0057,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, {0x0019,0x0058,"PMTF INFORMATION DATA^10",VR::FL,VM::VM3,"?",false }, @@ -330,6 +334,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x0063,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x0064,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, {0x0019,0x0065,"PMTF INFORMATION DATA^10",VR::SL,VM::VM2,"?",false }, + {0x0019,0x0065,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x0067,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, {0x0019,0x0068,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x0069,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, @@ -339,12 +344,12 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x006d,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x006d,"PMTF INFORMATION DATA^11",VR::SH,VM::VM1,"?",false }, {0x0019,0x006e,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, - {0x0019,0x006e,"PMTF INFORMATION DATA^11",VR::SH,VM::VM1,"?",false }, + {0x0019,0x006e,"PMTF INFORMATION DATA^11",VR::SH,VM::VM1,"Sequence Name",false }, {0x0019,0x006f,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x006f,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, {0x0019,0x0070,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?",false }, - {0x0019,0x0071,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?",false }, - {0x0019,0x0073,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?",false }, + {0x0019,0x0071,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?Sequence Options?",false }, + {0x0019,0x0073,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?Sequence Options?",false }, {0x0019,0x0075,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?",false }, {0x0019,0x0076,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?",false }, {0x0019,0x0076,"PMTF INFORMATION DATA^12",VR::OB,VM::VM1,"?",false }, @@ -362,7 +367,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x007f,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x007f,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x0080,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, - {0x0019,0x0080,"PMTF INFORMATION DATA^12",VR::FD,VM::VM1,"?",false }, + {0x0019,0x0080,"PMTF INFORMATION DATA^12",VR::FD,VM::VM1,"Acquisition Duration",false }, {0x0019,0x0084,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x0085,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, {0x0019,0x0085,"PMTF INFORMATION DATA^12",VR::US,VM::VM1,"?",false }, @@ -371,12 +376,12 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x0087,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, {0x0019,0x0087,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x0087,"PMTF INFORMATION DATA^12",VR::SQ,VM::VM1,"?",false }, - {0x0019,0x0088,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?",false }, - {0x0019,0x0088,"PMTF INFORMATION DATA^12",VR::US,VM::VM1,"?num?",false }, + {0x0019,0x0088,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?RxGain?",false }, + {0x0019,0x0088,"PMTF INFORMATION DATA^12",VR::US,VM::VM1,"Series Number Global",false }, {0x0019,0x0089,"PMTF INFORMATION DATA^12",VR::SL,VM::VM1,"?",false }, {0x0019,0x008a,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1_n,"?",false }, {0x0019,0x008a,"PMTF INFORMATION DATA^11",VR::US,VM::VM1,"?",false }, - {0x0019,0x008a,"PMTF INFORMATION DATA^12",VR::US,VM::VM1,"?",false }, + {0x0019,0x008a,"PMTF INFORMATION DATA^12",VR::US,VM::VM1,"Series Number Global",false }, {0x0019,0x008b,"PMTF INFORMATION DATA^12",VR::US,VM::VM1,"?",false }, {0x0019,0x008c,"PMTF INFORMATION DATA^10",VR::UL,VM::VM1,"?",false }, {0x0019,0x008d,"PMTF INFORMATION DATA^10",VR::TM,VM::VM1,"?",false }, @@ -390,15 +395,17 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x0093,"PMTF INFORMATION DATA^10",VR::FL,VM::VM3,"?",false }, {0x0019,0x0093,"PMTF INFORMATION DATA^12",VR::SL,VM::VM1,"?num?",false }, {0x0019,0x0094,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, - {0x0019,0x0094,"PMTF INFORMATION DATA^12",VR::UI,VM::VM1,"?",false }, + {0x0019,0x0094,"PMTF INFORMATION DATA^12",VR::UI,VM::VM1,"Referenced SOP Instance UID",false }, {0x0019,0x0095,"PMTF INFORMATION DATA^12",VR::UI,VM::VM1,"?",false }, {0x0019,0x0096,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, + {0x0019,0x0096,"PMTF INFORMATION DATA^12",VR::LO,VM::VM1,"?PASTA?",false }, {0x0019,0x0098,"PMTF INFORMATION DATA^12",VR::FL,VM::VM3,"?",false }, - {0x0019,0x0099,"PMTF INFORMATION DATA^12",VR::LO,VM::VM1,"?SE_EPI82+0.8?",false }, + {0x0019,0x0099,"PMTF INFORMATION DATA^12",VR::LO,VM::VM1,"Sequence Name",false }, {0x0019,0x009a,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, - {0x0019,0x009a,"PMTF INFORMATION DATA^12",VR::DS,VM::VM1,"?num?",false }, + {0x0019,0x009a,"PMTF INFORMATION DATA^12",VR::DS,VM::VM1,"Series Number Local",false }, {0x0019,0x009b,"PMTF INFORMATION DATA^10",VR::FL,VM::VM3,"?",false }, {0x0019,0x009b,"PMTF INFORMATION DATA^11",VR::US,VM::VM1,"?",false }, + {0x0019,0x009b,"PMTF INFORMATION DATA^12",VR::DS,VM::VM1,"?",false }, {0x0019,0x009c,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x009c,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, {0x0019,0x009c,"PMTF INFORMATION DATA^12",VR::DS,VM::VM1,"?num?",false }, @@ -411,6 +418,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x00a0,"PMTF INFORMATION DATA^10",VR::SL,VM::VM4,"?",false }, {0x0019,0x00a0,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, {0x0019,0x00a1,"PMTF INFORMATION DATA^10",VR::DS,VM::VM1,"?",false }, + {0x0019,0x00a1,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x00a1,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, {0x0019,0x00a2,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x00a2,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, @@ -423,12 +431,13 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x00a5,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, {0x0019,0x00a6,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x00a6,"PMTF INFORMATION DATA^11",VR::US,VM::VM1,"?",false }, - {0x0019,0x00a6,"PMTF INFORMATION DATA^12",VR::FL,VM::VM8,"?",false }, + {0x0019,0x00a6,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1_n,"?",false }, {0x0019,0x00a7,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, {0x0019,0x00a8,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, {0x0019,0x00a8,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x00a8,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, {0x0019,0x00a9,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, + {0x0019,0x00a9,"PMTF INFORMATION DATA^12",VR::FL,VM::VM3,"?",false }, {0x0019,0x00aa,"PMTF INFORMATION DATA^12",VR::FL,VM::VM3,"?",false }, {0x0019,0x00ab,"PMTF INFORMATION DATA^10",VR::FL,VM::VM3,"?",false }, {0x0019,0x00ab,"PMTF INFORMATION DATA^12",VR::FL,VM::VM3,"?",false }, @@ -446,10 +455,11 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x00b1,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x00b2,"PMTF INFORMATION DATA^11",VR::US,VM::VM1,"?",false }, {0x0019,0x00b3,"PMTF INFORMATION DATA^11",VR::US,VM::VM1,"?",false }, - {0x0019,0x00b3,"PMTF INFORMATION DATA^12",VR::FD,VM::VM1,"?num?",false }, + {0x0019,0x00b3,"PMTF INFORMATION DATA^12",VR::FD,VM::VM1,"Acquisition Duration",false }, {0x0019,0x00b4,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x00b4,"PMTF INFORMATION DATA^11",VR::US,VM::VM1,"?",false }, {0x0019,0x00b4,"PMTF INFORMATION DATA^12",VR::LO,VM::VM1,"?",false }, + {0x0019,0x00b5,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x00b5,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, {0x0019,0x00b6,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x00b6,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, @@ -460,7 +470,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x00bb,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, {0x0019,0x00bc,"PMTF INFORMATION DATA^10",VR::FL,VM::VM2,"?",false }, {0x0019,0x00bd,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, - {0x0019,0x00be,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, + {0x0019,0x00be,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"Acquisition Duration",false }, {0x0019,0x00c0,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x00c1,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x00c1,"PMTF INFORMATION DATA^11",VR::US,VM::VM1,"?",false }, @@ -475,13 +485,14 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x00c6,"PMTF INFORMATION DATA^12",VR::SL,VM::VM1,"?",false }, {0x0019,0x00c7,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, {0x0019,0x00c9,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, - {0x0019,0x00ca,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?",false }, + {0x0019,0x00ca,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"Sequence Name",false }, {0x0019,0x00cb,"PMTF INFORMATION DATA^10",VR::UL,VM::VM1,"?",false }, {0x0019,0x00cc,"PMTF INFORMATION DATA^10",VR::UL,VM::VM1,"?",false }, {0x0019,0x00cc,"PMTF INFORMATION DATA^12",VR::SS,VM::VM1,"?",false }, {0x0019,0x00cd,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x00cd,"PMTF INFORMATION DATA^12",VR::LO,VM::VM1,"?",false }, {0x0019,0x00ce,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, + {0x0019,0x00cf,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?acquired series (vs postproc)?",false }, {0x0019,0x00cf,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, {0x0019,0x00d0,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, {0x0019,0x00d1,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, @@ -495,8 +506,8 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x00d5,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, {0x0019,0x00d6,"PMTF INFORMATION DATA^12",VR::FL,VM::VM3,"?",false }, {0x0019,0x00d7,"PMTF INFORMATION DATA^12",VR::US,VM::VM2,"?vect2?",false }, - {0x0019,0x00d8,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, - {0x0019,0x00d8,"PMTF INFORMATION DATA^12",VR::FL,VM::VM5,"?",false }, + {0x0019,0x00d8,"PMTF INFORMATION DATA^10",VR::US,VM::VM1_n,"?",false }, + {0x0019,0x00d8,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1_n,"?",false }, {0x0019,0x00d9,"PMTF INFORMATION DATA^10",VR::SQ,VM::VM1,"?",false }, {0x0019,0x00da,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, {0x0019,0x00db,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, @@ -526,10 +537,11 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x00ec,"PMTF INFORMATION DATA^12",VR::US,VM::VM1,"?num?",false }, {0x0019,0x00ee,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, {0x0019,0x00ef,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, + {0x0019,0x00ef,"PMTF INFORMATION DATA^12",VR::DS,VM::VM1,"?",false }, {0x0019,0x00f0,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x00f0,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1_n,"?",false }, {0x0019,0x00f1,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, - {0x0019,0x00f1,"PMTF INFORMATION DATA^11",VR::SL,VM::VM3,"?vect3?",false }, + {0x0019,0x00f1,"PMTF INFORMATION DATA^11",VR::SL,VM::VM3,"Diffusion b-value x Toshiba Orientation",false }, {0x0019,0x00f2,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, {0x0019,0x00f2,"PMTF INFORMATION DATA^11",VR::FL,VM::VM3,"?",false }, {0x0019,0x00f3,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, @@ -560,50 +572,50 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0021,0x0002,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?num?",false }, {0x0021,0x0003,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?num?",false }, {0x0021,0x0004,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?num?",false }, - {0x0021,0x0008,"PMTF INFORMATION DATA^10",VR::DS,VM::VM3,"?dti vect1?",false }, - {0x0021,0x0009,"PMTF INFORMATION DATA^10",VR::DS,VM::VM3,"?dti vect2?",false }, - {0x0021,0x000a,"PMTF INFORMATION DATA^10",VR::DS,VM::VM3,"?dti vect3?",false }, + {0x0021,0x0008,"PMTF INFORMATION DATA^10",VR::DS,VM::VM3,"?vect1?",false }, + {0x0021,0x0009,"PMTF INFORMATION DATA^10",VR::DS,VM::VM3,"?vect2?",false }, + {0x0021,0x000a,"PMTF INFORMATION DATA^10",VR::DS,VM::VM3,"?vect3?",false }, {0x0021,0x000b,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, {0x0021,0x000c,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, {0x0021,0x000d,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, {0x0021,0x000f,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, - {0x0021,0x0012,"PMTF INFORMATION DATA^10",VR::DS,VM::VM3,"?dti vect4?",false }, - {0x0021,0x0014,"PMTF INFORMATION DATA^10",VR::SQ,VM::VM1,"?actual toshiba dti matrix?",false }, + {0x0021,0x0012,"PMTF INFORMATION DATA^10",VR::DS,VM::VM3,"?vect4?",false }, + {0x0021,0x0014,"PMTF INFORMATION DATA^10",VR::SQ,VM::VM1,"?matrix?",false }, {0x0021,0x0015,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, {0x0021,0x0016,"PMTF INFORMATION DATA^10",VR::FL,VM::VM2,"?",false }, - {0x0021,0x0018,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?dti num1?",false }, - {0x0021,0x001a,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?dti num2?",false }, - {0x0021,0x001d,"PMTF INFORMATION DATA^10",VR::IS,VM::VM1,"?dti num3?",false }, + {0x0021,0x0018,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"Series Number Local",false }, + {0x0021,0x001a,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?num2?",false }, + {0x0021,0x001d,"PMTF INFORMATION DATA^10",VR::IS,VM::VM1,"?num3?",false }, {0x0021,0x001f,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?num?",false }, - {0x0029,0x0001,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?always empty?",false }, + {0x0029,0x0001,"PMTF INFORMATION DATA^10",VR::SL,VM::VM3,"Diffusion Gradient Orientation / Toshiba Orientation ",false }, {0x0029,0x0005,"PMTF INFORMATION DATA^10",VR::SQ,VM::VM1,"?seq?",false }, {0x0029,0x0006,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?num?",false }, {0x0029,0x0007,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?num?",false }, {0x0029,0x001c,"PMTF INFORMATION DATA^10",VR::FL,VM::VM2,"?vect2?",false }, {0x0029,0x0021,"PMTF INFORMATION DATA^10",VR::SL,VM::VM3,"?vect3?",false }, {0x0029,0x004e,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?num?",false }, - {0x0029,0x0050,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?",false }, + {0x0029,0x0050,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?root filepath?",false }, {0x0029,0x0051,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?series filepath?",false }, {0x0029,0x0052,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?instance filepath?",false }, {0x0029,0x0054,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?study filepath?",false }, - {0x0029,0x0067,"PMTF INFORMATION DATA^10",VR::FD,VM::VM4,"?",false }, + {0x0029,0x0067,"PMTF INFORMATION DATA^10",VR::FD,VM::VM4,"Series Diffusion Info (b-value,x,y,z)",false }, {0x0029,0x0068,"PMTF INFORMATION DATA^10",VR::SS,VM::VM1,"?num 1?",false }, //{0x0029,0x0089,"PMTF INFORMATION DATA",VR::LO,VM::VM1,"?",false }, /* defined below */ {0xe201,0x0002,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?",false }, - {0xe301,0x0000,"PMTF INFORMATION DATA^10",VR::SH,VM::VM1,"?",false }, + {0xe301,0x0000,"PMTF INFORMATION DATA^10",VR::SH,VM::VM1,"Series Description",false }, {0xe401,0x0000,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?num?",false }, {0xe401,0x0001,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?num?",false }, {0xe401,0x0002,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?num?",false }, {0xe401,0x0003,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?num?",false }, {0xe401,0x0004,"PMTF INFORMATION DATA^10",VR::US,VM::VM1,"?num?",false }, {0xe401,0x0005,"PMTF INFORMATION DATA^10",VR::OB,VM::VM1,"?blob?",false }, - {0xe401,0x0008,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?num?",false }, + {0xe401,0x0008,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?ADC factor?",false }, {0xe401,0x0012,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?num?",false }, - {0xe401,0x0013,"PMTF INFORMATION DATA^10",VR::OB,VM::VM1,"?blob?",false }, + {0xe401,0x0013,"PMTF INFORMATION DATA^10",VR::OB,VM::VM1,"Icon DIB (Microsoft Windows 3.X Packed Device-Independent Bitmap)",false }, {0xe401,0x0020,"PMTF INFORMATION DATA^10",VR::SQ,VM::VM1,"?seq?",false }, {0xe401,0x0021,"PMTF INFORMATION DATA^10",VR::SQ,VM::VM1,"?seq?",false }, {0xe401,0x0022,"PMTF INFORMATION DATA^10",VR::LO,VM::VM1,"?MR.gdc?",false }, - {0xe401,0x0023,"PMTF INFORMATION DATA^10",VR::SH,VM::VM1,"?V2.30*R005?",false }, + {0xe401,0x0023,"PMTF INFORMATION DATA^10",VR::SH,VM::VM1,"Software Version(s)",false }, {0xe401,0x0024,"PMTF INFORMATION DATA^10",VR::OB,VM::VM1,"?blob?",false }, {0xe403,0x0000,"PMTF INFORMATION DATA^10",VR::SQ,VM::VM1,"?seq?",false }, {0xe403,0x0000,"PMTF INFORMATION DATA^13",VR::SH,VM::VM1,"?VIEW?",false }, @@ -4591,12 +4603,15 @@ static const DICT_ENTRY DICOMV3DataDict [] = { /* {0x0029,0x0010,"MITRA PRESENTATION 1.0",VR::US,VM::VM1,"?",false },*/ {0x0009,0x0048,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0009,0x004e,"MMCPrivate",VR::LO,VM::VM1,"?",false }, + {0x0009,0x004f,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0011,0x0001,"MMCPrivate",VR::LO,VM::VM1,"?",false }, + {0x0011,0x0002,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0019,0x0001,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0019,0x0002,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0019,0x0003,"MMCPrivate",VR::SH,VM::VM1,"?",false }, {0x0019,0x0004,"MMCPrivate",VR::DS,VM::VM1,"?",false }, {0x0019,0x0005,"MMCPrivate",VR::LO,VM::VM1,"?",false }, + {0x0019,0x0007,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0019,0x0008,"MMCPrivate",VR::DS,VM::VM1,"?",false }, {0x0019,0x0009,"MMCPrivate",VR::DS,VM::VM1,"?",false }, {0x0019,0x000a,"MMCPrivate",VR::LO,VM::VM1,"?",false }, @@ -4604,6 +4619,12 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0019,0x000c,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0019,0x000f,"MMCPrivate",VR::IS,VM::VM1,"?",false }, {0x0019,0x0010,"MMCPrivate",VR::LO,VM::VM1,"?",false }, + {0x0019,0x0011,"MMCPrivate",VR::LO,VM::VM1,"?",false }, + {0x0019,0x001a,"MMCPrivate",VR::UI,VM::VM1,"?",false }, + {0x0019,0x001b,"MMCPrivate",VR::IS,VM::VM1,"?",false }, + {0x0019,0x001c,"MMCPrivate",VR::LO,VM::VM1,"?",false }, + {0x0019,0x001d,"MMCPrivate",VR::LO,VM::VM1,"?",false }, + {0x0019,0x001e,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0029,0x0001,"MMCPrivate",VR::IS,VM::VM1,"?",false }, {0x0029,0x0002,"MMCPrivate",VR::IS,VM::VM1,"?",false }, {0x0029,0x0005,"MMCPrivate",VR::LO,VM::VM1,"?",false }, @@ -4620,7 +4641,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0029,0x0011,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0029,0x0012,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0029,0x0013,"MMCPrivate",VR::LO,VM::VM1,"?",false }, - {0x0029,0x0014,"MMCPrivate",VR::LO,VM::VM1,"?",false }, + {0x0029,0x0014,"MMCPrivate",VR::LO,VM::VM1,"?MTR True/False?",false }, {0x0029,0x0015,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0029,0x0016,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0029,0x0017,"MMCPrivate",VR::LO,VM::VM1,"?",false }, @@ -4641,7 +4662,71 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0x0029,0x002c,"MMCPrivate",VR::DS,VM::VM1,"?",false }, {0x0029,0x002d,"MMCPrivate",VR::DS,VM::VM1,"?",false }, {0x0029,0x002e,"MMCPrivate",VR::DS,VM::VM1,"?",false }, - {0x0029,0x002f,"MMCPrivate",VR::OB,VM::VM1,"?",false }, + {0x0029,0x002f,"MMCPrivate",VR::OB_OW,VM::VM1,"?HitachiMedical.Dream.Cabinet.ApplicationObjects.ImageAppData?",false }, + {0x0029,0x0031,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0032,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0050,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0055,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0056,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x0057,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x005c,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x005d,"MMCPrivate",VR::LO,VM::VM1,"?",false }, + {0x0029,0x005e,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x005f,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x0060,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0063,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0065,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x0066,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x0068,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x006a,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x006b,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x0070,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0073,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x0082,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0083,"MMCPrivate",VR::US,VM::VM1,"?",false }, + {0x0029,0x0084,"MMCPrivate",VR::US,VM::VM1,"?",false }, + {0x0029,0x0086,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x0087,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0088,"MMCPrivate",VR::US,VM::VM1,"?",false }, + {0x0029,0x0089,"MMCPrivate",VR::US,VM::VM1,"?",false }, + {0x0029,0x008a,"MMCPrivate",VR::US,VM::VM1,"?",false }, + {0x0029,0x008b,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x008f,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0090,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x0091,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0093,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0098,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x0099,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x009a,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x009b,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x009c,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x009d,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x009e,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x009f,"MMCPrivate",VR::SS,VM::VM1,"?",false }, + {0x0029,0x00a0,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x00a1,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x00a3,"MMCPrivate",VR::DS,VM::VM1,"?",false }, + {0x0029,0x00a4,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x00a6,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x00a7,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x00a8,"MMCPrivate",VR::SQ,VM::VM1,"?",false }, + {0x0029,0x003c,"MMCPrivate",VR::UL,VM::VM1,"?",false }, + {0x0029,0x003d,"MMCPrivate",VR::US,VM::VM1,"?",false }, + {0x0029,0x003f,"MMCPrivate",VR::US,VM::VM1,"?",false }, + {0x0029,0x0042,"MMCPrivate",VR::FD,VM::VM1,"?",false }, + {0x0029,0x0044,"MMCPrivate",VR::IS,VM::VM1,"?",false }, + {0x0029,0x0045,"MMCPrivate",VR::IS,VM::VM1,"?",false }, + {0x0029,0x0046,"MMCPrivate",VR::IS,VM::VM1,"?",false }, + {0x0029,0x0047,"MMCPrivate",VR::IS,VM::VM1,"?",false }, + {0x0029,0x0062,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x0075,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x0078,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x0079,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x007a,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x007b,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x007d,"MMCPrivate",VR::CS,VM::VM1,"?",false }, + {0x0029,0x00d0,"MMCPrivate",VR::LO,VM::VM1,"?",false }, + {0x0029,0x00d6,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0021,0x0001,"Mayo/IBM Archive Project",VR::UN,VM::VM1,"?",false }, {0x0021,0x0010,"Mayo/IBM Archive Project",VR::UN,VM::VM1,"?",false }, {0x0021,0x0011,"Mayo/IBM Archive Project",VR::UN,VM::VM1,"?",false }, @@ -10263,6 +10348,8 @@ static const DICT_ENTRY DICOMV3DataDict [] = { {0xffff,0xffff,"GDCM Private Sentinel",VR::INVALID,VM::VM0,"",true }, // Dummy invalid element {0xffff,0xffff,"",VR::INVALID,VM::VM0,0,true } // Gard (will NOT be added) }; +} //end anonymous namespace +namespace gdcm { /* void Dict::LoadDefault() diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmBasicOffsetTable.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmBasicOffsetTable.h index 4b22b11ffd8..745add57774 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmBasicOffsetTable.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmBasicOffsetTable.h @@ -54,8 +54,11 @@ class GDCM_EXPORT BasicOffsetTable : public Fragment if( TagField != itemStart ) { // Bug_Siemens_PrivateIconNoItem.dcm - gdcmDebugMacro( "Could be Bug_Siemens_PrivateIconNoItem.dcm" ); - throw "SIEMENS Icon thingy"; + //gdcmDebugMacro( "Could be Bug_Siemens_PrivateIconNoItem.dcm" ); + ParseException pe; + pe.SetLastElement(*this); + //throw "SIEMENS Icon thingy"; + throw pe; } if( !ValueLengthField.Read(is) ) { diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmByteValue.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmByteValue.cxx index 58f6112451e..b48f6de8b03 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmByteValue.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmByteValue.cxx @@ -30,7 +30,7 @@ namespace gdcm_ns ++l; } #else - assert( !l.IsUndefined() && !l.IsOdd() ); + gdcmAssertAlwaysMacro( !l.IsUndefined() && !l.IsOdd() ); #endif // I cannot use reserve for now. I need to implement: // STL - vector<> and istream @@ -95,7 +95,7 @@ namespace gdcm_ns // so we need an inequality if( length <= Internal.size() ) { - memcpy(buffer, &Internal[0], length); + if(!Internal.empty()) memcpy(buffer, &Internal[0], length); return true; } gdcmDebugMacro( "Could not handle length= " << length ); diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmDataElement.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmDataElement.h index ceedc25670d..7162e28260b 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmDataElement.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmDataElement.h @@ -92,7 +92,10 @@ class GDCM_EXPORT DataElement /// Set/Get Value (bytes array, SQ of items, SQ of fragments): Value const &GetValue() const { gdcmAssertAlwaysMacro(ValueField); return *ValueField; } - Value &GetValue() { return *ValueField; } + Value &GetValue() { + gdcmAssertAlwaysMacro(ValueField); + return *ValueField; + } /// \warning you need to set the ValueLengthField explicitly void SetValue(Value const & vl) { //assert( ValueField == 0 ); diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx index 1d6cc3d9b71..40f8a69cb8a 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx @@ -44,7 +44,7 @@ std::string DataSet::GetPrivateCreator(const Tag &t) const std::string owner = std::string(bv->GetPointer(),bv->GetLength()); // There should not be any trailing space character... // TODO: tmp.erase(tmp.find_last_not_of(' ') + 1); - while( owner.size() && owner[owner.size()-1] == ' ' ) + while( !owner.empty() && owner[owner.size()-1] == ' ' ) { // osirix/AbdominalCT/36382443 owner.erase(owner.size()-1,1); @@ -135,7 +135,7 @@ MediaStorage DataSet::GetMediaStorage() const } } // Paranoid check: if last character of a VR=UI is space let's pretend this is a \0 - if( ts.size() ) + if( !ts.empty() ) { char &last = ts[ts.size()-1]; if( last == ' ' ) diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmElement.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmElement.h index 417d2614d0f..bda0fc3dbbd 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmElement.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmElement.h @@ -236,10 +236,10 @@ template<> class EncodingImplementation { char sep; //std::cout << "GetLength: " << af->GetLength() << std::endl; for(unsigned long i=1; i> std::ws >> sep; //_is.get(sep); - assert( sep == '\\' ); // FIXME: Bad use of assert + //assert( sep == '\\' ); // FIXME: Bad use of assert _is >> std::ws >> data[i]; } } diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx index 55621c672ed..0f623a0deef 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx @@ -878,7 +878,7 @@ std::string FileMetaInformation::GetMediaStorageAsString() const } } // Paranoid check: if last character of a VR=UI is space let's pretend this is a \0 - if( ts.size() ) + if( !ts.empty() ) { char &last = ts[ts.size()-1]; if( last == ' ' ) diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.cxx index 1a059081d1d..20f72dabef0 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.cxx @@ -159,7 +159,8 @@ int PDBHeader::readprotocoldatablock(const char *input, size_t inputlen, bool ve { (void)verbose; // First 4 bytes are the length (again) - uint32_t len = *(const uint32_t*)input; + uint32_t len; // = *(const uint32_t*)input; + memcpy(&len, input, sizeof len); SwapperNoOp::SwapArray(&len,1); //if( verbose ) // std::cout << len << "," << inputlen << std::endl; diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmSequenceOfFragments.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmSequenceOfFragments.h index 4a50ea8f3c4..e3e429efaad 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmSequenceOfFragments.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmSequenceOfFragments.h @@ -93,8 +93,8 @@ std::istream& Read(std::istream &is, bool readvalues = true) template std::istream& ReadPreValue(std::istream &is) { - //if( SequenceLengthField.IsUndefined() ) // First item is the basic offset table: +#if 0 try { Table.Read(is); @@ -125,6 +125,10 @@ std::istream& ReadPreValue(std::istream &is) //assert(0); } } +#else + Table.Read(is); + gdcmDebugMacro( "Table: " << Table ); +#endif return is; } diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx index 45acc77e762..dc462dd356a 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx @@ -309,7 +309,7 @@ VR::VRType VR::GetVRTypeFromFile(const char *vr) * You need to compile with -DNDEBUG * Running TestReader on gdcmData, leads to 2.2% improvement */ -#if 1 +#if 0 static const int N = sizeof(VRValue) / sizeof(VRType); assert( N == 30 ); static const char **start = VRStrings+1; @@ -345,6 +345,19 @@ VR::VRType VR::GetVRTypeFromFile(const char *vr) break; } } + if( r == VR::VR_END ) + { + // https://groups.google.com/d/msg/comp.protocols.dicom/0ata_3lpjF4/xlkjOKRGBwAJ + // http://dicom.nema.org/medical/dicom/current/output/chtml/part05/chapter_E.html + if( vr[0] >= ' ' && vr[0] <= '~' + && vr[1] >= ' ' && vr[1] <= '~' ) // FIXME Control Char LF/FF/CR TAB and ESC should be accepted + { + // newly added VR ? + // we are not capable of preserving the original VR. this is accepted behavior + return VR::UN; + } + return VR::INVALID; + } #endif // postcondition assert( r != VR::INVALID diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmWriter.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmWriter.cxx index 1dfadde50d7..0a876d372b9 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmWriter.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition/gdcmWriter.cxx @@ -108,7 +108,7 @@ bool Writer::Write() return false; } - return true;//os; + return !os.fail(); } try @@ -159,7 +159,7 @@ bool Writer::Write() Ofstream->close(); } - return true; + return !os.fail(); } void Writer::SetFileName(const char *filename) diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx index bcb23fe1349..05372a0d0b6 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx @@ -744,7 +744,7 @@ catch(...) } -bool IsVRUI(Tag const &tag) +static bool IsVRUI(Tag const &tag) { static const Global &g = Global::GetInstance(); static const Dicts &dicts = g.GetDicts(); diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx index 95b6621554b..c598c9a0fd0 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx @@ -285,9 +285,12 @@ unsigned long Bitmap::GetBufferLength() const else if( PF == PixelFormat::SINGLEBIT ) { assert( PF.GetSamplesPerPixel() == 1 ); - unsigned int save = mul; - save /= 8; - assert( save * 8 == mul ); + const size_t bytesPerRow = Dimensions[0] / 8 + (Dimensions[0] % 8 != 0 ? 1 : 0); + size_t save = bytesPerRow * Dimensions[1]; + if( NumberOfDimensions > 2 ) + save *= Dimensions[2]; + if(Dimensions[0] % 8 == 0 ) + assert( save * 8 == mul ); mul = save; } else if( PF.GetBitsAllocated() % 8 != 0 ) diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmBitmap.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmBitmap.h index a100290e453..906a44d56e0 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmBitmap.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmBitmap.h @@ -121,7 +121,7 @@ class GDCM_EXPORT Bitmap : public Object const PhotometricInterpretation &GetPhotometricInterpretation() const; void SetPhotometricInterpretation(PhotometricInterpretation const &pi); - bool IsEmpty() const { return Dimensions.size() == 0; } + bool IsEmpty() const { return Dimensions.empty(); } void Clear(); /// Return the length of the image after decompression diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmIconImageFilter.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmIconImageFilter.cxx index 504d91d01a7..4e1b40eaee4 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmIconImageFilter.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmIconImageFilter.cxx @@ -50,7 +50,7 @@ void IconImageFilter::ExtractIconImages() const DataElement &iconimagesq = rootds.GetDataElement( ticonimage ); SmartPointer sq = iconimagesq.GetValueAsSQ(); // Is SQ empty ? - if( sq ) + if( sq && sq->GetNumberOfItems() == 1 ) { gdcmAssertAlwaysMacro( sq->GetNumberOfItems() == 1 ); diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx index de4c945d708..ad6308364d1 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx @@ -98,6 +98,7 @@ static bool GetDirectionCosinesValueFromSequence(const DataSet& ds, const Tag& t if( !subds.FindDataElement(tpms) ) return false; //const SequenceOfItems * sqi2 = subds.GetDataElement( tpms ).GetSequenceOfItems(); SmartPointer sqi2 = subds.GetDataElement( tpms ).GetValueAsSQ(); + if( !(sqi2 && sqi2->GetNumberOfItems()) ) return false; assert( sqi2 && sqi2->GetNumberOfItems() ); // Take it from the first item const Item &item2 = sqi2->GetItem(1); @@ -199,15 +200,17 @@ static bool ComputeZSpacingFromIPP(const DataSet &ds, double &zspacing) if( !ds.FindDataElement( tfgs ) ) return false; //const SequenceOfItems * sqi = ds.GetDataElement( tfgs ).GetSequenceOfItems(); SmartPointer sqi = ds.GetDataElement( tfgs ).GetValueAsSQ(); + if( !sqi ) return false; assert( sqi ); double normal[3]; DirectionCosines dc( &cosines[0] ); dc.Cross( normal ); // For each item - std::vector distances; SequenceOfItems::SizeType nitems = sqi->GetNumberOfItems(); + if( nitems > 1 ) { std::vector dircos_subds2; dircos_subds2.resize(6); + std::vector distances; for(SequenceOfItems::SizeType i0 = 1; i0 <= nitems; ++i0) { const Item &item = sqi->GetItem(i0); @@ -278,6 +281,31 @@ static bool ComputeZSpacingFromIPP(const DataSet &ds, double &zspacing) prev = distances[i]; } } + } else { + // single slice + const Tag tfgs0(0x5200,0x9229); + if( !ds.FindDataElement( tfgs0 ) ) return false; + SmartPointer sqi = ds.GetDataElement( tfgs0 ).GetValueAsSQ(); + if( !(sqi && sqi->GetNumberOfItems() > 0) ) return false; + // Get first item: + const Item &item = sqi->GetItem(1); + const DataSet & subds = item.GetNestedDataSet(); + // + const Tag tpms(0x0028,0x9110); + if( !subds.FindDataElement(tpms) ) return false; + //const SequenceOfItems * sqi2 = subds.GetDataElement( tpms ).GetSequenceOfItems(); + SmartPointer sqi2 = subds.GetDataElement( tpms ).GetValueAsSQ(); + assert( sqi2 ); + const Item &item2 = sqi2->GetItem(1); + const DataSet & subds2 = item2.GetNestedDataSet(); + // + const Tag tps(0x0018,0x0088); + if( !subds2.FindDataElement(tps) ) return false; + const DataElement &de = subds2.GetDataElement( tps ); + Attribute<0x0018,0x0088> at; + at.SetFromDataElement( de ); + zspacing = at.GetValue(); + } return true; } @@ -422,8 +450,10 @@ std::vector ImageHelper::GetOriginValue(File const & f) || ms == MediaStorage::EnhancedMRImageStorage || ms == MediaStorage::EnhancedPETImageStorage || ms == MediaStorage::OphthalmicTomographyImageStorage - || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage || ms == MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage || ms == MediaStorage::XRay3DAngiographicImageStorage || ms == MediaStorage::XRay3DCraniofacialImageStorage || ms == MediaStorage::SegmentationStorage @@ -550,8 +580,10 @@ std::vector ImageHelper::GetDirectionCosinesValue(File const & f) if( ms == MediaStorage::EnhancedCTImageStorage || ms == MediaStorage::EnhancedMRImageStorage || ms == MediaStorage::EnhancedPETImageStorage - || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage || ms == MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage || ms == MediaStorage::XRay3DAngiographicImageStorage || ms == MediaStorage::XRay3DCraniofacialImageStorage || ms == MediaStorage::SegmentationStorage @@ -845,10 +877,12 @@ void ImageHelper::SetDimensionsValue(File& f, const Pixmap & img) ds.Replace( columns.GetAsDataElement() ); Attribute<0x0028,0x0008> numframes = { 0 }; numframes.SetValue( dims[2] ); - if( img.GetNumberOfDimensions() == 3 && dims[2] > 1 ) + if( img.GetNumberOfDimensions() == 3 && dims[2] >= 1 ) { if( ms.MediaStorage::GetModalityDimension() > 2 ) ds.Replace( numframes.GetAsDataElement() ); + else if( ms.MediaStorage::GetModalityDimension() == 2 && dims[2] == 1 ) + ds.Remove( numframes.GetTag() ); else { gdcmErrorMacro( "MediaStorage does not allow 3rd dimension. But value is: " << dims[2] ); @@ -857,9 +891,20 @@ void ImageHelper::SetDimensionsValue(File& f, const Pixmap & img) } else if( img.GetNumberOfDimensions() == 2 && dims[2] == 1 ) { - // This is a MF instances, need to set Number of Frame to 1 - if( ms.MediaStorage::GetModalityDimension() > 2 ) - ds.Replace( numframes.GetAsDataElement() ); + // This is a MF instances, need to set Number of Frame to 1 when Required + if (ms.MediaStorage::GetModalityDimension() > 2) + { + // Only include Multi-Frame when required (not Conditional): + if( ms == MediaStorage::XRayAngiographicImageStorage // A.14.3 XA Image IOD Module Table: Multi-frame C.7.6.6 C - Required if pixel data is Multi - frame Cine data + ) + { + ds.Remove(numframes.GetTag()); + } + else + { + ds.Replace(numframes.GetAsDataElement()); + } + } } else // cleanup ds.Remove( numframes.GetTag() ); @@ -868,8 +913,10 @@ void ImageHelper::SetDimensionsValue(File& f, const Pixmap & img) if( ms == MediaStorage::EnhancedCTImageStorage || ms == MediaStorage::EnhancedMRImageStorage || ms == MediaStorage::EnhancedPETImageStorage - || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage || ms == MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage || ms == MediaStorage::XRay3DAngiographicImageStorage || ms == MediaStorage::XRay3DCraniofacialImageStorage || ms == MediaStorage::SegmentationStorage @@ -885,6 +932,7 @@ void ImageHelper::SetDimensionsValue(File& f, const Pixmap & img) { SmartPointer sqi = ds.GetDataElement( tfgs ).GetValueAsSQ(); assert( sqi ); + sqi->SetLengthToUndefined(); sqi->SetNumberOfItems( dims[2] ); } } @@ -967,8 +1015,10 @@ std::vector ImageHelper::GetRescaleInterceptSlopeValue(File const & f) || ms == MediaStorage::ComputedRadiographyImageStorage || ms == MediaStorage::PETImageStorage || ms == MediaStorage::SecondaryCaptureImageStorage - || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage || ms == MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage || ForceRescaleInterceptSlope ) { @@ -1204,8 +1254,10 @@ Warning - Dicom dataset contains attributes not present in standard DICOM IOD - case MediaStorage::UltrasoundMultiFrameImageStorageRetired: // SC: case MediaStorage::SecondaryCaptureImageStorage: + case MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage: case MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage: case MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage: + case MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage: case MediaStorage::HardcopyGrayscaleImageStorage: t = Tag(0xffff,0xffff); break; @@ -1243,8 +1295,10 @@ std::vector ImageHelper::GetSpacingValue(File const & f) || ms == MediaStorage::EnhancedMRImageStorage || ms == MediaStorage::EnhancedPETImageStorage || ms == MediaStorage::OphthalmicTomographyImageStorage - || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage || ms == MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage || ms == MediaStorage::XRay3DAngiographicImageStorage || ms == MediaStorage::XRay3DCraniofacialImageStorage || ms == MediaStorage::SegmentationStorage @@ -1502,6 +1556,27 @@ std::vector ImageHelper::GetSpacingValue(File const & f) return sp; } +static SmartPointer InsertOrReplaceSQ( DataSet & ds, const Tag &tag ) +{ + SmartPointer sqi; + if( !ds.FindDataElement( tag ) ) + { + sqi = new SequenceOfItems; + DataElement de( tag ); + de.SetVR( VR::SQ ); + de.SetValue( *sqi ); + assert( de.GetVL().IsUndefined() ); + de.SetVLToUndefined(); + ds.Insert( de ); + } + sqi = ds.GetDataElement( tag ).GetValueAsSQ(); + sqi->SetLengthToUndefined(); + DataElement de_dup = ds.GetDataElement( tag ); + de_dup.SetValue( *sqi ); + ds.Replace( de_dup ); + return sqi; +} + void ImageHelper::SetSpacingValue(DataSet & ds, const std::vector & spacing) { MediaStorage ms; @@ -1522,8 +1597,10 @@ void ImageHelper::SetSpacingValue(DataSet & ds, const std::vector & spac if( ms == MediaStorage::EnhancedCTImageStorage || ms == MediaStorage::EnhancedMRImageStorage || ms == MediaStorage::EnhancedPETImageStorage - || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage || ms == MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage || ms == MediaStorage::XRay3DAngiographicImageStorage || ms == MediaStorage::XRay3DCraniofacialImageStorage || ms == MediaStorage::SegmentationStorage @@ -1544,50 +1621,24 @@ void ImageHelper::SetSpacingValue(DataSet & ds, const std::vector & spac */ { const Tag tfgs(0x5200,0x9229); - SmartPointer sqi; - if( !ds.FindDataElement( tfgs ) ) - { - sqi = new SequenceOfItems; - DataElement de( tfgs ); - de.SetVR( VR::SQ ); - de.SetValue( *sqi ); - de.SetVLToUndefined(); - ds.Insert( de ); - } - //sqi = (SequenceOfItems*)ds.GetDataElement( tfgs ).GetSequenceOfItems(); - sqi = ds.GetDataElement( tfgs ).GetValueAsSQ(); - sqi->SetLengthToUndefined(); - + SmartPointer sqi = InsertOrReplaceSQ( ds, tfgs ); if( !sqi->GetNumberOfItems() ) { Item item; //( Tag(0xfffe,0xe000) ); - item.SetVLToUndefined(); sqi->AddItem( item ); } Item &item1 = sqi->GetItem(1); + item1.SetVLToUndefined(); DataSet &subds = item1.GetNestedDataSet(); const Tag tpms(0x0028,0x9110); - if( !subds.FindDataElement( tpms ) ) - { - SequenceOfItems *sqi2 = new SequenceOfItems; - DataElement de( tpms ); - de.SetVR( VR::SQ ); - de.SetValue( *sqi2 ); - de.SetVLToUndefined(); - subds.Insert( de ); - } - - //sqi = (SequenceOfItems*)subds.GetDataElement( tpms ).GetSequenceOfItems(); - sqi = subds.GetDataElement( tpms ).GetValueAsSQ(); - sqi->SetLengthToUndefined(); - + sqi = InsertOrReplaceSQ( subds, tpms ); if( !sqi->GetNumberOfItems() ) { Item item; //( Tag(0xfffe,0xe000) ); - item.SetVLToUndefined(); sqi->AddItem( item ); } Item &item2 = sqi->GetItem(1); + item2.SetVLToUndefined(); DataSet &subds2 = item2.GetNestedDataSet(); // @@ -1605,13 +1656,12 @@ void ImageHelper::SetSpacingValue(DataSet & ds, const std::vector & spac const Tag tfgs(0x5200,0x9230); if( ds.FindDataElement( tfgs ) ) { - SmartPointer sqi = ds.GetDataElement( tfgs ).GetValueAsSQ(); - assert( sqi ); + SmartPointer sqi = InsertOrReplaceSQ( ds, tfgs ); SequenceOfItems::SizeType nitems = sqi->GetNumberOfItems(); for(SequenceOfItems::SizeType i0 = 1; i0 <= nitems; ++i0) { - // Get first item: Item &item = sqi->GetItem(i0); + item.SetVLToUndefined(); DataSet & subds = item.GetNestedDataSet(); const Tag tpms(0x0028,0x9110); subds.Remove(tpms); @@ -1770,50 +1820,24 @@ void ImageHelper::SetSpacingValue(DataSet & ds, const std::vector & spac static void SetDataElementInSQAsItemNumber(DataSet & ds, DataElement const & de, Tag const & sqtag, unsigned int itemidx) { const Tag tfgs = sqtag; //(0x5200,0x9230); - SmartPointer sqi; - if( !ds.FindDataElement( tfgs ) ) - { - sqi = new SequenceOfItems; - DataElement detmp( tfgs ); - detmp.SetVR( VR::SQ ); - detmp.SetValue( *sqi ); - detmp.SetVLToUndefined(); - ds.Insert( detmp ); - } - //sqi = (SequenceOfItems*)ds.GetDataElement( tfgs ).GetSequenceOfItems(); - sqi = ds.GetDataElement( tfgs ).GetValueAsSQ(); - sqi->SetLengthToUndefined(); - + SmartPointer sqi = InsertOrReplaceSQ( ds, tfgs ); if( sqi->GetNumberOfItems() < itemidx ) { Item item; //( Tag(0xfffe,0xe000) ); - item.SetVLToUndefined(); sqi->AddItem( item ); } Item &item1 = sqi->GetItem(itemidx); + item1.SetVLToUndefined(); DataSet &subds = item1.GetNestedDataSet(); const Tag tpms(0x0020,0x9113); - if( !subds.FindDataElement( tpms ) ) - { - SequenceOfItems *sqi2 = new SequenceOfItems; - DataElement detmp( tpms ); - detmp.SetVR( VR::SQ ); - detmp.SetValue( *sqi2 ); - detmp.SetVLToUndefined(); - subds.Insert( detmp ); - } - - //sqi = (SequenceOfItems*)subds.GetDataElement( tpms ).GetSequenceOfItems(); - sqi = subds.GetDataElement( tpms ).GetValueAsSQ(); - sqi->SetLengthToUndefined(); - + sqi = InsertOrReplaceSQ( subds, tpms ); if( !sqi->GetNumberOfItems() ) { Item item; //( Tag(0xfffe,0xe000) ); - item.SetVLToUndefined(); sqi->AddItem( item ); } Item &item2 = sqi->GetItem(1); + item2.SetVLToUndefined(); DataSet &subds2 = item2.GetNestedDataSet(); //Attribute<0x0020,0x0032> ipp = {{0,0,0}}; // default value @@ -1846,8 +1870,10 @@ void ImageHelper::SetOriginValue(DataSet & ds, const Image & image) && ms != MediaStorage::PETImageStorage //&& ms != MediaStorage::ComputedRadiographyImageStorage && ms != MediaStorage::SegmentationStorage - && ms != MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + && ms != MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage && ms != MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage + && ms != MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + && ms != MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage && ms != MediaStorage::XRay3DAngiographicImageStorage && ms != MediaStorage::XRay3DCraniofacialImageStorage && ms != MediaStorage::EnhancedMRImageStorage @@ -1869,8 +1895,10 @@ void ImageHelper::SetOriginValue(DataSet & ds, const Image & image) || ms == MediaStorage::EnhancedPETImageStorage || ms == MediaStorage::XRay3DAngiographicImageStorage || ms == MediaStorage::XRay3DCraniofacialImageStorage - || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage || ms == MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage || ms == MediaStorage::SegmentationStorage || ms == MediaStorage::IVOCTForPresentation || ms == MediaStorage::IVOCTForProcessing @@ -1925,6 +1953,7 @@ void ImageHelper::SetOriginValue(DataSet & ds, const Image & image) { // Get first item: Item &item = sqi->GetItem(i0); + item.SetVLToUndefined(); DataSet & subds = item.GetNestedDataSet(); const Tag tpms(0x0020,0x9113); subds.Remove(tpms); @@ -1940,8 +1969,10 @@ void ImageHelper::SetOriginValue(DataSet & ds, const Image & image) // C.7.6.6.1.2 Frame Increment Pointer // (0028,0009) AT (0018,2005) # 4,1-n Frame Increment Pointer - if( ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage - || ms == MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage ) + if( ms == MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + || ms == MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage ) { if( dimz > 1 ) { Attribute<0x0028,0x0009> fip; @@ -1982,8 +2013,10 @@ void ImageHelper::SetDirectionCosinesValue(DataSet & ds, const std::vector sqi; - if( !ds.FindDataElement( tfgs ) ) - { - sqi = new SequenceOfItems; - DataElement de( tfgs ); - de.SetVR( VR::SQ ); - de.SetValue( *sqi ); - de.SetVLToUndefined(); - ds.Insert( de ); - } - //sqi = (SequenceOfItems*)ds.GetDataElement( tfgs ).GetSequenceOfItems(); - sqi = ds.GetDataElement( tfgs ).GetValueAsSQ(); - sqi->SetLengthToUndefined(); - + SmartPointer sqi = InsertOrReplaceSQ( ds, tfgs ); if( !sqi->GetNumberOfItems() ) { Item item; //( Tag(0xfffe,0xe000) ); - item.SetVLToUndefined(); sqi->AddItem( item ); } Item &item1 = sqi->GetItem(1); + item1.SetVLToUndefined(); DataSet &subds = item1.GetNestedDataSet(); const Tag tpms(0x0020,0x9116); - if( !subds.FindDataElement( tpms ) ) - { - SequenceOfItems *sqi2 = new SequenceOfItems; - DataElement de( tpms ); - de.SetVR( VR::SQ ); - de.SetValue( *sqi2 ); - de.SetVLToUndefined(); - subds.Insert( de ); - } - - //sqi = (SequenceOfItems*)subds.GetDataElement( tpms ).GetSequenceOfItems(); - sqi = subds.GetDataElement( tpms ).GetValueAsSQ(); - sqi->SetLengthToUndefined(); - + sqi = InsertOrReplaceSQ( subds, tpms ); if( !sqi->GetNumberOfItems() ) { Item item; //( Tag(0xfffe,0xe000) ); - item.SetVLToUndefined(); sqi->AddItem( item ); } Item &item2 = sqi->GetItem(1); + item2.SetVLToUndefined(); DataSet &subds2 = item2.GetNestedDataSet(); subds2.Replace( iop.GetAsDataElement() ); @@ -2104,6 +2113,7 @@ void ImageHelper::SetDirectionCosinesValue(DataSet & ds, const std::vectorGetItem(i0); + item.SetVLToUndefined(); DataSet & subds = item.GetNestedDataSet(); const Tag tpms(0x0020,0x9116); subds.Remove(tpms); @@ -2137,8 +2147,10 @@ void ImageHelper::SetRescaleInterceptSlopeValue(File & f, const Image & img) && ms != MediaStorage::PETImageStorage && ms != MediaStorage::RTDoseStorage && ms != MediaStorage::SecondaryCaptureImageStorage - && ms != MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + && ms != MediaStorage::MultiframeSingleBitSecondaryCaptureImageStorage && ms != MediaStorage::MultiframeGrayscaleByteSecondaryCaptureImageStorage + && ms != MediaStorage::MultiframeGrayscaleWordSecondaryCaptureImageStorage + && ms != MediaStorage::MultiframeTrueColorSecondaryCaptureImageStorage && ms != MediaStorage::EnhancedMRImageStorage && ms != MediaStorage::EnhancedCTImageStorage && ms != MediaStorage::EnhancedPETImageStorage @@ -2179,50 +2191,24 @@ void ImageHelper::SetRescaleInterceptSlopeValue(File & f, const Image & img) */ { const Tag tfgs(0x5200,0x9229); - SmartPointer sqi; - if( !ds.FindDataElement( tfgs ) ) - { - sqi = new SequenceOfItems; - DataElement de( tfgs ); - de.SetVR( VR::SQ ); - de.SetValue( *sqi ); - de.SetVLToUndefined(); - ds.Insert( de ); - } - //sqi = (SequenceOfItems*)ds.GetDataElement( tfgs ).GetSequenceOfItems(); - sqi = ds.GetDataElement( tfgs ).GetValueAsSQ(); - sqi->SetLengthToUndefined(); - + SmartPointer sqi = InsertOrReplaceSQ( ds, tfgs ); if( !sqi->GetNumberOfItems() ) { Item item; //( Tag(0xfffe,0xe000) ); - item.SetVLToUndefined(); sqi->AddItem( item ); } Item &item1 = sqi->GetItem(1); + item1.SetVLToUndefined(); DataSet &subds = item1.GetNestedDataSet(); const Tag tpms(0x0028,0x9145); - if( !subds.FindDataElement( tpms ) ) - { - SequenceOfItems *sqi2 = new SequenceOfItems; - DataElement de( tpms ); - de.SetVR( VR::SQ ); - de.SetValue( *sqi2 ); - de.SetVLToUndefined(); - subds.Insert( de ); - } - - //sqi = (SequenceOfItems*)subds.GetDataElement( tpms ).GetSequenceOfItems(); - sqi = subds.GetDataElement( tpms ).GetValueAsSQ(); - sqi->SetLengthToUndefined(); - + sqi = InsertOrReplaceSQ( subds, tpms ); if( !sqi->GetNumberOfItems() ) { Item item; //( Tag(0xfffe,0xe000) ); - item.SetVLToUndefined(); sqi->AddItem( item ); } Item &item2 = sqi->GetItem(1); + item2.SetVLToUndefined(); DataSet &subds2 = item2.GetNestedDataSet(); Attribute<0x0028,0x1052> at1; diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG12Codec.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG12Codec.cxx index dc1bc14eaf1..971aaf168f0 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG12Codec.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG12Codec.cxx @@ -18,4 +18,8 @@ #include #define JPEGBITSCodec JPEG12Codec -#include "gdcmJPEGBITSCodec.cxx" +#define my_error_mgr my_error_mgr_12BIT +#define JPEGInternals JPEGInternals_12BIT +#define my_source_mgr my_source_mgr_12BIT +#define my_destination_mgr my_destination_mgr_12BIT +#include "gdcmJPEGBITSCodec.hxx" diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG12Codec.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG12Codec.h index a79498617cb..97cad7e8f03 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG12Codec.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG12Codec.h @@ -19,7 +19,7 @@ namespace gdcm { -class JPEGInternals; +class JPEGInternals_12BIT; class ByteValue; /** * \brief Class to do JPEG 12bits (lossy & lossless) @@ -41,7 +41,7 @@ class JPEG12Codec : public JPEGCodec virtual bool EncodeBuffer(std::ostream &os, const char *data, size_t datalen); private: - JPEGInternals *Internals; + JPEGInternals_12BIT *Internals; }; } // end namespace gdcm diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG16Codec.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG16Codec.cxx index 795676ebc51..63a6ad05ec1 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG16Codec.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG16Codec.cxx @@ -18,4 +18,8 @@ #include #define JPEGBITSCodec JPEG16Codec -#include "gdcmJPEGBITSCodec.cxx" +#define my_error_mgr my_error_mgr_16BIT +#define JPEGInternals JPEGInternals_16BIT +#define my_source_mgr my_source_mgr_16BIT +#define my_destination_mgr my_destination_mgr_16BIT +#include "gdcmJPEGBITSCodec.hxx" diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG16Codec.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG16Codec.h index ce109a109f3..f1263b018ed 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG16Codec.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG16Codec.h @@ -19,7 +19,7 @@ namespace gdcm { -class JPEGInternals; +class JPEGInternals_16BIT; class ByteValue; /** * \brief Class to do JPEG 16bits (lossless) @@ -41,7 +41,7 @@ class JPEG16Codec : public JPEGCodec virtual bool EncodeBuffer(std::ostream &os, const char *data, size_t datalen); private: - JPEGInternals *Internals; + JPEGInternals_16BIT *Internals; }; } // end namespace gdcm diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG8Codec.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG8Codec.cxx index 5395e1a0e10..8ca05c953a5 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG8Codec.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG8Codec.cxx @@ -18,4 +18,8 @@ #include #define JPEGBITSCodec JPEG8Codec -#include "gdcmJPEGBITSCodec.cxx" +#define my_error_mgr my_error_mgr_8BIT +#define JPEGInternals JPEGInternals_8BIT +#define my_source_mgr my_source_mgr_8BIT +#define my_destination_mgr my_destination_mgr_8BIT +#include "gdcmJPEGBITSCodec.hxx" diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG8Codec.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG8Codec.h index ab4be8971d2..bd4cba29e01 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG8Codec.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEG8Codec.h @@ -19,7 +19,7 @@ namespace gdcm { -class JPEGInternals; +class JPEGInternals_8BIT; class ByteValue; /** * \brief Class to do JPEG 8bits (lossy & lossless) @@ -41,7 +41,7 @@ class JPEG8Codec : public JPEGCodec virtual bool EncodeBuffer(std::ostream &os, const char *data, size_t datalen); private: - JPEGInternals *Internals; + JPEGInternals_8BIT *Internals; }; } // end namespace gdcm diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEGBITSCodec.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEGBITSCodec.hxx similarity index 100% rename from Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEGBITSCodec.cxx rename to Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEGBITSCodec.hxx diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx index cc528c09792..7c562869494 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx @@ -186,7 +186,7 @@ bool JPEGLSCodec::Decode(DataElement const &in, DataElement &out) if( NumberOfDimensions == 2 ) { const SequenceOfFragments *sf = in.GetSequenceOfFragments(); - assert( sf ); + if (!sf) return false; unsigned long totalLen = sf->ComputeByteLength(); char *buffer = new char[totalLen]; sf->GetBuffer(buffer, totalLen); @@ -204,15 +204,15 @@ bool JPEGLSCodec::Decode(DataElement const &in, DataElement &out) else if( NumberOfDimensions == 3 ) { const SequenceOfFragments *sf = in.GetSequenceOfFragments(); - assert( sf ); - gdcmAssertAlwaysMacro( sf->GetNumberOfFragments() == Dimensions[2] ); + if (!sf) return false; + if (sf->GetNumberOfFragments() != Dimensions[2]) return false; std::stringstream os; for(unsigned int i = 0; i < sf->GetNumberOfFragments(); ++i) { const Fragment &frag = sf->GetFragment(i); if( frag.IsEmpty() ) return false; const ByteValue *bv = frag.GetByteValue(); - assert( bv ); + if (!bv) return false; size_t totalLen = bv->GetLength(); char *mybuffer = new char[totalLen]; diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx index 6b0abf41ee5..26a04521327 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx @@ -40,16 +40,31 @@ bool PNMCodec::CanCode(TransferSyntax const &) const } +static uint8_t reverseBitsByte(uint8_t x) +{ + uint8_t b = 0; + for (int i = 0; i < 8; ++i) { + b <<= 1; + b |= (x & 1); + x >>= 1; + } + return b; +} bool PNMCodec::Write(const char *filename, const DataElement &out) const { std::ofstream os(filename, std::ios::binary); const unsigned int *dims = this->GetDimensions(); const PhotometricInterpretation &pi = this->GetPhotometricInterpretation(); + const PixelFormat& pf = GetPixelFormat(); if( pi == PhotometricInterpretation::MONOCHROME2 || pi == PhotometricInterpretation::MONOCHROME1 ) // warning viz will be surprising { - os << "P5\n"; + // FIXME possible mismatch pi vs pf (eg. pbm with mono2) + if( pf == PixelFormat::SINGLEBIT) + os << "P4\n"; + else + os << "P5\n"; } else if( pi == PhotometricInterpretation::RGB || pi == PhotometricInterpretation::PALETTE_COLOR ) @@ -70,22 +85,22 @@ bool PNMCodec::Write(const char *filename, const DataElement &out) const return false; } - const PixelFormat& pf = GetPixelFormat(); switch(pf) { + case PixelFormat::SINGLEBIT: + break; case PixelFormat::UINT8: //case PixelFormat::INT8: - os << "255"; + os << "255\n"; break; case PixelFormat::UINT16: //case PixelFormat::INT16: - os << "65535"; + os << "65535\n"; break; default: gdcmErrorMacro( "Unhandled PF: " << pf ); return false; } - os << "\n"; const ByteValue *bv = out.GetByteValue(); // FIXME: PNM Codec cannot handle encapsulated syntax... sigh @@ -110,6 +125,15 @@ bool PNMCodec::Write(const char *filename, const DataElement &out) const { bv->Write( os ); } + else if( pf.GetBitsAllocated() == 1 ) + { + const uint8_t *x = (const uint8_t*) bv->GetPointer(); + for( size_t i = 0; i < bv->GetLength(); i++ ) + { + uint8_t b = reverseBitsByte(x[i]); + os.write((char*)&b, 1); + } + } else { //bv->Write( os ); @@ -236,7 +260,9 @@ bool PNMCodec::GetHeaderInfo(std::istream &is, TransferSyntax &ts) std::string type, str; std::getline(is,type); PhotometricInterpretation pi; - if( type == "P5" ) + if( type == "P4" ) // P4 => mono W/B ! + pi = PhotometricInterpretation::MONOCHROME1; + else if( type == "P5" ) pi = PhotometricInterpretation::MONOCHROME2; else if( type == "P6" ) // P3 => ASCII pi = PhotometricInterpretation::RGB; @@ -255,7 +281,10 @@ bool PNMCodec::GetHeaderInfo(std::istream &is, TransferSyntax &ts) unsigned int dims[3] = {}; is >> dims[0]; is >> dims[1]; unsigned int maxval; - is >> maxval; + if( type == "P4" ) + maxval = 1; + else + is >> maxval; // http://netpbm.sourceforge.net/doc/pgm.html // some kind of empty line... if( is.peek() == '\n' ) @@ -266,7 +295,14 @@ bool PNMCodec::GetHeaderInfo(std::istream &is, TransferSyntax &ts) //assert(len < INT_MAX); //assert(pos < INT_MAX); size_t m = ((size_t)len - (size_t)pos ) / ( dims[0]*dims[1] ); - if( m * dims[0] * dims[1] != (size_t)len - pos ) + bool cond; + if( type == "P4" ) { + const size_t bytesPerRow = dims[0] / 8 + (dims[0] % 8 != 0 ? 1 : 0); + cond = bytesPerRow * dims[1] != ((size_t)len - (size_t)pos); + } + else + cond = m * dims[0] * dims[1] != (size_t)len - (size_t)pos; + if( cond ) { std::cerr << "Problem computing length" << std::endl; std::cerr << "Pos: " << len - pos << std::endl; @@ -302,7 +338,11 @@ bool PNMCodec::GetHeaderInfo(std::istream &is, TransferSyntax &ts) #else const int nbits = log2( maxval ); // handle case where nbits = 0 also: - if( nbits > 0 && nbits <= 8 ) + if( nbits > 0 && nbits <= 1 ) + { + pf.SetBitsAllocated( 1 ); + } + else if( nbits > 1 && nbits <= 8 ) { pf.SetBitsAllocated( 8 ); pf.SetBitsStored( (unsigned short)nbits ); @@ -332,11 +372,11 @@ bool PNMCodec::GetHeaderInfo(std::istream &is, TransferSyntax &ts) //image.SetTransferSyntax( TransferSyntax::ExplicitVRBigEndian ); // PGM are big endian //image.SetTransferSyntax( TransferSyntax::ExplicitVRLittleEndian ); // PGM are big endian //image.SetTransferSyntax( TransferSyntax::ImplicitVRBigEndianPrivateGE ); // PGM are big endian - if( pf.GetBitsAllocated() == 8 ) + if( pf.GetBitsAllocated() > 8 ) + ts = TransferSyntax::ImplicitVRBigEndianPrivateGE; + else //ts = TransferSyntax::ImplicitVRLittleEndian; // nicer to handle than private GE ts = TransferSyntax::ExplicitVRLittleEndian; // nicer to handle than private GE - else - ts = TransferSyntax::ImplicitVRBigEndianPrivateGE; SetPhotometricInterpretation( pi ); SetPixelFormat( pf ); diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx index 781ddd15e3f..21ea3a7e71f 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx @@ -297,7 +297,7 @@ bool DoInvertPlanarConfiguration(T *output, const T *input, uint32_t inputlength b += 3; } assert( b == input + length + 2); - assert ( pout = output + length ); + assert ( pout == output + length ); return true; } @@ -847,7 +847,7 @@ bool RLECodec::DecodeByStreams(std::istream &is, std::ostream &os) } //assert( numberOfReadBytes + frame.Header.Offset[i] - is.tellg() + start == 0); } - assert( numOutBytes == length ); + if( numOutBytes != length ) return false; } return ImageCodec::DecodeByStreams(tmpos,os); diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx index a010f722468..0db715e78e4 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx @@ -129,8 +129,11 @@ static inline PixelFormat::ScalarType ComputeBestFit(const PixelFormat &pf, doub PixelFormat::ScalarType st = PixelFormat::UNKNOWN; assert( slope == (int)slope && intercept == (int)intercept); - const double min = slope * (double)pf.GetMin() + intercept; - const double max = slope * (double)pf.GetMax() + intercept; + assert( pf.GetMin() <= pf.GetMax() ); + const double pfmin = slope >= 0 ? pf.GetMin() : pf.GetMax(); + const double pfmax = slope >= 0 ? pf.GetMax() : pf.GetMin(); + const double min = slope * pfmin + intercept; + const double max = slope * pfmax + intercept; assert( min <= max ); assert( min == (int64_t)min && max == (int64_t)max ); if( min >= 0 ) // unsigned @@ -312,6 +315,12 @@ bool Rescaler::InverseRescale(char *out, const char *in, size_t n) // else integral type switch(PF) { + case PixelFormat::UINT8: + InverseRescaleFunctionIntoBestFit(out,(uint8_t*)in,n); + break; + case PixelFormat::INT8: + InverseRescaleFunctionIntoBestFit(out,(int8_t*)in,n); + break; case PixelFormat::UINT16: InverseRescaleFunctionIntoBestFit(out,(const uint16_t*)in,n); break; @@ -396,8 +405,14 @@ static PixelFormat ComputeInverseBestFitFromMinMax(/*const PixelFormat &pf,*/ do PixelFormat st = PixelFormat::UNKNOWN; //assert( slope == (int)slope && intercept == (int)intercept); + assert( _min <= _max ); double dmin = (_min - intercept ) / slope; double dmax = (_max - intercept ) / slope; + if( slope < 0 ) + { + dmin = (_max - intercept ) / slope; + dmax = (_min - intercept ) / slope; + } assert( dmin <= dmax ); assert( dmax <= std::numeric_limits::max() ); assert( dmin >= std::numeric_limits::min() ); diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmScanner.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmScanner.cxx index 0f6486be7bb..df9e3fdbfde 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmScanner.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmScanner.cxx @@ -203,6 +203,51 @@ void Scanner::Print( std::ostream & os ) const } } +static bool IsVRUI(Tag const &tag) +{ + static const Global &g = Global::GetInstance(); + static const Dicts &dicts = g.GetDicts(); + const DictEntry &dictentry = dicts.GetDictEntry(tag); + if( dictentry.GetVR() == VR::UI ) return true; + //if( tag == Tag(0x0020,0x000d) // Study Instance UID : UI + // || tag == Tag(0x0020,0x0052) // + // || tag == Tag(0x0020,0x000e) ) // Series Instance UID : UI + // { + // return true; + // } + return false; +} + +void Scanner::PrintTable( std::ostream & os ) const +{ + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + assert( filename && *filename ); + bool b = IsKey(filename); + const char *comment = !b ? "could not be read" : "could be read"; + os << '"' << filename << '"' << "\t"; + //const FilenameToValue &mapping = Mappings[*tag]; + TagsType::const_iterator tag = Tags.begin(); + const TagToValue &mapping = GetMapping(filename); + for( ; tag != Tags.end(); ++tag ) + { + const Tag &t = *tag; + bool isui = IsVRUI(t); + const char *value = ""; + if( mapping.find(t) != mapping.end() ) { + const char * v = mapping.find(t)->second; + //const char* value = this->GetValue(filename, *tag); + if(v) value = v; + } + os << '"' << (isui ? String<>::Trim( value ) : value) << '"'; + os << "\t"; + } + os << "\n"; + } +} + Scanner::TagToValue const & Scanner::GetMapping(const char *filename) const { // assert( Mappings.find(filename) != Mappings.end() ); diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmScanner.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmScanner.h index 2657497a704..83df04c2c09 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmScanner.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmScanner.h @@ -89,6 +89,8 @@ class GDCM_EXPORT Scanner : public Subject /// Print result void Print( std::ostream & os ) const; + void PrintTable( std::ostream & os ) const; + /// Check if filename is a key in the Mapping table. /// returns true only of file can be found, which means /// the file was indeed a DICOM file that could be processed diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmStrictScanner.cxx b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmStrictScanner.cxx index 67adfea2d04..cca1f9b405b 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmStrictScanner.cxx +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmStrictScanner.cxx @@ -212,6 +212,51 @@ void StrictScanner::Print( std::ostream & os ) const } } +static bool IsVRUI(Tag const &tag) +{ + static const Global &g = Global::GetInstance(); + static const Dicts &dicts = g.GetDicts(); + const DictEntry &dictentry = dicts.GetDictEntry(tag); + if( dictentry.GetVR() == VR::UI ) return true; + //if( tag == Tag(0x0020,0x000d) // Study Instance UID : UI + // || tag == Tag(0x0020,0x0052) // + // || tag == Tag(0x0020,0x000e) ) // Series Instance UID : UI + // { + // return true; + // } + return false; +} + +void StrictScanner::PrintTable( std::ostream & os ) const +{ + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + assert( filename && *filename ); + bool b = IsKey(filename); + const char *comment = !b ? "could not be read" : "could be read"; + os << '"' << filename << '"' << "\t"; + //const FilenameToValue &mapping = Mappings[*tag]; + TagsType::const_iterator tag = Tags.begin(); + const TagToValue &mapping = GetMapping(filename); + for( ; tag != Tags.end(); ++tag ) + { + const Tag &t = *tag; + bool isui = IsVRUI(t); + const char *value = ""; + if( mapping.find(t) != mapping.end() ) { + const char * v = mapping.find(t)->second; + //const char* value = this->GetValue(filename, *tag); + if(v) value = v; + } + os << '"' << (isui ? String<>::Trim( value ) : value) << '"'; + os << "\t"; + } + os << "\n"; + } +} + StrictScanner::TagToValue const & StrictScanner::GetMapping(const char *filename) const { // assert( Mappings.find(filename) != Mappings.end() ); diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmStrictScanner.h b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmStrictScanner.h index d10f62893aa..4484e53e0ac 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmStrictScanner.h +++ b/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmStrictScanner.h @@ -89,6 +89,8 @@ class GDCM_EXPORT StrictScanner : public Subject /// Print result void Print( std::ostream & os ) const; + void PrintTable( std::ostream & os ) const; + /// Check if filename is a key in the Mapping table. /// returns true only of file can be found, which means /// the file was indeed a DICOM file that could be processed diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/mangle_jpeg.h.in b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/mangle_jpeg.h.in index 260f49a0621..6be4286def8 100644 --- a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/mangle_jpeg.h.in +++ b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/mangle_jpeg.h.in @@ -136,5 +136,13 @@ #define jzero_far @MANGLE_PREFIX@_jzero_far #define jpeg_memory_src @MANGLE_PREFIX@_memory_src +#define jpeg_memory_mgr @MANGLE_PREFIX@_memory_mgr +#define jpeg_common_struct @MANGLE_PREFIX@_common_struct +#define jpeg_error_mgr @MANGLE_PREFIX@_error_mgr +#define jpeg_progress_mgr @MANGLE_PREFIX@_progress_mgr +#define jpeg_decompress_struct @MANGLE_PREFIX@_decompress_struct +#define jpeg_compress_struct @MANGLE_PREFIX@_compress_struct +#define jpeg_destination_mgr @MANGLE_PREFIX@_destination_mgr +#define jpeg_source_mgr @MANGLE_PREFIX@_source_mgr #endif