How do I run dcm4che tools from the command line after compilation?
I want to use the dcm2json tool, part of the dcm4che3 toolkit, but I cannot figure out how to compile and execute the command line tool. By running
$ git clone https://github.com/dcm4che/dcm4che.git
$ cd dcm4che
$ mvn install
in the root of the dcm4che directory as mentioned in the installation guide, all I get from compiling is the jar dcm4che / dcm4che-tool / dcm4che-tool-dcm2json / target / dcm4che-tool-dcm2json-3.3.5-SNAPSHOT.jar and the class file dcm4che / dcm4che-tool / dcm4che-tool-dcm2json / target / classes / org / dcm4che3 / tool / dcm2json / Dcm2Json.class. No tool to execute. I can execute the standalone tools downloaded from http://sourceforge.net/projects/dcm4che/files/dcm4che3/3.3.3/ but unfortunately dcm2json is not included in this (most recent version of sourceforge).
Does anyone know where I can download the dcm2json executable or how to compile it? Any help would be really appreciated.
(Yes, I did Google.)
source to share
The dcm4che project has a sub-project called dcm4che-assembly
which, when launched mvn install
in the parent project, dcm4che
creates a zip that collects all executable artifacts including dcm2json
.
If you're wondering how you can run a sh / bat script to run, then dcm4che-assembly
this is where you should be looking.
In fact, this zip assembly is the same as you download in the binary package.
Hope it helps!
source to share
I was also curious, so I researched it. I don't have a definitive answer, but I'll post what I've found so far, in the hope that it will be helpful to someone else, and may be the first step towards an answer.
It seems that mvn install
after he does his thing, he puts a whole bunch of things in ~/.m2
. The jar files there don't work as you'd expect, and based on the files in the git repository, dcm4che-assembly/src/bin
it seems like they need a wrapper to work properly. My wrapper preview doesn't work, I get the following errors:
Error: Could not find or load main class org.dcm4che3.tool.dcm2json.Dcm2Json
It seems that these wrapper files want to be installed somewhere (like /usr/local/bin
?), But they don't seem to look.
On the other hand, more recent binaries are now available (currently before 3.3.7
, while git is 3.3.8-SNAPSHOT
) and I can use the tool dcm2json
available in them. Interestingly, this executable is also a wrapper, much the same as in git. Further research into why it works, and the fact that it git cannot lead to an answer to the question of why dcm4dch3 tools do not magically start after installation.
And, of course, the key is understanding how the maven framework works.
source to share