[Gdcm-hackers] gdcm-git:Grassroots DICOM branch release updated. 4c9220ed971f01a9df1396dadfedd74c90
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Mathieu M. <ma...@us...> - 2020-03-20 15:21:51
|
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 4c9220ed971f01a9df1396dadfedd74c90b9faab (commit)
via c6a84d0c2f8704e8c2620d936332c3f8652cfb87 (commit)
via 5e1a5a65831d4d793e7bcfc7a54c8d5358c90f75 (commit)
via e429ef9a830adecff14304e14002f856457482da (commit)
via 081616400886d3b6e516c91632e139f487b69e7d (commit)
via b1b806cdf19e74c8b0548af4eb74d3d53db46b1c (commit)
via 7e3be76f17521d4124eb97ca0cddcda5f4c623bb (commit)
from fd508a2716131fc5dd069de7b584efb03ee3a8e7 (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/4c9220ed971f01a9df1396dadfedd74c90b9faab/
commit 4c9220ed971f01a9df1396dadfedd74c90b9faab
Merge: 5e1a5a658 c6a84d0c2
Author: Mathieu Malaterre <mat...@gm...>
Date: Fri Mar 20 16:21:39 2020 +0100
Merge branch 'release-2-8' into release
https://sourceforge.net/p/gdcm/gdcm/ci/c6a84d0c2f8704e8c2620d936332c3f8652cfb87/
commit c6a84d0c2f8704e8c2620d936332c3f8652cfb87
Author: Mathieu Malaterre <mat...@gm...>
Date: Fri Mar 20 16:05:12 2020 +0100
VR:OB when in encapsulated format
diff --git a/Source/MediaStorageAndFileFormat/gdcmPixmapWriter.cxx b/Source/MediaStorageAndFileFormat/gdcmPixmapWriter.cxx
index 57f602633..9f0810f22 100644
--- a/Source/MediaStorageAndFileFormat/gdcmPixmapWriter.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmPixmapWriter.cxx
@@ -610,7 +610,10 @@ bool PixmapWriter::PrepareWrite( MediaStorage const & ref_ms )
case 12:
case 16:
case 32:
- depixdata.SetVR( VR::OW );
+ if( depixdata.GetSequenceOfFragments() )
+ depixdata.SetVR( VR::OB );
+ else
+ depixdata.SetVR( VR::OW );
break;
default:
assert( 0 && "should not happen" );
https://sourceforge.net/p/gdcm/gdcm/ci/5e1a5a65831d4d793e7bcfc7a54c8d5358c90f75/
commit 5e1a5a65831d4d793e7bcfc7a54c8d5358c90f75
Author: Mathieu Malaterre <mat...@gm...>
Date: Fri Mar 20 15:17:38 2020 +0100
Revert "Better handling of encapsulated Pixel Data"
This reverts commit e429ef9a830adecff14304e14002f856457482da.
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx b/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx
index f17f512f3..45301ac5e 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx
@@ -15,7 +15,6 @@
#define GDCMDATASET_TXX
#include "gdcmByteValue.h"
-#include "gdcmSequenceOfFragments.h"
#include "gdcmPrivateTag.h"
#include "gdcmParseException.h"
@@ -434,24 +433,11 @@ namespace gdcm_ns
gdcmAssertAlwaysMacro( pd.GetTag() == Tag(0x7fe0,0x0010) );
gdcmAssertAlwaysMacro( pd.GetVR() == VR::OB );
gdcmAssertAlwaysMacro( pd.IsUndefinedLength() );
- const VL fraglen = locallength - l - 12;
-#if 1
- Fragment frag;
- frag.SetVL( fraglen );
- frag.template ReadValue<TSwap>(is);
- SmartPointer<SequenceOfFragments> sqf = new SequenceOfFragments;
- sqf->AddFragment(frag);
- pd.SetValue( *sqf );
- InsertDataElement( pd );
- length = locallength = l;
- gdcmWarningMacro( "Item length is wrong" );
- throw Exception( "Changed Length" );
-#else
- pd.SetVL( fraglen );
+ const VL pdlen = locallength - l - 12;
+ pd.SetVL( pdlen );
pd.template ReadValue<TSwap>(is, true);
InsertDataElement( pd );
length = locallength = l;
-#endif
}
else
{
https://sourceforge.net/p/gdcm/gdcm/ci/e429ef9a830adecff14304e14002f856457482da/
commit e429ef9a830adecff14304e14002f856457482da
Author: Mathieu Malaterre <mat...@gm...>
Date: Fri Mar 20 15:02:54 2020 +0100
Better handling of encapsulated Pixel Data
When VL is undefined try to load the Pixel Data as Encapsulated, craft an empty Basic Offset Table
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx b/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx
index 45301ac5e..f17f512f3 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx
@@ -15,6 +15,7 @@
#define GDCMDATASET_TXX
#include "gdcmByteValue.h"
+#include "gdcmSequenceOfFragments.h"
#include "gdcmPrivateTag.h"
#include "gdcmParseException.h"
@@ -433,11 +434,24 @@ namespace gdcm_ns
gdcmAssertAlwaysMacro( pd.GetTag() == Tag(0x7fe0,0x0010) );
gdcmAssertAlwaysMacro( pd.GetVR() == VR::OB );
gdcmAssertAlwaysMacro( pd.IsUndefinedLength() );
- const VL pdlen = locallength - l - 12;
- pd.SetVL( pdlen );
+ const VL fraglen = locallength - l - 12;
+#if 1
+ Fragment frag;
+ frag.SetVL( fraglen );
+ frag.template ReadValue<TSwap>(is);
+ SmartPointer<SequenceOfFragments> sqf = new SequenceOfFragments;
+ sqf->AddFragment(frag);
+ pd.SetValue( *sqf );
+ InsertDataElement( pd );
+ length = locallength = l;
+ gdcmWarningMacro( "Item length is wrong" );
+ throw Exception( "Changed Length" );
+#else
+ pd.SetVL( fraglen );
pd.template ReadValue<TSwap>(is, true);
InsertDataElement( pd );
length = locallength = l;
+#endif
}
else
{
https://sourceforge.net/p/gdcm/gdcm/ci/081616400886d3b6e516c91632e139f487b69e7d/
commit 081616400886d3b6e516c91632e139f487b69e7d
Author: Mathieu Malaterre <mat...@gm...>
Date: Fri Mar 20 15:17:18 2020 +0100
Update code location
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx b/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx
index 4acdcc69d..45301ac5e 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx
@@ -421,7 +421,9 @@ namespace gdcm_ns
}
else if( /*pe.GetLastElement().GetTag() == Tag(0xffd8,0xffe0) &&*/ de.GetTag() == Tag(0x7fe0,0x0010) && de.IsUndefinedLength() )
{
+ // Bug_Siemens_PrivateIconNoItem.dcm
// PET-GE-dicomwrite-PixelDataSQUN.dcm
+ // PET-GE-dicomwrite-PixelDataSQUNv2.dcm
// some bozo crafted an undefined length Pixel Data but is actually
// defined length. Since inside SQ/Item it should be possible to
// compute the proper length
https://sourceforge.net/p/gdcm/gdcm/ci/b1b806cdf19e74c8b0548af4eb74d3d53db46b1c/
commit b1b806cdf19e74c8b0548af4eb74d3d53db46b1c
Author: Mathieu Malaterre <mat...@gm...>
Date: Fri Mar 20 15:02:02 2020 +0100
Remvoe extra assert()
The whole point of this code path is to recompute invalid Sequence Length
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmExplicitDataElement.txx b/Source/DataStructureAndEncodingDefinition/gdcmExplicitDataElement.txx
index f92a5c1e8..0d28e74d2 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmExplicitDataElement.txx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmExplicitDataElement.txx
@@ -339,7 +339,6 @@ std::istream &ExplicitDataElement::ReadValue(std::istream &is, bool readvalues)
#ifdef GDCM_SUPPORT_BROKEN_IMPLEMENTATION
if( SequenceOfItems *sqi = dynamic_cast<SequenceOfItems*>(&GetValue()) )
{
- assert( ValueField->GetLength() == ValueLengthField );
// Recompute the total length:
if( !ValueLengthField.IsUndefined() )
{
https://sourceforge.net/p/gdcm/gdcm/ci/7e3be76f17521d4124eb97ca0cddcda5f4c623bb/
commit 7e3be76f17521d4124eb97ca0cddcda5f4c623bb
Author: Mathieu Malaterre <mat...@gm...>
Date: Thu Oct 24 08:54:09 2019 +0200
Handle the case where Slope is negative
diff --git a/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx b/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx
index b03accd30..0db715e78 100644
--- a/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx
@@ -129,8 +129,11 @@ static inline PixelFormat::ScalarType ComputeBestFit(const PixelFormat &pf, doub
PixelFormat::ScalarType st = PixelFormat::UNKNOWN;
assert( slope == (int)slope && intercept == (int)intercept);
- const double min = slope * (double)pf.GetMin() + intercept;
- const double max = slope * (double)pf.GetMax() + intercept;
+ assert( pf.GetMin() <= pf.GetMax() );
+ const double pfmin = slope >= 0 ? pf.GetMin() : pf.GetMax();
+ const double pfmax = slope >= 0 ? pf.GetMax() : pf.GetMin();
+ const double min = slope * pfmin + intercept;
+ const double max = slope * pfmax + intercept;
assert( min <= max );
assert( min == (int64_t)min && max == (int64_t)max );
if( min >= 0 ) // unsigned
@@ -402,8 +405,14 @@ static PixelFormat ComputeInverseBestFitFromMinMax(/*const PixelFormat &pf,*/ do
PixelFormat st = PixelFormat::UNKNOWN;
//assert( slope == (int)slope && intercept == (int)intercept);
+ assert( _min <= _max );
double dmin = (_min - intercept ) / slope;
double dmax = (_max - intercept ) / slope;
+ if( slope < 0 )
+ {
+ dmin = (_max - intercept ) / slope;
+ dmax = (_min - intercept ) / slope;
+ }
assert( dmin <= dmax );
assert( dmax <= std::numeric_limits<int64_t>::max() );
assert( dmin >= std::numeric_limits<int64_t>::min() );
-----------------------------------------------------------------------
Summary of changes:
Source/DataStructureAndEncodingDefinition/gdcmDataSet.txx | 2 ++
.../DataStructureAndEncodingDefinition/gdcmExplicitDataElement.txx | 1 -
Source/MediaStorageAndFileFormat/gdcmPixmapWriter.cxx | 5 ++++-
3 files changed, 6 insertions(+), 2 deletions(-)
hooks/post-receive
--
Grassroots DICOM
|