# HG changeset patch # User Sebastien Jodogne # Date 1614274048 -3600 # Node ID d9700b9f4ad9ff415b70b58bfe9a828f31013691 # Parent d64e6f401a8a388484d54f9ebb1ec383a7dac403# Parent 409cba9c1dbad951d27dea6c79eab930497536cb back to mainline diff -r d64e6f401a8a -r d9700b9f4ad9 NEWS --- a/NEWS Thu Feb 25 12:15:18 2021 +0100 +++ b/NEWS Thu Feb 25 18:27:28 2021 +0100 @@ -1,6 +1,10 @@ Pending changes in the mainline =============================== + +Version 1.9.1 (2021-02-25) +========================== + General ------- diff -r d64e6f401a8a -r d9700b9f4ad9 OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake --- a/OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake Thu Feb 25 12:15:18 2021 +0100 +++ b/OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake Thu Feb 25 18:27:28 2021 +0100 @@ -124,6 +124,8 @@ set(ORTHANC_FRAMEWORK_MD5 "8bfa10e66c9931e74111be0bfb1f4548") elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.0") set(ORTHANC_FRAMEWORK_MD5 "cea0b02ce184671eaf1bd668beefbf28") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.1") + set(ORTHANC_FRAMEWORK_MD5 "08eebc66ef93c3b40115c38501db5fbd") # Below this point are development snapshots that were used to # release some plugin, before an official release of the Orthanc diff -r d64e6f401a8a -r d9700b9f4ad9 OrthancFramework/Resources/CMake/OrthancFrameworkParameters.cmake diff -r d64e6f401a8a -r d9700b9f4ad9 OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp --- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp Thu Feb 25 12:15:18 2021 +0100 +++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp Thu Feb 25 18:27:28 2021 +0100 @@ -104,6 +104,7 @@ #include #include #include +#include #include #include @@ -1389,39 +1390,52 @@ const unsigned int height = accessor.GetHeight(); const unsigned int width = accessor.GetWidth(); - for (unsigned int y = 0; y < height; y++) { - switch (accessor.GetFormat()) + Uint8* q = target; + for (unsigned int y = 0; y < height; y++) { - case PixelFormat_RGB24: - case PixelFormat_Grayscale8: - case PixelFormat_Grayscale16: - case PixelFormat_SignedGrayscale16: + switch (accessor.GetFormat()) { - memcpy(target, reinterpret_cast(accessor.GetConstRow(y)), pitch); - target += pitch; - break; - } - - case PixelFormat_RGBA32: - { - // The alpha channel is not supported by the DICOM standard - const Uint8* source = reinterpret_cast(accessor.GetConstRow(y)); - for (unsigned int x = 0; x < width; x++, target += 3, source += 4) + case PixelFormat_RGB24: + case PixelFormat_Grayscale8: + case PixelFormat_Grayscale16: + case PixelFormat_SignedGrayscale16: { - target[0] = source[0]; - target[1] = source[1]; - target[2] = source[2]; + memcpy(q, reinterpret_cast(accessor.GetConstRow(y)), pitch); + q += pitch; + break; } - break; - } + case PixelFormat_RGBA32: + { + // The alpha channel is not supported by the DICOM standard + const Uint8* source = reinterpret_cast(accessor.GetConstRow(y)); + for (unsigned int x = 0; x < width; x++, q += 3, source += 4) + { + q[0] = source[0]; + q[1] = source[1]; + q[2] = source[2]; + } + + break; + } - default: - throw OrthancException(ErrorCode_NotImplemented); + default: + throw OrthancException(ErrorCode_NotImplemented); + } } } + static const Endianness ENDIANNESS = Toolbox::DetectEndianness(); + if (ENDIANNESS == Endianness_Big && + (accessor.GetFormat() == PixelFormat_Grayscale16 || + accessor.GetFormat() == PixelFormat_SignedGrayscale16)) + { + // New in Orthanc 1.9.1 + assert(pitch % 2 == 0); + swapBytes(target, accessor.GetHeight() * pitch, sizeof(uint16_t)); + } + if (!GetDcmtkObject().getDataset()->insert(pixels.release(), false, false).good()) { throw OrthancException(ErrorCode_InternalError); diff -r d64e6f401a8a -r d9700b9f4ad9 OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp --- a/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp Thu Feb 25 12:15:18 2021 +0100 +++ b/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp Thu Feb 25 18:27:28 2021 +0100 @@ -921,7 +921,7 @@ uint16_t *p = reinterpret_cast(image.GetRow(y)); for (int x = 0; x < 256; x++, v++, p++) { - *p = htole16(v); // Orthanc uses Little-Endian transfer syntax to encode images + *p = v; } } @@ -976,7 +976,7 @@ int16_t *p = reinterpret_cast(image.GetRow(y)); for (int x = 0; x < 256; x++, v++, p++) { - *p = htole16(v); // Orthanc uses Little-Endian transfer syntax to encode images + *p = v; } }