[Gdcm-hackers] gdcm-git:Grassroots DICOM branch release updated. 6d7c523ae2370d22d8dc4b17ee5761fb3a
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: malat <ma...@us...> - 2025-05-26 09:14:28
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Grassroots DICOM".
The branch, release has been updated
via 6d7c523ae2370d22d8dc4b17ee5761fb3a33568a (commit)
from 5d704e22a47704a05954566d92f21fa7fcaec542 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceforge.net/p/gdcm/gdcm/ci/6d7c523ae2370d22d8dc4b17ee5761fb3a33568a/
commit 6d7c523ae2370d22d8dc4b17ee5761fb3a33568a
Author: Mathieu Malaterre <mat...@gm...>
Date: Mon May 26 11:13:49 2025 +0200
Handle latest change from PMS
diff --git a/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx b/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx
index a464bea5e..f154f06d0 100644
--- a/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx
@@ -1047,6 +1047,18 @@ void ImageHelper::SetDimensionsValue(File& f, const Pixmap & img)
}
+// We need special care to handle VR:FD -> VR:DS conversion
+static double fd2ds(const double d)
+{
+ Element<VR::DS,VM::VM1> in = {{ 0 }};
+ in.SetValue( d );
+ std::stringstream ss;
+ in.Write( ss );
+ Element<VR::DS,VM::VM1> out = {{ 0 }};
+ out.Read( ss );
+ return out.GetValue();
+}
+
std::vector<double> ImageHelper::GetRescaleInterceptSlopeValue(File const & f)
{
std::vector<double> interceptslope;
@@ -1210,6 +1222,34 @@ std::vector<double> ImageHelper::GetRescaleInterceptSlopeValue(File const & f)
gdcmDebugMacro( "Forcing Modality LUT used for MR Image Storage: [" << dummy[0] << "," << dummy[1] << "]" );
}
}
+ else
+ {
+ const Tag trwvms(0x0040,0x9096); // Real World Value Mapping Sequence
+ if( ds.FindDataElement( trwvms ) )
+ {
+ SmartPointer<SequenceOfItems> sqi = ds.GetDataElement( trwvms ).GetValueAsSQ();
+ if( sqi )
+ {
+ const Tag trwvlutd(0x0040,0x9212); // Real World Value LUT Data
+ if( ds.FindDataElement( trwvlutd ) )
+ {
+ gdcmAssertAlwaysMacro(0); // Not supported !
+ }
+ // don't know how to handle multiples:
+ gdcmAssertAlwaysMacro( sqi->GetNumberOfItems() == 1 );
+ const Item &item = sqi->GetItem(1);
+ const DataSet & subds = item.GetNestedDataSet();
+ //const Tag trwvi(0x0040,0x9224); // Real World Value Intercept
+ //const Tag trwvs(0x0040,0x9225); // Real World Value Slope
+ Attribute<0x0040,0x9224> at1 = {0};
+ at1.SetFromDataSet( subds );
+ Attribute<0x0040,0x9225> at2 = {1};
+ at2.SetFromDataSet( subds );
+ interceptslope[0] = fd2ds(at1.GetValue());
+ interceptslope[1] = fd2ds(at2.GetValue());
+ }
+ }
+ }
}
#endif
}
-----------------------------------------------------------------------
Summary of changes:
.../MediaStorageAndFileFormat/gdcmImageHelper.cxx | 40 ++++++++++++++++++++++
1 file changed, 40 insertions(+)
hooks/post-receive
--
Grassroots DICOM
|