[Gdcm-hackers] gdcm-git:Grassroots DICOM branch master updated. 87e910683561a8fd3dc7f97092fd3753cfe
Cross-platform DICOM implementation
Brought to you by:
malat
From: Mathieu M. <ma...@us...> - 2017-09-13 11:51:11
|
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, master has been updated via 87e910683561a8fd3dc7f97092fd3753cfef4385 (commit) via 618632fb29c0c98efa4761bdf03ce299a957d036 (commit) via 20c23dfe82225a0819e7cda65ee1a8a87376d34f (commit) via a7a143820d70175f178e17f41aec54a57a8cd5a8 (commit) via 0f5a97363f2b3b7fa2318d9dd140f135ee6b397c (commit) from db11da2832b6bfff4e54e08c0d14f362230675a7 (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/87e910683561a8fd3dc7f97092fd3753cfef4385/ commit 87e910683561a8fd3dc7f97092fd3753cfef4385 Merge: 20c23df 618632f Author: Mathieu Malaterre <mat...@gm...> Date: Wed Sep 13 13:50:59 2017 +0200 Merge branch 'release' https://sourceforge.net/p/gdcm/gdcm/ci/20c23dfe82225a0819e7cda65ee1a8a87376d34f/ commit 20c23dfe82225a0819e7cda65ee1a8a87376d34f Author: Mathieu Malaterre <mat...@gm...> Date: Wed Sep 13 11:37:48 2017 +0200 Add CXX dump mode diff --git a/Source/MediaStorageAndFileFormat/gdcmDictPrinter.cxx b/Source/MediaStorageAndFileFormat/gdcmDictPrinter.cxx index 4f224d9..5d67ac8 100644 --- a/Source/MediaStorageAndFileFormat/gdcmDictPrinter.cxx +++ b/Source/MediaStorageAndFileFormat/gdcmDictPrinter.cxx @@ -23,6 +23,7 @@ namespace gdcm //----------------------------------------------------------------------------- DictPrinter::DictPrinter() { + PrintStyle = XML; } //----------------------------------------------------------------------------- @@ -429,7 +430,7 @@ std::string GetOwner(DataSet const &ds, DataElement const &de) return ds.GetPrivateCreator(de.GetTag()); } -void DictPrinter::PrintDataElement2(std::ostream& os, const DataSet &ds, const DataElement &de) +void DictPrinter::PrintDataElement2(std::ostream& os, const DataSet &ds, const DataElement &de, PrintStyles ps) { const Global& g = GlobalInstance; const Dicts &dicts = g.GetDicts(); @@ -466,17 +467,33 @@ void DictPrinter::PrintDataElement2(std::ostream& os, const DataSet &ds, const D } VM vm = GuessVMType(de); - os << - "<entry group=\"" << std::hex << std::setw(4) << std::setfill('0') << - t.GetGroup() << "\" element=\"" << std::setw(4) << ((uint16_t)(t.GetElement() << 8) >> 8) << "\" "; - - os << "vr=\"" << pvr << "\" vm=\"" << vm << "\" "; - //os << "\" retired=\"false\"; + if( ps == XML ) + { + os << + "<entry group=\"" << std::hex << std::setw(4) << std::setfill('0') << + t.GetGroup() << "\" element=\"" << std::setw(4) << ((uint16_t)(t.GetElement() << 8) >> 8) << "\" "; + os << "vr=\"" << pvr << "\" vm=\"" << vm << "\" "; if( de.GetTag().IsPrivate() ) { os << "name=\"?\" owner=\"" << owner << /*"\" version=\"" << version << */ "\"/>\n"; } + } + else if ( ps == CXX ) + { + os << + "{0x" << std::hex << std::setw(4) << std::setfill('0') << + t.GetGroup() << ",0x" << std::setw(4) << ((uint16_t)(t.GetElement() << 8) >> 8) << ","; + if( de.GetTag().IsPrivate() ) + { + os << "\"" << owner + << "\","; + } + std::string vm_str = VM::GetVMString(vm); + std::replace( vm_str.begin(), vm_str.end(), '-', '_'); + os << "VR::" << pvr << ",VM::VM" << vm_str << ",\"??\",false},\n"; + } + //os << "\n <description>?</description>\n"; //os << "</entry>\n"; //os << "/>\n"; @@ -513,7 +530,7 @@ void DictPrinter::PrintDataSet2(std::ostream& os, const DataSet &ds) for( ; it != ds.End(); ++it ) { const DataElement &de = *it; - PrintDataElement2(os, ds, de); + PrintDataElement2(os, ds, de, PrintStyle); } } diff --git a/Source/MediaStorageAndFileFormat/gdcmDictPrinter.h b/Source/MediaStorageAndFileFormat/gdcmDictPrinter.h index 5287f30..245c2b0 100644 --- a/Source/MediaStorageAndFileFormat/gdcmDictPrinter.h +++ b/Source/MediaStorageAndFileFormat/gdcmDictPrinter.h @@ -29,11 +29,28 @@ public: DictPrinter(); ~DictPrinter(); + typedef enum { + XML, // default + CXX + } PrintStyles; + void Print(std::ostream& os); + /// Set PrintStyle value + void SetStyle(PrintStyles ps) { + PrintStyle = ps; + } + + /// Get PrintStyle value + PrintStyles GetPrintStyle() const { + return PrintStyle; + } + protected: - void PrintDataElement2(std::ostream& os, const DataSet &ds, const DataElement &ide); + void PrintDataElement2(std::ostream& os, const DataSet &ds, const DataElement &ide, PrintStyles ps); void PrintDataSet2(std::ostream& os, const DataSet &ds); +private: + PrintStyles PrintStyle; }; } // end namespace gdcm ----------------------------------------------------------------------- Summary of changes: Source/DataDictionary/gdcmPrivateDefaultDicts.cxx | 84 ++++++++++++++++++++++ .../MediaStorageAndFileFormat/gdcmDictPrinter.cxx | 33 ++++++--- Source/MediaStorageAndFileFormat/gdcmDictPrinter.h | 19 ++++- Utilities/doxygen/man/gdcmdump.xml | 3 +- 4 files changed, 129 insertions(+), 10 deletions(-) hooks/post-receive -- Grassroots DICOM |