Mercurial > hg > orthanc-wsi
changeset 84:727670c5c125
fix generation of "Dimension Index Sequence" and "Dimension Index Values"
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 15 Dec 2016 12:36:20 +0100 |
parents | 0cb3ac4f9159 |
children | 8a20cd67b283 |
files | Applications/Dicomizer.cpp Framework/Outputs/DicomPyramidWriter.cpp NEWS |
diffstat | 3 files changed, 18 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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<DcmItem> 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<DcmItem> 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<DcmSequenceOfItems> 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);
--- 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<std::string>(physicalX); std::string tmpY = boost::lexical_cast<std::string>(physicalY); std::string tmpZ = boost::lexical_cast<std::string>(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<std::string>(x / GetTileWidth() + 1) + "\\" + + boost::lexical_cast<std::string>(y / GetTileHeight() + 1)); std::auto_ptr<DcmItem> 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); }
--- 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) ========================