# HG changeset patch # User Leonardo Campos # Date 1481812106 7200 # Node ID ae79d443f780ecbc9bef7be3c3ed36c43b95137c # Parent 8d306c53f5479923ba8f6cdd1e52bb3233cb0acd fix RetrieveFrames (RGB) diff -r 8d306c53f547 -r ae79d443f780 Plugin/Dicom.h --- a/Plugin/Dicom.h Wed Dec 14 16:44:20 2016 +0100 +++ b/Plugin/Dicom.h Thu Dec 15 12:28:26 2016 -0200 @@ -49,6 +49,7 @@ static const gdcm::Tag DICOM_TAG_ACCESSION_NUMBER(0x0008, 0x0050); static const gdcm::Tag DICOM_TAG_SPECIFIC_CHARACTER_SET(0x0008, 0x0005); static const gdcm::Tag DICOM_TAG_PIXEL_DATA(0x7fe0, 0x0010); + static const gdcm::Tag DICOM_TAG_SAMPLES_PER_PIXEL(0x0028, 0x0002); static const gdcm::Tag DICOM_TAG_COLUMNS(0x0028, 0x0011); static const gdcm::Tag DICOM_TAG_ROWS(0x0028, 0x0010); static const gdcm::Tag DICOM_TAG_BITS_ALLOCATED(0x0028, 0x0100); diff -r 8d306c53f547 -r ae79d443f780 Plugin/WadoRsRetrieveFrames.cpp --- a/Plugin/WadoRsRetrieveFrames.cpp Wed Dec 14 16:44:20 2016 +0100 +++ b/Plugin/WadoRsRetrieveFrames.cpp Thu Dec 15 12:28:26 2016 -0200 @@ -311,16 +311,17 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } - int width, height, bits; + int width, height, bits, samplesPerPixel; if (!dicom.GetIntegerTag(height, *dictionary_, OrthancPlugins::DICOM_TAG_ROWS) || !dicom.GetIntegerTag(width, *dictionary_, OrthancPlugins::DICOM_TAG_COLUMNS) || - !dicom.GetIntegerTag(bits, *dictionary_, OrthancPlugins::DICOM_TAG_BITS_ALLOCATED)) + !dicom.GetIntegerTag(bits, *dictionary_, OrthancPlugins::DICOM_TAG_BITS_ALLOCATED) || + !dicom.GetIntegerTag(samplesPerPixel, *dictionary_, OrthancPlugins::DICOM_TAG_SAMPLES_PER_PIXEL)) { throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); } - size_t frameSize = height * width * bits / 8; + size_t frameSize = height * width * bits * samplesPerPixel / 8; if (pixelData.GetByteValue()->GetLength() % frameSize != 0) {