# HG changeset patch # User Sebastien Jodogne # Date 1481801780 -3600 # Node ID 727670c5c125d6c6931c53f0bdcc143cd5710861 # Parent 0cb3ac4f9159537c4a0de68bb1e6e78d95e05c8a fix generation of "Dimension Index Sequence" and "Dimension Index Values" diff -r 0cb3ac4f9159 -r 727670c5c125 Applications/Dicomizer.cpp --- a/Applications/Dicomizer.cpp Thu Dec 15 11:51:58 2016 +0100 +++ b/Applications/Dicomizer.cpp Thu Dec 15 12:36:20 2016 +0100 @@ -295,12 +295,18 @@ // Construct tag "Dimension Index Sequence" (0020,9222) std::auto_ptr item(new DcmItem); OrthancWSI::DicomToolbox::SetStringTag(*item, DCM_DimensionOrganizationUID, organization); - OrthancWSI::DicomToolbox::SetAttributeTag(*item, DCM_FunctionalGroupPointer, DCM_FrameContentSequence); - OrthancWSI::DicomToolbox::SetAttributeTag(*item, DCM_DimensionIndexPointer, DCM_DimensionIndexValues); + OrthancWSI::DicomToolbox::SetAttributeTag(*item, DCM_FunctionalGroupPointer, DCM_PlanePositionSlideSequence); + OrthancWSI::DicomToolbox::SetAttributeTag(*item, DCM_DimensionIndexPointer, DCM_ColumnPositionInTotalImagePixelMatrix); + + std::auto_ptr item2(new DcmItem); + OrthancWSI::DicomToolbox::SetStringTag(*item2, DCM_DimensionOrganizationUID, organization); + OrthancWSI::DicomToolbox::SetAttributeTag(*item2, DCM_FunctionalGroupPointer, DCM_PlanePositionSlideSequence); + OrthancWSI::DicomToolbox::SetAttributeTag(*item2, DCM_DimensionIndexPointer, DCM_RowPositionInTotalImagePixelMatrix); std::auto_ptr sequence(new DcmSequenceOfItems(DCM_DimensionIndexSequence)); if (!sequence->insert(item.release(), false, false).good() || + !sequence->insert(item2.release(), false, false).good() || !dataset.insert(sequence.release(), true /* replace */, false).good()) { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); diff -r 0cb3ac4f9159 -r 727670c5c125 Framework/Outputs/DicomPyramidWriter.cpp --- a/Framework/Outputs/DicomPyramidWriter.cpp Thu Dec 15 11:51:58 2016 +0100 +++ b/Framework/Outputs/DicomPyramidWriter.cpp Thu Dec 15 12:36:20 2016 +0100 @@ -61,9 +61,14 @@ std::string tmpX = boost::lexical_cast(physicalX); std::string tmpY = boost::lexical_cast(physicalY); std::string tmpZ = boost::lexical_cast(physicalZ); + + // NB: Method DcmItem::putAndInsertUint32Array() should be used at + // this point, but it is missing in DCMTK 3.6.0 + std::string index = (boost::lexical_cast(x / GetTileWidth() + 1) + "\\" + + boost::lexical_cast(y / GetTileHeight() + 1)); std::auto_ptr dimension(new DcmItem); - if (!dimension->putAndInsertUint32(DCM_DimensionIndexValues, frame).good()) + if (!dimension->putAndInsertString(DCM_DimensionIndexValues, index.c_str()).good()) { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } diff -r 0cb3ac4f9159 -r 727670c5c125 NEWS --- a/NEWS Thu Dec 15 11:51:58 2016 +0100 +++ b/NEWS Thu Dec 15 12:36:20 2016 +0100 @@ -1,6 +1,10 @@ Pending changes in the mainline =============================== +* Thanks to David Clunie's feedback: + - Fix generation of tag "Dimension Index Sequence" (0020,9222) + - Fix generation of tag "Dimension Index Values" (0020,9157) + Version 0.2 (2016/11/28) ========================