# HG changeset patch # User Sebastien Jodogne # Date 1562928806 -7200 # Node ID de783db2a7c301d998f0488fa704a0830cb01de1 # Parent d3aea0af03e1e80f59264f940ab0567ba2d0d836 making fix for issue #139 permanent diff -r d3aea0af03e1 -r de783db2a7c3 Applications/Dicomizer.cpp --- 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(source.GetLevelHeight(0)); - float spacingY = volume.GetHeight() / static_cast(source.GetLevelWidth(0)); - - std::string spacing = (boost::lexical_cast(spacingX) + '\\' + - boost::lexical_cast(spacingY)); - - std::auto_ptr item(new DcmItem); - - std::auto_ptr item2(new DcmItem); - OrthancWSI::DicomToolbox::SetStringTag(*item2, DCM_SliceThickness, - boost::lexical_cast(volume.GetDepth())); - OrthancWSI::DicomToolbox::SetStringTag(*item2, DCM_PixelSpacing, spacing); - - std::auto_ptr item3(new DcmItem); - OrthancWSI::DicomToolbox::SetStringTag(*item3, DCM_OpticalPathIdentifier, opticalPathId); - - std::auto_ptr sequence(new DcmSequenceOfItems(DCM_SharedFunctionalGroupsSequence)); - std::auto_ptr sequence2(new DcmSequenceOfItems(DCM_PixelMeasuresSequence)); - std::auto_ptr 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 item(new DcmItem); std::auto_ptr item3(new DcmItem); @@ -437,7 +404,6 @@ { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } -#endif } } diff -r d3aea0af03e1 -r de783db2a7c3 Framework/Outputs/DicomPyramidWriter.cpp --- 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 functionalGroup(CreateFunctionalGroup(writer->GetFramesCount() + 1, diff -r d3aea0af03e1 -r de783db2a7c3 NEWS --- 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)