Mercurial > hg > orthanc-wsi
changeset 169:de783db2a7c3
making fix for issue #139 permanent
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 12 Jul 2019 12:53:26 +0200 |
parents | d3aea0af03e1 |
children | cea9a4701fce |
files | Applications/Dicomizer.cpp Framework/Outputs/DicomPyramidWriter.cpp NEWS |
diffstat | 3 files changed, 1 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/Applications/Dicomizer.cpp Fri Jul 12 12:51:17 2019 +0200 +++ b/Applications/Dicomizer.cpp Fri Jul 12 12:53:26 2019 +0200 @@ -389,39 +389,6 @@ { // Construct tag "Shared Functional Groups Sequence" (5200,9229) - -#if 1 - // In the 2 lines below, remember to switch X/Y when going from physical to pixel coordinates! - float spacingX = volume.GetWidth() / static_cast<float>(source.GetLevelHeight(0)); - float spacingY = volume.GetHeight() / static_cast<float>(source.GetLevelWidth(0)); - - std::string spacing = (boost::lexical_cast<std::string>(spacingX) + '\\' + - boost::lexical_cast<std::string>(spacingY)); - - std::auto_ptr<DcmItem> item(new DcmItem); - - std::auto_ptr<DcmItem> item2(new DcmItem); - OrthancWSI::DicomToolbox::SetStringTag(*item2, DCM_SliceThickness, - boost::lexical_cast<std::string>(volume.GetDepth())); - OrthancWSI::DicomToolbox::SetStringTag(*item2, DCM_PixelSpacing, spacing); - - std::auto_ptr<DcmItem> item3(new DcmItem); - OrthancWSI::DicomToolbox::SetStringTag(*item3, DCM_OpticalPathIdentifier, opticalPathId); - - std::auto_ptr<DcmSequenceOfItems> sequence(new DcmSequenceOfItems(DCM_SharedFunctionalGroupsSequence)); - std::auto_ptr<DcmSequenceOfItems> sequence2(new DcmSequenceOfItems(DCM_PixelMeasuresSequence)); - std::auto_ptr<DcmSequenceOfItems> sequence3(new DcmSequenceOfItems(DCM_OpticalPathIdentificationSequence)); - - if (!sequence2->insert(item2.release(), false, false).good() || - !sequence3->insert(item3.release(), false, false).good() || - !item->insert(sequence2.release(), false, false).good() || - !item->insert(sequence3.release(), false, false).good() || - !sequence->insert(item.release(), false, false).good() || - !dataset.insert(sequence.release(), true /* replace */, false).good()) - { - throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); - } -#else std::auto_ptr<DcmItem> item(new DcmItem); std::auto_ptr<DcmItem> item3(new DcmItem); @@ -437,7 +404,6 @@ { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } -#endif } }
--- a/Framework/Outputs/DicomPyramidWriter.cpp Fri Jul 12 12:51:17 2019 +0200 +++ b/Framework/Outputs/DicomPyramidWriter.cpp Fri Jul 12 12:53:26 2019 +0200 @@ -143,7 +143,6 @@ GetTileWidth(), GetTileHeight(), photometric_); writers_[z] = writer; -#if 0 { // Fix issue 139: The PixelSpacing information changes at each level // https://bitbucket.org/sjodogne/orthanc/issues/139/orthancwsidicomizer-pixelspacing @@ -179,7 +178,6 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } } -#endif } std::auto_ptr<DcmItem> functionalGroup(CreateFunctionalGroup(writer->GetFramesCount() + 1,
--- a/NEWS Fri Jul 12 12:51:17 2019 +0200 +++ b/NEWS Fri Jul 12 12:53:26 2019 +0200 @@ -2,6 +2,7 @@ =============================== * Improved consistency when transcoding/re-encoding is applied +* Fix issue #139 (OrthancWSIDicomizer PixelSpacing) * Fix issue #144 (OrthancWSIDicomizer PhotometricInterpretation)