[Gdcm-hackers] gdcm-git:Grassroots DICOM branch release updated. ce9c7aab2384b6f27a7ea93345cfa0f142
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Mathieu M. <ma...@us...> - 2020-06-25 10:06:08
|
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 ce9c7aab2384b6f27a7ea93345cfa0f1423cfb7e (commit)
from a464527c170c7f4f86bc26f38f5ae1465c6dd741 (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/ce9c7aab2384b6f27a7ea93345cfa0f1423cfb7e/
commit ce9c7aab2384b6f27a7ea93345cfa0f1423cfb7e
Author: Mathieu Malaterre <mat...@gm...>
Date: Thu Jun 25 12:05:50 2020 +0200
Fix bug #485
diff --git a/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx b/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx
index 07aaf63ac..1ec306558 100644
--- a/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx
@@ -42,6 +42,13 @@ std::string StringFilter::ToString(const Tag& t) const
return ToStringPair(t).second;
}
+std::string StringFilter::ToString(const PrivateTag& privTag) const
+{
+ const DataSet &ds = GetFile().GetDataSet();
+ const DataElement &de = ds.GetDataElement(privTag);
+ return ToStringPair(de).second;
+}
+
std::string StringFilter::ToString(const DataElement& de) const
{
return ToStringPair(de).second;
diff --git a/Source/MediaStorageAndFileFormat/gdcmStringFilter.h b/Source/MediaStorageAndFileFormat/gdcmStringFilter.h
index 2531fc7a5..6abf493eb 100644
--- a/Source/MediaStorageAndFileFormat/gdcmStringFilter.h
+++ b/Source/MediaStorageAndFileFormat/gdcmStringFilter.h
@@ -46,6 +46,8 @@ public:
/// Directly from a Tag:
std::string ToString(const Tag& t) const;
+ std::string ToString(const PrivateTag& t) const;
+
/// Convert to string the ByteValue contained in a DataElement
/// the returned elements are:
/// pair.first : the name as found in the dictionary of DataElement
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/CMakeLists.txt b/Testing/Source/MediaStorageAndFileFormat/Cxx/CMakeLists.txt
index b46cb7c6d..2b10ffb47 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/CMakeLists.txt
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/CMakeLists.txt
@@ -60,6 +60,7 @@ set(MSFF_TEST_SRCS
TestStringFilter1
TestStringFilter2
TestStringFilter3
+ TestStringFilter4
TestUIDGenerator
TestUUIDGenerator
#TestUIDGenerator3
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStringFilter4.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStringFilter4.cxx
new file mode 100644
index 000000000..8507bb2c0
--- /dev/null
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStringFilter4.cxx
@@ -0,0 +1,53 @@
+/*=========================================================================
+
+ Program: GDCM (Grassroots DICOM). A DICOM library
+
+ Copyright (c) 2006-2011 Mathieu Malaterre
+ All rights reserved.
+ See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notice for more information.
+
+=========================================================================*/
+#include "gdcmStringFilter.h"
+#include "gdcmAttribute.h"
+#include "gdcmSmartPointer.h"
+
+// https://sourceforge.net/p/gdcm/bugs/485/
+int TestStringFilter4(int , char *[])
+{
+ gdcm::SmartPointer<gdcm::File> f = new gdcm::File;
+ gdcm::DataSet & ds = f->GetDataSet();
+
+ {
+ gdcm::Element<gdcm::VR::LO,gdcm::VM::VM1> priv_creator;
+ priv_creator.SetValue( "SIEMENS MED SP DXMG WH AWS 1" );
+ gdcm::DataElement de1 = priv_creator.GetAsDataElement();
+ de1.SetTag( gdcm::Tag(0x19,0x10) );
+ ds.Insert( de1 );
+
+ gdcm::Element<gdcm::VR::ST,gdcm::VM::VM1> el;
+ el.SetValue( "TestStringFilter4" );
+ gdcm::DataElement de2 = el.GetAsDataElement();
+ de2.SetTag( gdcm::Tag(0x19,0x1010) );
+ ds.Insert( de2 );
+ // std::cout << ds << std::endl;
+
+ gdcm::StringFilter filter;
+ filter.SetFile(*f);
+
+ gdcm::PrivateTag privTag(0x0019, 0x10, "SIEMENS MED SP DXMG WH AWS 1");
+
+ // Works as intended
+ std::string privTagValue1 = filter.ToString(ds.GetDataElement(privTag));
+ std::cout << privTagValue1 << std::endl;
+
+ // Does not work, returns string value of the private creator instead of the actual tag
+ std::string privTagValue2 = filter.ToString(privTag);
+ std::cout << privTagValue2 << std::endl;
+ }
+
+ return 0;
+}
-----------------------------------------------------------------------
Summary of changes:
.../MediaStorageAndFileFormat/gdcmStringFilter.cxx | 7 +++
.../MediaStorageAndFileFormat/gdcmStringFilter.h | 2 +
.../MediaStorageAndFileFormat/Cxx/CMakeLists.txt | 1 +
.../Cxx/TestStringFilter4.cxx | 53 ++++++++++++++++++++++
4 files changed, 63 insertions(+)
create mode 100644 Testing/Source/MediaStorageAndFileFormat/Cxx/TestStringFilter4.cxx
hooks/post-receive
--
Grassroots DICOM
|