[Gdcm-hackers] gdcm-git:Grassroots DICOM branch release updated. d897859250c689f4d10b1eaf3e35b77581
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: malat <ma...@us...> - 2023-04-04 07:39:58
|
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 d897859250c689f4d10b1eaf3e35b7758178b47e (commit)
from 82fde6101b912977cbf6a27a5ff4842be1643318 (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/d897859250c689f4d10b1eaf3e35b7758178b47e/
commit d897859250c689f4d10b1eaf3e35b7758178b47e
Author: Mathieu Malaterre <mat...@gm...>
Date: Tue Apr 4 00:39:06 2023 -0700
Handle poor anonymizer case
diff --git a/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx b/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx
index b0f6ae304..3aa173f13 100644
--- a/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx
@@ -888,13 +888,24 @@ static bool CleanCSAImage(DataSet &ds, const DataElement &de) {
CSAImageHeaderTypeStrings);
}
static const char sv10[] = "SV10\4\3\2\1"; // 8
+ // what if a dumb anonymizer removed the CSA Image Header Type:
+ bool isSV10 = false;
+ if (image_type == IMAGE_UNK) {
+ if (is_signature(bv, sv10)) {
+ if (!ref.empty()) {
+ gdcmWarningMacro(
+ "Please report. SV10 Header found for new type: " << ref);
+ }
+ isSV10 = true;
+ }
+ }
// easy case: recognized keywords:
if (image_type == IMAGE_NUM_4 // MR Image Storage / NUMARIS/4
|| image_type == IMAGE_MR // Enhanced SR Storage
|| image_type == NONIMAGE_NUM_4 // CSA Non-Image Storage
|| image_type == PET_NUM_4 // Positron Emission Tomography Image Storage
- ) {
+ || isSV10) {
DataElement clean(de.GetTag());
clean.SetVR(de.GetVR());
std::vector<char> v;
@@ -918,10 +929,8 @@ static bool CleanCSAImage(DataSet &ds, const DataElement &de) {
// else
// add a dummy check for SV10 signature
if (is_signature(bv, sv10)) {
- if (image_type == IMAGE_UNK) {
- gdcmErrorMacro("Please report. SV10 Header found for new type: " << ref);
- return false;
- }
+ gdcmErrorMacro("Failure to clean SV10 Header for type: " << ref);
+ return false;
}
return true;
}
@@ -939,9 +948,20 @@ static bool CleanCSASeries(DataSet &ds, const DataElement &de) {
CSASeriesHeaderTypeStrings);
}
static const char sv10[] = "SV10\4\3\2\1"; // 8
+ // what if a dumb anonymizer removed the CSA Series Header Type:
+ bool isSV10 = false;
+ if (series_type == SERIES_UNK) {
+ if (is_signature(bv, sv10)) {
+ if (!ref.empty()) {
+ gdcmWarningMacro(
+ "Please report. SV10 Header found for new type: " << ref);
+ }
+ isSV10 = true;
+ }
+ }
// easy case: recognized keywords:
- if (series_type == PT || series_type == SERIES_MR) {
+ if (series_type == PT || series_type == SERIES_MR || isSV10) {
DataElement clean(de.GetTag());
clean.SetVR(de.GetVR());
std::vector<char> v;
@@ -965,10 +985,8 @@ static bool CleanCSASeries(DataSet &ds, const DataElement &de) {
// else
// add a dummy check for SV10 signature
if (is_signature(bv, sv10)) {
- if (series_type == SERIES_UNK) {
- gdcmErrorMacro("Please report. SV10 Header found for new type: " << ref);
- return false;
- }
+ gdcmErrorMacro("Failure to clean SV10 Header for type: " << ref);
+ return false;
}
return true;
}
-----------------------------------------------------------------------
Summary of changes:
Source/MediaStorageAndFileFormat/gdcmCleaner.cxx | 38 +++++++++++++++++-------
1 file changed, 28 insertions(+), 10 deletions(-)
hooks/post-receive
--
Grassroots DICOM
|