[Gdcm-hackers] gdcm-git:Grassroots DICOM branch release updated. a09ffc6f760b8fbd5c2d13b0e3d5c4da36
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Mathieu M. <ma...@us...> - 2017-02-06 17:41:13
|
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 a09ffc6f760b8fbd5c2d13b0e3d5c4da3631caad (commit)
from 27fc1593a9d4433d5d0f5ec21fc1aada6ddcc1da (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/a09ffc6f760b8fbd5c2d13b0e3d5c4da3631caad/
commit a09ffc6f760b8fbd5c2d13b0e3d5c4da3631caad
Author: Mathieu Malaterre <mat...@gm...>
Date: Mon Feb 6 18:40:23 2017 +0100
Better support for SDS
diff --git a/Applications/Cxx/gdcmdump.cxx b/Applications/Cxx/gdcmdump.cxx
index 20a40b6..459c90e 100644
--- a/Applications/Cxx/gdcmdump.cxx
+++ b/Applications/Cxx/gdcmdump.cxx
@@ -144,11 +144,54 @@ static void printbinary(std::istream &is, PDFElement const & pdfel )
printvalue(is, type, numels, pos);
}
+static void ProcessSDSDataInt( std::istream & is )
+{
+ (void)is;
+ std::cerr << "TODO" << std::endl;
+}
+
+// see read_direct_string / read_direct_int
+static void ProcessSDSDataString( std::istream & is )
+{
+ (void)is;
+#if 0
+ int32_t v1;
+ is.read( (char*)&v1,sizeof(v1));
+ assert( v1 == 0x1 );
+ uint32_t bla;
+ is.read( (char*)&bla, sizeof(bla) );
+ char name0[32];
+ memset(name0,0,sizeof(name0));
+ assert( bla < sizeof(name0) );
+ is.read( name0, bla);
+ size_t l = strlen(name0);
+ assert( l == bla );
+ std::cerr << "name0:" << name0 << std::endl;
+
+ is.read( (char*)&bla, sizeof(bla) );
+ assert( bla == 0x1 );
+ is.read( (char*)&bla, sizeof(bla) );
+ char value[32];
+ memset(value,0,sizeof(value));
+ assert( bla < sizeof(value) );
+ is.read( value, bla);
+ is.read( (char*)&bla, sizeof(bla) );
+ assert( bla == 0 ); // trailing stuff ?
+ is.read( (char*)&bla, sizeof(bla) );
+ assert( bla == 0 ); // trailing stuff ?
+ const uint32_t cur = (uint32_t)is.tellg();
+ std::cerr << "offset:" << cur << std::endl;
+#else
+ std::cerr << "TODO" << std::endl;
+#endif
+}
+
static void ProcessSDSData( std::istream & is )
{
// havent been able to figure out what was the begin meant for
is.seekg( 0x20 - 8 );
uint32_t version = 0;
+ assert( sizeof(uint32_t) == 4 );
is.read( (char*)&version, sizeof(version) );
assert( version == 8 );
uint32_t numel = 0;
@@ -215,9 +258,19 @@ static int DumpPMS_MRSDS(const gdcm::DataSet & ds)
std::cout << "PMS/Item name: [" << s1 << "/" << s2 << "/" << s4 << "]" << std::endl;
if( bv3 ) {
std::istringstream is( s3 );
- ProcessSDSData( is );
+ char v1 = is.peek();
+ if( v1 == 0x1 ) {
+ if( s1 == "HARDWARE_CONFIG " )
+ ProcessSDSDataInt( is );
+ else if( s1 == "COILSTATE " )
+ ProcessSDSDataString( is );
+ else
+ assert(0);
+ } else {
+ ProcessSDSData( is );
+ }
} else {
- std::cout << " EMPTY !" << std::endl;
+ std::cout << " EMPTY !" << std::endl;
}
}
return 0;
diff --git a/Examples/Cxx/DumpExamCard.cxx b/Examples/Cxx/DumpExamCard.cxx
index 3693f54..fb321c7 100644
--- a/Examples/Cxx/DumpExamCard.cxx
+++ b/Examples/Cxx/DumpExamCard.cxx
@@ -126,32 +126,32 @@ struct header
{
is.read( (char*)&v1,sizeof(v1));
if( v1 == 0x01 ) {
- // direct (FIXME how should we detect this, much like TIFF ???)
- nints = 0;
- v3 = 0;
- v4 = 0;
- nfloats = 0;
- v6 = 0;
- nstrings = 0;
- v8 = 0;
- numparams = 0;
- uint32_t bla;
- is.read( (char*)&bla, sizeof(bla) );
- assert( bla == 0x2 );
- nstrings = 1;
- numparams = 1;
+ // direct (FIXME how should we detect this, much like TIFF ???)
+ nints = 0;
+ v3 = 0;
+ v4 = 0;
+ nfloats = 0;
+ v6 = 0;
+ nstrings = 0;
+ v8 = 0;
+ numparams = 0;
+ uint32_t bla;
+ is.read( (char*)&bla, sizeof(bla) );
+ assert( bla == 0x2 || bla == 0x3 );
+ nstrings = 1;
+ numparams = 1;
} else {
- // indirect
- is.read( (char*)&nints,sizeof(nints));
- is.read( (char*)&v3,sizeof(v3));
- assert( v3 == 0 ); // looks like this is always 0
- is.read( (char*)&v4,sizeof(v4));
- is.read( (char*)&nfloats,sizeof(nfloats));
- is.read( (char*)&v6,sizeof(v6));
- is.read( (char*)&nstrings,sizeof(nstrings));
- is.read( (char*)&v8,sizeof(v8));
- assert( v8 == 8 );
- is.read( (char*)&numparams,sizeof(numparams));
+ // indirect
+ is.read( (char*)&nints,sizeof(nints));
+ is.read( (char*)&v3,sizeof(v3));
+ assert( v3 == 0 ); // looks like this is always 0
+ is.read( (char*)&v4,sizeof(v4));
+ is.read( (char*)&nfloats,sizeof(nfloats));
+ is.read( (char*)&v6,sizeof(v6));
+ is.read( (char*)&nstrings,sizeof(nstrings));
+ is.read( (char*)&v8,sizeof(v8));
+ assert( v8 == 8 );
+ is.read( (char*)&numparams,sizeof(numparams));
}
}
void print( std::ostream & os )
@@ -226,6 +226,8 @@ struct param
std::cerr << "offset:" << cur << std::endl;
if( cur == 65 )
is.read( (char*)&bla, 1 );
+ else if( cur == 66 )
+ is.read( (char*)&bla, 1 );
else if( cur == 122 )
is.read( (char*)&bla, 2 );
else
@@ -507,16 +509,16 @@ Wotsit ?
params.push_back( p );
}
} else {
- assert( is.tellg() == std::streampos(0x20) );
- is.seekg( 0x20 );
+ assert( is.tellg() == std::streampos(0x20) );
+ is.seekg( 0x20 );
- param p;
- for( uint32_t i = 0; i < h.getnparams(); ++i )
- {
- p.read( is );
- //p.print( std::cout );
- params.push_back( p );
- }
+ param p;
+ for( uint32_t i = 0; i < h.getnparams(); ++i )
+ {
+ p.read( is );
+ //p.print( std::cout );
+ params.push_back( p );
+ }
}
std::string fn = gdcm::LOComp::Trim( s0.c_str() ); // remove trailing space
-----------------------------------------------------------------------
Summary of changes:
Applications/Cxx/gdcmdump.cxx | 57 ++++++++++++++++++++++++++++++++-
Examples/Cxx/DumpExamCard.cxx | 70 +++++++++++++++++++++--------------------
2 files changed, 91 insertions(+), 36 deletions(-)
hooks/post-receive
--
Grassroots DICOM
|