Skip to content

Commit 2664155

Browse files
thewtexissakomimalaterrepieper
committed
Check for Secondary Capture spacing following DICOM Part 3 Sect A.8.1.3
Following the Secondary Capture Image IOD Module Note: > If Image Position (Patient) (0020,0032) and Image Orientation (Patient) (0020,0037) (from the Image Plane Module) are present, then the values of Pixel Spacing (0028,0030) (from the Image Plane Module and the Basic Pixel Spacing Calibration Macro included from the SC Image Module) are intended to be used for 3D spatial computations, rather than any values of Nominal Scanned Pixel Spacing (0018,2010) (from the SC Image Module), which may also be present. However, we make sure to throw a warning in `ImageHelper::GetSpacingTagFromMediaStorage` when the tag for a Secondary Capture MediaStorage is requested and SecondaryCaptureImagePlaneModule is enabled because returning a single tag is insufficient for this requirement. This function should not be called on this type of media storage. Co-authored-by: Mihail Isakov <[email protected]> Co-authored-by: Mathieu Malaterre <[email protected]> Co-authored-by: Steve Pieper <[email protected]>
1 parent 1b6207d commit 2664155

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx

+22-1
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,9 @@ Tag ImageHelper::GetSpacingTagFromMediaStorage(MediaStorage const &ms)
12781278
if( ImageHelper::SecondaryCaptureImagePlaneModule ) {
12791279
// Make SecondaryCaptureImagePlaneModule act as ForcePixelSpacing
12801280
// This is different from Basic Pixel Spacing Calibration Macro Attributes
1281+
//
1282+
// Per the note: https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_A.8.html#sect_A.8.1.3
1283+
gdcmWarningMacro( "FIXME: Multiple tags can identify Secondary Capture spacing. This function should not be used for Secondary Capture data." );
12811284
t = Tag(0x0028,0x0030);
12821285
} else {
12831286
t = Tag(0x0018,0x2010);
@@ -1471,7 +1474,25 @@ std::vector<double> ImageHelper::GetSpacingValue(File const & f)
14711474
}
14721475
}
14731476

1474-
Tag spacingtag = GetSpacingTagFromMediaStorage(ms);
1477+
Tag spacingtag = Tag(0xffff,0xffff);
1478+
if( ms == MediaStorage::SecondaryCaptureImageStorage && SecondaryCaptureImagePlaneModule )
1479+
{
1480+
// See the note: https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_A.8.html#sect_A.8.1.3
1481+
if( ds.FindDataElement( Tag(0x0028,0x0030) ) )
1482+
{
1483+
// Type 1C in 'SC Image' (for calibrated images)
1484+
spacingtag = Tag(0x0028,0x0030);
1485+
}
1486+
else if( ds.FindDataElement( Tag(0x0018,0x2010) ) )
1487+
{
1488+
// Type 3 in 'SC Image'
1489+
spacingtag = Tag(0x0018,0x2010);
1490+
}
1491+
}
1492+
else
1493+
{
1494+
spacingtag = GetSpacingTagFromMediaStorage(ms);
1495+
}
14751496
if( spacingtag != Tag(0xffff,0xffff) && ds.FindDataElement( spacingtag ) && !ds.GetDataElement( spacingtag ).IsEmpty() )
14761497
{
14771498
const DataElement& de = ds.GetDataElement( spacingtag );

0 commit comments

Comments
 (0)