Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package gdcm for openSUSE:Factory checked in 
at 2022-10-08 01:26:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gdcm (Old)
 and      /work/SRC/openSUSE:Factory/.gdcm.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gdcm"

Sat Oct  8 01:26:14 2022 rev:15 rq:1008842 version:3.0.19

Changes:
--------
--- /work/SRC/openSUSE:Factory/gdcm/gdcm.changes        2022-10-03 
20:08:03.317370488 +0200
+++ /work/SRC/openSUSE:Factory/.gdcm.new.2275/gdcm.changes      2022-10-08 
01:26:36.214419365 +0200
@@ -1,0 +2,6 @@
+Wed Oct  5 08:50:49 UTC 2022 - Axel Braun <axel.br...@gmx.de>
+
+- version 3.0.19 - no changelog
+  'Provides' Tag removed from ligdcm
+
+-------------------------------------------------------------------

Old:
----
  gdcm-3.0.18.tar.bz2

New:
----
  gdcm-3.0.19.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gdcm.spec ++++++
--- /var/tmp/diff_new_pack.BRNRgh/_old  2022-10-08 01:26:36.642420346 +0200
+++ /var/tmp/diff_new_pack.BRNRgh/_new  2022-10-08 01:26:36.646420355 +0200
@@ -20,7 +20,7 @@
 %define         soname  3_0
 %define         libsocksoname  libsocketxx1_2
 Name:           gdcm
-Version:        3.0.18
+Version:        3.0.19
 Release:        0
 Summary:        C++ library to parse DICOM medical files
 License:        BSD-3-Clause
@@ -68,7 +68,6 @@
 Summary:        DICOM medical file parser library
 Group:          System/Libraries
 Obsoletes:      gdcm-libgdcm3_0 <= 3.0.12
-Provides:       libgdcm%{soname} = %{version}
 
 %description -n libgdcm%{soname}
 This package contains the shared library required by applications that

++++++ gdcm-3.0.18.tar.bz2 -> gdcm-3.0.19.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gdcm-3.0.18/Applications/Cxx/CMakeLists.txt 
new/gdcm-3.0.19/Applications/Cxx/CMakeLists.txt
--- old/gdcm-3.0.18/Applications/Cxx/CMakeLists.txt     2022-09-14 
09:27:04.000000000 +0200
+++ new/gdcm-3.0.19/Applications/Cxx/CMakeLists.txt     2022-09-26 
08:37:26.000000000 +0200
@@ -163,6 +163,12 @@
     )
 endif()
 
+if(NOT GDCM_USE_SYSTEM_ZLIB)
+  include_directories(
+    "${GDCM_BINARY_DIR}/Utilities/gdcmzlib"
+    )
+endif()
+
 foreach(exename ${GDCM_EXECUTABLE_NAME})
   if(${exename} STREQUAL "gdcminfo")
     add_executable(${exename} ${exename}.cxx puff.c)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gdcm-3.0.18/Applications/Cxx/gdcmanon.cxx 
new/gdcm-3.0.19/Applications/Cxx/gdcmanon.cxx
--- old/gdcm-3.0.18/Applications/Cxx/gdcmanon.cxx       2022-09-14 
09:27:04.000000000 +0200
+++ new/gdcm-3.0.19/Applications/Cxx/gdcmanon.cxx       2022-09-26 
08:37:26.000000000 +0200
@@ -752,6 +752,10 @@
       std::cerr << "Input directory should be different from output directory" 
<< std::endl;
       return 1;
       }
+#ifdef _MSC_VER
+    if (outfilename.back() == '\\')
+      outfilename = outfilename.substr(0, outfilename.size() - 1);
+#endif
     if( outfilename.back() != '/' ) outfilename += '/';
     nfiles = dir.Load(filename, (recursive > 0 ? true : false));
     filenames = dir.GetFilenames();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gdcm-3.0.18/Applications/Cxx/gdcmdump.cxx 
new/gdcm-3.0.19/Applications/Cxx/gdcmdump.cxx
--- old/gdcm-3.0.18/Applications/Cxx/gdcmdump.cxx       2022-09-14 
09:27:04.000000000 +0200
+++ new/gdcm-3.0.19/Applications/Cxx/gdcmdump.cxx       2022-09-26 
08:37:26.000000000 +0200
@@ -1040,26 +1040,14 @@
   return ret;
 }
 
-static int PrintCSABase64(const std::string & filename, const char * name)
+static int PrintCSABase64Impl(gdcm::CSAHeader &csa, std::string const & 
csaname )
 {
-  gdcm::Reader reader;
-  reader.SetFileName( filename.c_str() );
-  if( !reader.Read() )
-  {
-    std::cerr << "Failed to read: " << filename << std::endl;
-    return 1;
-  }
-  const gdcm::DataSet& ds = reader.GetFile().GetDataSet();
-
-  gdcm::CSAHeader csa;
-  const gdcm::PrivateTag &t1 = csa.GetCSAImageHeaderInfoTag();
-  if( !ds.FindDataElement( t1 ) ) return 1;
-  csa.LoadFromDataElement( ds.GetDataElement( t1 ) );
-
+  const char *name = csaname.c_str();
   if( csa.FindCSAElementByName(name) )
   {
     const gdcm::CSAElement & el = csa.GetCSAElementByName(name);
-    if( el.IsEmpty() ) return 1;
+    // this is not error if empty:
+    if( el.IsEmpty() ) return 0;
     const gdcm::ByteValue* bv = el.GetByteValue();
     std::string str( bv->GetPointer(), bv->GetLength() );
     str.erase(std::remove(str.begin(), str.end(), '\n'), str.end());
@@ -1086,12 +1074,48 @@
       return 1;
     }
     gdcm::Printer p;
+    //gdcm::DictPrinter p;
     p.SetFile( file );
+    //p.SetColor( 1 );
+    std::cout << "--" << csaname << "--" << std::endl;
     p.Print(std::cout);
   }
   return 0;
 }
 
+static int PrintCSABase64(const std::string & filename, 
std::vector<std::string> const & csanames )
+{
+  gdcm::Reader reader;
+  reader.SetFileName( filename.c_str() );
+  if( !reader.Read() )
+  {
+    std::cerr << "Failed to read: " << filename << std::endl;
+    return 1;
+  }
+  const gdcm::DataSet& ds = reader.GetFile().GetDataSet();
+
+  int ret = 0;
+
+  gdcm::CSAHeader csa;
+  const gdcm::PrivateTag &t1 = csa.GetCSAImageHeaderInfoTag();
+  if( !ds.FindDataElement( t1 ) ) return 1;
+  csa.LoadFromDataElement( ds.GetDataElement( t1 ) );
+  for( std::vector<std::string>::const_iterator it = csanames.begin();
+                 it != csanames.end(); ++it ) {
+    ret += PrintCSABase64Impl(csa, *it );
+  }
+
+  const gdcm::PrivateTag &t2 = csa.GetCSASeriesHeaderInfoTag();
+  if( !ds.FindDataElement( t2 ) ) return 1;
+  csa.LoadFromDataElement( ds.GetDataElement( t2 ) );
+  for( std::vector<std::string>::const_iterator it = csanames.begin();
+                 it != csanames.end(); ++it ) {
+    ret += PrintCSABase64Impl(csa, *it );
+  }
+
+  return ret;
+}
+
 static int PrintCSA(const std::string & filename)
 {
   gdcm::Reader reader;
@@ -1271,6 +1295,7 @@
   std::cout << "  -C --csa            print SIEMENS CSA Header 
(0029,[12]0,SIEMENS CSA HEADER)." << std::endl;
   std::cout << "     --csa-asl        print decoded SIEMENS CSA MR_ASL 
(base64)." << std::endl;
   std::cout << "     --csa-diffusion  print decoded SIEMENS CSA MRDiffusion 
(base64)." << std::endl;
+  std::cout << "     --csa64          print decoded SIEMENS CSA 
FMRI/MR_ASL/MRDiffusion... (base64)." << std::endl;
   std::cout << "     --mrprotocol     print SIEMENS CSA MrProtocol only 
(within ASCCONV BEGIN/END)." << std::endl;
   std::cout << "                      or Phoenix Meta Protocol 
(0021,19,SIEMENS MR SDS 01)." << std::endl;
   std::cout << "  -P --pdb            print GEMS Protocol Data Block 
(0025,1b,GEMS_SERS_01)." << std::endl;
@@ -1312,6 +1337,7 @@
   int printmedcom = 0; // MedCom History Information
   int printcsaasl = 0;
   int printcsadiffusion = 0;
+  int printcsa64 = 0;
   int printpdb = 0;
   int printelscint = 0;
   int printvepro = 0;
@@ -1363,6 +1389,7 @@
         {"ct3", 0, &printct3, 1},
         {"csa-asl", 0, &printcsaasl, 1},
         {"csa-diffusion", 0, &printcsadiffusion, 1},
+        {"csa64", 0, &printcsa64, 1},
         {"mrprotocol", 0, &printmrprotocol, 1},
         {"pmtf", 0, &printpmtf, 1},
         {"mecmr3", 0, &printpmtf, 1},
@@ -1539,16 +1566,26 @@
     std::cerr << "Not handled for now" << std::endl;
     }
 
-  const char * csaname = nullptr;
+  std::vector<std::string> csanames;
   if( printcsaasl )
   {
     printcsabase64 = 1;
-    csaname = "MR_ASL";
+    csanames.push_back( "MR_ASL" );
   }
   else if( printcsadiffusion )
   {
     printcsabase64 = 1;
-    csaname = "MRDiffusion";
+    csanames.push_back( "MRDiffusion" );
+  }
+  else if( printcsa64 )
+  {
+    printcsabase64 = 1;
+    // keep me sorted
+    csanames.push_back( "FmriAcquisitionDescriptionSequence" );
+    csanames.push_back( "FmriConditionsDataSequence" );
+    csanames.push_back( "FmriResultSequence" );
+    csanames.push_back( "MR_ASL" );
+    csanames.push_back( "MRDiffusion" );
   }
 
   // else
@@ -1615,7 +1652,7 @@
         }
       else if( printcsabase64 )
         {
-        res += PrintCSABase64(*it, csaname);
+        res += PrintCSABase64(*it, csanames);
         }
       else if( dump )
         {
@@ -1682,7 +1719,7 @@
       }
     else if( printcsabase64 )
       {
-      res += PrintCSABase64(filename, csaname);
+      res += PrintCSABase64(filename, csanames);
       }
     else if( dump )
       {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gdcm-3.0.18/CMakeLists.txt 
new/gdcm-3.0.19/CMakeLists.txt
--- old/gdcm-3.0.18/CMakeLists.txt      2022-09-14 09:27:04.000000000 +0200
+++ new/gdcm-3.0.19/CMakeLists.txt      2022-09-26 08:37:26.000000000 +0200
@@ -17,7 +17,7 @@
 #----------------------------------------------------------------------------
 
 project(GDCM
-  VERSION 3.0.18
+  VERSION 3.0.19
   LANGUAGES CXX C
 )
 ## NOTE: the "DESCRIPTION" feature of project() was introduced in cmake 3.10.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gdcm-3.0.18/Source/Common/gdcmDirectory.cxx 
new/gdcm-3.0.19/Source/Common/gdcmDirectory.cxx
--- old/gdcm-3.0.18/Source/Common/gdcmDirectory.cxx     2022-09-14 
09:27:04.000000000 +0200
+++ new/gdcm-3.0.19/Source/Common/gdcmDirectory.cxx     2022-09-26 
08:37:26.000000000 +0200
@@ -65,8 +65,10 @@
   std::wstring dirName = System::ConvertToUNC(name.c_str());
   Directories.push_back(ToUtf8(dirName));
   WIN32_FIND_DATAW fileData;
-  if ('\\' != dirName[dirName.size()-1]) dirName.push_back('\\');
-  assert( '\\' == dirName[dirName.size()-1] );
+  if ('\\' == dirName[dirName.size() - 1])
+    dirName = dirName.substr(0, dirName.size() - 1);
+  if ('/' != dirName[dirName.size() - 1]) dirName.push_back('/');
+  assert( '/' == dirName[dirName.size()-1] );
   const std::wstring firstfile = dirName+L"*";
   HANDLE hFile = FindFirstFileW(firstfile.c_str(), &fileData);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/gdcm-3.0.18/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx 
new/gdcm-3.0.19/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx
--- old/gdcm-3.0.18/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx   
2022-09-14 09:27:04.000000000 +0200
+++ new/gdcm-3.0.19/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx   
2022-09-26 08:37:26.000000000 +0200
@@ -38,6 +38,29 @@
 };
 
 static const DICT_ENTRY DICOMV3DataDict [] = {
+  {0x0021,0x0010,"SIEMENS MR FMRI",VR::SQ,VM::VM1,"?",false },
+  {0x0021,0x0011,"SIEMENS MR FMRI",VR::LO,VM::VM1,"?",false },
+  {0x0021,0x0012,"SIEMENS MR FMRI",VR::SQ,VM::VM1,"?",false },
+  {0x0021,0x0013,"SIEMENS MR FMRI",VR::US,VM::VM1,"?",false },
+  {0x0021,0x0014,"SIEMENS MR FMRI",VR::SQ,VM::VM1,"?",false },
+  {0x0021,0x0015,"SIEMENS MR FMRI",VR::US,VM::VM1,"?",false },
+  {0x0021,0x0016,"SIEMENS MR FMRI",VR::LO,VM::VM1,"?",false },
+  {0x0021,0x0017,"SIEMENS MR FMRI",VR::US,VM::VM1,"?",false },
+  {0x0021,0x0018,"SIEMENS MR FMRI",VR::UL,VM::VM1,"?",false },
+  {0x0021,0x0019,"SIEMENS MR FMRI",VR::FL,VM::VM1,"?",false },
+  {0x0021,0x0031,"SIEMENS MR FMRI",VR::SQ,VM::VM1,"?",false },
+  {0x0021,0x0040,"SIEMENS MR FMRI",VR::SQ,VM::VM1,"?",false },
+  {0x0021,0x0041,"SIEMENS MR FMRI",VR::LO,VM::VM1,"?",false },
+  {0x0021,0x0042,"SIEMENS MR FMRI",VR::SQ,VM::VM1,"?",false },
+  {0x0021,0x0043,"SIEMENS MR FMRI",VR::LO,VM::VM1,"?",false },
+  {0x0021,0x0044,"SIEMENS MR FMRI",VR::US,VM::VM1,"?",false },
+  {0x0021,0x0045,"SIEMENS MR FMRI",VR::LO,VM::VM1_n,"?",false },
+  {0x0021,0x0046,"SIEMENS MR FMRI",VR::SQ,VM::VM1,"?",false },
+  {0x0021,0x0047,"SIEMENS MR FMRI",VR::UL,VM::VM1,"?",false },
+  {0x0021,0x0048,"SIEMENS MR FMRI",VR::LO,VM::VM1,"?",false },
+  {0x0021,0x0049,"SIEMENS MR FMRI",VR::FD,VM::VM1,"?",false },
+  {0x0021,0x004a,"SIEMENS MR FMRI",VR::FD,VM::VM1_n,"?",false },
+  {0x0021,0x004b,"SIEMENS MR FMRI",VR::FL,VM::VM1,"?",false },
   {0x0009,0x0002,"CANON_MEC_MR3^10",VR::SH,VM::VM1,"?",false },
   {0x0011,0x0003,"CANON_MEC_MR3^10",VR::US,VM::VM1,"?",false },
   {0x0011,0x0004,"CANON_MEC_MR3^10",VR::SQ,VM::VM1,"?",false },
@@ -1232,7 +1255,7 @@
   {0x0021,0x005a,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"?Sequence Variant 
1?",false},
   {0x0021,0x005b,"SIEMENS MR SDI 02",VR::FD,VM::VM3,"Image Position 
(Patient)",false},
   {0x0021,0x005b,"SIEMENS MR SDS 01",VR::CS,VM::VM1_n,"?Sequence Variant 
2?",false},
-  {0x0021,0x005c,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"MTR flag. MT => 
ON",false},
+  {0x0021,0x005c,"SIEMENS MR SDS 01",VR::CS,VM::VM1_n,"MTR flag. MT => 
ON",false},
   {0x0021,0x005d,"SIEMENS MR SDS 01",VR::SL,VM::VM1,"??",false},
   {0x0021,0x005e,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"?FrameIndex?",false},
   {0x0021,0x005e,"SIEMENS MR SDS 01",VR::LO,VM::VM1,"?",false},
@@ -2942,6 +2965,7 @@
   {0x07a1,0x0050,"ELSCINT1",VR::US,VM::VM1,"Tamar Site Id",false },
   {0x07a1,0x0056,"ELSCINT1",VR::US,VM::VM1,"?",false },
   {0x07a1,0x0058,"ELSCINT1",VR::CS,VM::VM1,"?",false },
+  {0x07a1,0x005a,"ELSCINT1",VR::CS,VM::VM1,"?",false },
   {0x07a1,0x005d,"ELSCINT1",VR::DT,VM::VM1,"?",false },
   {0x07a1,0x005f,"ELSCINT1",VR::CS,VM::VM1,"?",false },
   {0x07a1,0x0070,"ELSCINT1",VR::SH,VM::VM1,"?patient name?",false },
@@ -10400,11 +10424,12 @@
   {0x0009,0x0075,"SIENET",VR::LO,VM::VM1,"?",false },
   {0x0091,0x0020,"SIENET",VR::PN,VM::VM1_n,"Patient Name",false },
   {0x0095,0x0001,"SIENET",VR::LO,VM::VM1,"Examination Folder ID",false },
-  {0x0095,0x0004,"SIENET",VR::UL,VM::VM1,"Folder Reported Status",false },
+  {0x0095,0x0004,"SIENET",VR::SL,VM::VM1,"Folder Reported Status",false },
   {0x0095,0x0005,"SIENET",VR::LO,VM::VM1,"Folder Reporting Radiologist",false 
},
   {0x0095,0x0007,"SIENET",VR::LO,VM::VM1,"SIENET ISA PLA",false },
-  {0x0095,0x000c,"SIENET",VR::UL,VM::VM1,"Folder Rebuild Status",false },
+  {0x0095,0x000c,"SIENET",VR::SL,VM::VM1,"Folder Rebuild Status",false },
   {0x0095,0x0020,"SIENET",VR::UN,VM::VM1,"?",false },
+  {0x0095,0x00fb,"SIENET",VR::ST,VM::VM1,"?",false },
   {0x0099,0x0002,"SIENET",VR::UL,VM::VM1,"Key Images",false },
   {0x0099,0x0005,"SIENET",VR::SL,VM::VM1,"Image Number",false },
   {0x0009,0x0010,"SPI",VR::LO,VM::VM1,"Comments",false },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gdcm-3.0.18/Source/DataDictionary/privatedicts.xml 
new/gdcm-3.0.19/Source/DataDictionary/privatedicts.xml
--- old/gdcm-3.0.18/Source/DataDictionary/privatedicts.xml      2022-09-14 
09:27:04.000000000 +0200
+++ new/gdcm-3.0.19/Source/DataDictionary/privatedicts.xml      2022-09-26 
08:37:26.000000000 +0200
@@ -11,6 +11,29 @@
      PURPOSE.  See the above copyright notice for more information.
 -->
 <dict>
+<entry group="0021" element="0010" vr="SQ" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0011" vr="LO" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0012" vr="SQ" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0013" vr="US" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0014" vr="SQ" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0015" vr="US" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0016" vr="LO" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0017" vr="US" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0018" vr="UL" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0019" vr="FL" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0031" vr="SQ" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0040" vr="SQ" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0041" vr="LO" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0042" vr="SQ" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0043" vr="LO" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0044" vr="US" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0045" vr="LO" vm="1-n" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0046" vr="SQ" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0047" vr="UL" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0048" vr="LO" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="0049" vr="FD" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="004a" vr="FD" vm="1-n" name="?" owner="SIEMENS MR 
FMRI"/>
+<entry group="0021" element="004b" vr="FL" vm="1" name="?" owner="SIEMENS MR 
FMRI"/>
 <entry group="0009" element="0002" vr="SH" vm="1" name="?" 
owner="CANON_MEC_MR3^10"/>
 <entry group="0011" element="0003" vr="US" vm="1" name="?" 
owner="CANON_MEC_MR3^10"/>
 <entry group="0011" element="0004" vr="SQ" vm="1" name="?" 
owner="CANON_MEC_MR3^10"/>
@@ -2494,6 +2517,7 @@
   <entry owner="ELSCINT1" group="07a1" element="xx43" vr="IS" vm="1" name="?"/>
   <entry owner="ELSCINT1" group="07a1" element="xx50" vr="US" vm="1" 
name="Tamar Site Id"/>
   <entry owner="ELSCINT1" group="07a1" element="xx56" vr="US" vm="1" name="?"/>
+  <entry owner="ELSCINT1" group="07a1" element="xx5a" vr="CS" vm="1" name="?"/>
   <entry owner="ELSCINT1" group="07a1" element="xx75" vr="LO" vm="2" name="?"/>
   <entry owner="ELSCINT1" group="07a1" element="xx85" vr="UL" vm="1" 
name="Tamar Translate Flags"/>
   <entry owner="ELSCINT1" group="07a1" element="xx9f" vr="CS" vm="1" name="?"/>
@@ -9263,11 +9287,12 @@
   <entry owner="SIENET" group="0009" element="xx75" vr="LO" vm="1" name="?"/>
   <entry owner="SIENET" group="0091" element="xx20" vr="PN" vm="1-n" 
name="Patient Name"/>
   <entry owner="SIENET" group="0095" element="xx01" vr="LO" vm="1" 
name="Examination Folder ID"/>
-  <entry owner="SIENET" group="0095" element="xx04" vr="UL" vm="1" 
name="Folder Reported Status"/>
+  <entry owner="SIENET" group="0095" element="xx04" vr="SL" vm="1" 
name="Folder Reported Status"/>
   <entry owner="SIENET" group="0095" element="xx05" vr="LO" vm="1" 
name="Folder Reporting Radiologist"/>
   <entry owner="SIENET" group="0095" element="xx07" vr="LO" vm="1" 
name="SIENET ISA PLA"/>
-  <entry owner="SIENET" group="0095" element="xx0c" vr="UL" vm="1" 
name="Folder Rebuild Status"/>
+  <entry owner="SIENET" group="0095" element="xx0c" vr="SL" vm="1" 
name="Folder Rebuild Status"/>
   <entry owner="SIENET" group="0095" element="xx20" vr="UN" vm="1" name="?"/>
+  <entry owner="SIENET" group="0095" element="xxfb" vr="ST" vm="1" name="?"/>
   <entry owner="SIENET" group="0099" element="xx02" vr="UL" vm="1" name="Key 
Images"/>
   <entry owner="SIENET" group="0099" element="xx05" vr="SL" vm="1" name="Image 
Number"/>
   <entry owner="SPI" group="0009" element="xx10" vr="LO" vm="1" 
name="Comments"/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/gdcm-3.0.18/Source/DataStructureAndEncodingDefinition/gdcmCSAHeader.cxx 
new/gdcm-3.0.19/Source/DataStructureAndEncodingDefinition/gdcmCSAHeader.cxx
--- old/gdcm-3.0.18/Source/DataStructureAndEncodingDefinition/gdcmCSAHeader.cxx 
2022-09-14 09:27:04.000000000 +0200
+++ new/gdcm-3.0.19/Source/DataStructureAndEncodingDefinition/gdcmCSAHeader.cxx 
2022-09-26 08:37:26.000000000 +0200
@@ -1116,6 +1116,7 @@
     ss.read((char*)&nitems, sizeof(nitems));
     SwapperNoOp::SwapArray(&nitems,1);
     csael.SetNoOfItems( nitems );
+    if( InternalType == SV10) { assert( nitems % 6 == 0 );}
     //std::cout << "NoOfItems " << nitems << ", ";
     uint32_t xx;
     ss.read((char*)&xx, sizeof(xx));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/gdcm-3.0.18/Source/MediaStorageAndFileFormat/CMakeLists.txt 
new/gdcm-3.0.19/Source/MediaStorageAndFileFormat/CMakeLists.txt
--- old/gdcm-3.0.18/Source/MediaStorageAndFileFormat/CMakeLists.txt     
2022-09-14 09:27:04.000000000 +0200
+++ new/gdcm-3.0.19/Source/MediaStorageAndFileFormat/CMakeLists.txt     
2022-09-26 08:37:26.000000000 +0200
@@ -228,6 +228,10 @@
 if(GDCM_USE_SYSTEM_JSON)
   target_link_libraries(gdcmMSFF LINK_PRIVATE ${JSON_LIBRARIES})
 endif()
+if(UNIX)
+  find_package(Iconv)
+  target_link_libraries(gdcmMSFF LINK_PRIVATE ${Iconv_LIBRARIES})
+endif()
 # handling of static lib within shared is a mess:
 #target_link_libraries(gdcmMSFF gdcmrle)
 set_target_properties(gdcmMSFF PROPERTIES ${GDCM_LIBRARY_PROPERTIES})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/gdcm-3.0.18/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx 
new/gdcm-3.0.19/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx
--- old/gdcm-3.0.18/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx    
2022-09-14 09:27:04.000000000 +0200
+++ new/gdcm-3.0.19/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx    
2022-09-26 08:37:26.000000000 +0200
@@ -18,8 +18,8 @@
 #include "gdcmDataSetHelper.h"
 #include "gdcmDicts.h"
 #include "gdcmEvent.h"
-#include "gdcmMEC_MR3.h"
 #include "gdcmGlobal.h"
+#include "gdcmMEC_MR3.h"
 
 #include "gdcmext/csa.h"
 #include "gdcmext/mec_mr3.h"
@@ -643,7 +643,8 @@
     static const PrivateTag &pmtf2 = gdcm::MEC_MR3::GetToshibaMECMR3Tag();
     static const PrivateTag &pmtf3 = gdcm::MEC_MR3::GetCanonMECMR3Tag();
 
-    if (pt == csa1 || pt == csa2 || pt == mec_mr3 || pt == pmtf1 || pt == 
pmtf2 || pt == pmtf3) {
+    if (pt == csa1 || pt == csa2 || pt == mec_mr3 || pt == pmtf1 ||
+        pt == pmtf2 || pt == pmtf3) {
       scrub_privatetags.insert(pt);
       return true;
     }
@@ -798,6 +799,17 @@
   clean.SetVR(de.GetVR());
   std::vector<char> v;
   v.resize(bv->GetLength());
+  {
+    // check a pseudo magic value here:
+    uint32_t magic = 0xffff;
+    if (bv->GetLength() > 4) {
+      memcpy(&magic, bv->GetPointer(), sizeof magic);
+    }
+    if (magic > 512) {
+      gdcmDebugMacro("Cannot handle MEC_MR3");
+      return true;
+    }
+  }
   if (mec_mr3_memcpy(&v[0], bv->GetPointer(), bv->GetLength())) {
     clean.SetByteValue(&v[0], v.size());
     ds.Replace(clean);
@@ -814,7 +826,9 @@
   const char *input = bv->GetPointer();
   const size_t len = bv->GetLength();
 
-  bool success = true;
+  gdcm::Cleaner cleaner;
+  gdcm::File &file = cleaner.GetFile();
+  gdcm::DataSet &revds = file.GetDataSet();
   try {
     std::istringstream is;
     {
@@ -826,13 +840,16 @@
 
     // FIXME gdcm::Cleaner will by default change defined length SQ into undef
     // length...there is a risk of incompatibily with vendor
-    gdcm::Cleaner cleaner;
-    gdcm::File &file = cleaner.GetFile();
     gdcm::FileMetaInformation &fmi = file.GetHeader();
     fmi.SetDataSetTransferSyntax(gdcm::TransferSyntax::ExplicitVRLittleEndian);
-    gdcm::DataSet &revds = file.GetDataSet();
     revds.Read<gdcm::ExplicitDataElement, gdcm::SwapperNoOp>(is);
+  } catch (...) {
+    gdcmDebugMacro("Unhanded file format");
+    return true;
+  }
 
+  bool success = true;
+  try {
     gdcm::VR vr = VR::PN;
     cleaner.Empty(vr);
     if (!cleaner.Clean()) {
@@ -1051,7 +1068,8 @@
       static const PrivateTag &csa1 = CSAHeader::GetCSAImageHeaderInfoTag();
       static const PrivateTag &csa2 = CSAHeader::GetCSASeriesHeaderInfoTag();
       const PrivateTag mec_mr3(0x700d, 0x08, "TOSHIBA_MEC_MR3");
-      static const PrivateTag &pmtf1 = 
gdcm::MEC_MR3::GetPMTFInformationDataTag();
+      static const PrivateTag &pmtf1 =
+          gdcm::MEC_MR3::GetPMTFInformationDataTag();
       static const PrivateTag &pmtf2 = gdcm::MEC_MR3::GetToshibaMECMR3Tag();
       static const PrivateTag &pmtf3 = gdcm::MEC_MR3::GetCanonMECMR3Tag();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gdcm-3.0.18/Utilities/gdcmext/csa.c 
new/gdcm-3.0.19/Utilities/gdcmext/csa.c
--- old/gdcm-3.0.18/Utilities/gdcmext/csa.c     2022-09-14 09:27:04.000000000 
+0200
+++ new/gdcm-3.0.19/Utilities/gdcmext/csa.c     2022-09-26 08:37:26.000000000 
+0200
@@ -137,24 +137,30 @@
 
   // Handle very special case hopefully no conflict with case of no-magic
   if (n == 0x30315653 && unused == 0x01020304) {  // aka 'SV10'
+    // SIEMENS_CSA2.dcm
     s = fread_mirror(&n, sizeof n, 1, self);
     ERROR_RETURN(s, 1);
+    ERROR_RETURN(n < 0x100, true);
     s = fread_mirror(&unused, sizeof unused, 1, self);
     ERROR_RETURN(s, 1);
+    ERROR_RETURN(unused, 0x4d);  // 'M'
     magic = SV10;
   } else if (n < 0x100 && unused == 0x4d) {  // 'M'
+    // SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm
     magic = NOMAGIC;
-  } else if (n == 0x7364703c && unused == 0x6f633c3e)  // aka '<pds><co'
-  {
+  } else if (n == 0x7364703c && unused == 0x6f633c3e) {  // aka '<pds><co'
     // 'PET_REPLAY_PARAM'
+    assert(0);
     return false;
   } else if (n == 0x31305356 && unused == 0x2010403) {  // aka 'VS01' ...
     // technically could be reserved; should not happen in the wild
+    assert(0);
     return false;
   } else {
     assert(0);
     return false;
   }
+  assert(n > 0 && n < 128);
   self->nelements = n;
   self->csa_type = magic;
   return true;
@@ -167,14 +173,27 @@
     uint32_t unused;
     s = fread_mirror(&unused, sizeof unused, 1, self);
     ERROR_RETURN(s, 1);
+    ERROR_RETURN(unused, 0);
   } else if (self->csa_type == NOMAGIC) {
-    // no magic
+    // no magic. seems to contains some kind of data, hopefully no PHI
+#if 1
     uint32_t i;
     for (i = 0; i < 28u; ++i) {
       uint32_t unused;
       s = fread_mirror(&unused, sizeof unused, 1, self);
       ERROR_RETURN(s, 1);
     }
+#else
+    char unused[28 * 4];
+    s = fread_mirror(unused, sizeof *unused, sizeof unused / sizeof *unused,
+                     self);
+    ERROR_RETURN(s, 28 * 4);
+    int i;
+    for (i = 0; i < 4 * 28; ++i) {
+      const char c = unused[i];
+      assert(c == 0x0 || c == ' ' || c == '.' || (c >= '0' && c <= '9'));
+    }
+#endif
   } else {
     assert(0);
     return false;
@@ -209,16 +228,25 @@
   // vr
   s = fread_mirror(i->vr, sizeof *i->vr, sizeof i->vr / sizeof *i->vr, self);
   ERROR_RETURN(s, 4);
+  {
+    const char *s = i->vr;
+    assert(s[0] >= 'A' && s[0] <= 'Z');
+    assert(s[1] >= 'A' && s[1] <= 'Z');
+    assert(s[2] == 0);
+    if (self->csa_type == SV10) assert(s[3] == 0);
+  }
   // syngodt (signed)
   s = fread_mirror(&i->syngodt, sizeof i->syngodt, 1, self);
   ERROR_RETURN(s, 1);
   // numer of items
   s = fread_mirror(&i->nitems, sizeof i->nitems, 1, self);
+  if (self->csa_type == SV10) assert(i->nitems % 6 == 0);
   ERROR_RETURN(s, 1);
   {
     uint32_t unused;
     s = fread_mirror(&unused, sizeof unused, 1, self);
     ERROR_RETURN(s, 1);
+    ERROR_RETURN(unused == 0x4d || unused == 0xcd, true);
   }
 
   return true;
@@ -232,6 +260,7 @@
     uint32_t unused;
     s = fread_mirror(&unused, sizeof unused, 1, self);
     ERROR_RETURN(s, 1);
+    assert(unused == d->len || unused == 0x4d || unused == 0xcd);
   }
 
   if (d->len != 0) {
@@ -239,6 +268,8 @@
     const uint32_t padded_len = ((d->len + 3u) / 4u) * 4u;  // (len + 3) & 
~0x03
     assert(padded_len == d->len + padding_len);             // programmer error
     d->buffer = (char *)realloc(d->buffer, padded_len);
+    assert(padded_len != 0);
+    ERROR_RETURN(d->buffer != NULL, true);
     s = fread_mirror(d->buffer, sizeof *d->buffer, padded_len, self);
     ERROR_RETURN(s, padded_len);
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gdcm-3.0.18/Utilities/gdcmext/mec_mr3.c 
new/gdcm-3.0.19/Utilities/gdcmext/mec_mr3.c
--- old/gdcm-3.0.18/Utilities/gdcmext/mec_mr3.c 2022-09-14 09:27:04.000000000 
+0200
+++ new/gdcm-3.0.19/Utilities/gdcmext/mec_mr3.c 2022-09-26 08:37:26.000000000 
+0200
@@ -400,6 +400,7 @@
     if (s != 1 || nitems == 0) {
       good = false;
     }
+    assert(nitems < 512);
     if (good && nitems <= MAGIC_NUM_ELEMENTS) {
       // special case to handle last groups
       remain = nitems;

Reply via email to