Bug#919727: cmtk /dcmtk

2019-01-21 Thread Torsten Rohlfing
Thanks Yarik, but too late ;)

Anyway, I have a patch (see below) that appears to work. I'll be rolling a
small bugfix release of CMTK in the next few days if/when I get a chance.

Index: core/apps/dcm2image.cxx
===
--- core/apps/dcm2image.cxx (revision 5439)
+++ core/apps/dcm2image.cxx (working copy)
@@ -82,7 +82,11 @@
 const std::string tagName( pattern, static_cast(
equals-pattern ) );

 const DcmDictEntry* dictEntry = dcmDataDict.rdlock().findEntry(
tagName.c_str() );
+#if PACKAGE_VERSION_NUMBER < 364
 dcmDataDict.unlock();
+#else
+dcmDataDict.rdunlock();
+#endif

 if ( dictEntry )
   {
@@ -482,7 +486,11 @@
 #ifdef CMTK_DCMDICTPATH
 if ( dcmDataDict.wrlock().loadDictionary( CMTK_DCMDICTPATH ) )
   {
+#if PACKAGE_VERSION_NUMBER < 364
   dcmDataDict.unlock();
+#else
+  dcmDataDict.wrunlock();
+#endif
   }
 else
 #endif
@@ -489,7 +497,11 @@
 #ifdef CMTK_DCMDICTPATH_INSTALL
 if ( dcmDataDict.wrlock().loadDictionary( CMTK_DCMDICTPATH_INSTALL ) )
   {
+#if PACKAGE_VERSION_NUMBER < 364
   dcmDataDict.unlock();
+#else
+  dcmDataDict.wrunlock();
+#endif
   }
 else
 #endif
@@ -566,9 +578,17 @@

   if ( !dcmDataDict.rdlock().findEntry( "RawDataType_ImageType" ) )
 {
+#if PACKAGE_VERSION_NUMBER < 364
 dcmDataDict.unlock();
+#else
+dcmDataDict.rdunlock();
+#endif
 dcmDataDict.wrlock().addEntry( new DcmDictEntry( 0x0043, 0x102f,
EVR_SS, "RawDataType_ImageType", 1, 1, NULL, OFFalse, "GE" ) );
+#if PACKAGE_VERSION_NUMBER < 364
 dcmDataDict.unlock();
+#else
+dcmDataDict.wrunlock();
+#endif
 }

   VolumeList volumeList( Tolerance );
===



On Mon, Jan 21, 2019 at 8:08 PM Yaroslav Halchenko 
wrote:

>
> On Mon, 21 Jan 2019, Torsten Rohlfing wrote:
>
> >Hi there -
> >Upstream owner of CMTK here. It looks like DCMTK in release 3.6.4
> changed
> >their API for locking/unlocking the global data dictionary.
> >I am going to look into fixing this, but it'll take a while since I'll
> >have to set up a suitable Debian VM for testing first.
>
> docker run -it --rm debian:sid
>
> adjust /etc/apt/sources.list to include deb-src entries
>
> apt-get update
> apt-get build-dep cmtk
>
> and you should be all set ;)
>
> --
> Yaroslav O. Halchenko
> Center for Open Neuroscience http://centerforopenneuroscience.org
> Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
> Phone: +1 (603) 646-9834   Fax: +1 (603) 646-1419
> WWW:   http://www.linkedin.com/in/yarik
>


Bug#919727: cmtk /dcmtk

2019-01-21 Thread Yaroslav Halchenko


On Mon, 21 Jan 2019, Torsten Rohlfing wrote:

>Hi there -
>Upstream owner of CMTK here. It looks like DCMTK in release 3.6.4 changed
>their API for locking/unlocking the global data dictionary.
>I am going to look into fixing this, but it'll take a while since I'll
>have to set up a suitable Debian VM for testing first.

docker run -it --rm debian:sid

adjust /etc/apt/sources.list to include deb-src entries

apt-get update
apt-get build-dep cmtk

and you should be all set ;)

-- 
Yaroslav O. Halchenko
Center for Open Neuroscience http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834   Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik



Bug#919727: cmtk /dcmtk

2019-01-21 Thread Torsten Rohlfing
Hi there -

Upstream owner of CMTK here. It looks like DCMTK in release 3.6.4 changed
their API for locking/unlocking the global data dictionary.

I am going to look into fixing this, but it'll take a while since I'll have
to set up a suitable Debian VM for testing first.

Best,
  Torsten