Hi Kevin,
Could you give me some advice as to the best way to proceed?
I want to make use of the facilities of DicomRemap from within a Java program that I am writing. The specific use case is that my utility XNATDataChooser now has (almost) the facility to select studies from one XNAT instance and export them directly to another with anonymisation. This is a very common task at our institution, where we have one XNAT directly connected to the clinical scanners, and containing patient-identifiable data, but a different version of XNAT that people actually use for their research, where the data are all anonymised.
The command I want to run is something along the lines of
DicomRemap -d anon_script.das -o dicom:<XNAT DICOM receiver> <file list>
and it seems to me that there are three possible routes here.
1. Use Java's ProcessBuilder class to recreate precisely this command and issue it to the OS.
Advantage: It should be really easy.
Disadvantage: Not portable; relies on DicomRemap being present on the path the Java program has access to, and this is not guaranteed to be the case without the end user installing it.
2. As 1, but add the DicomBrowser bin and lib directories to my Java program's distribution.
Advantage: Portable
Disadvantage: An OS call is not necessarily optimal when you have made the source code of the Java available.
3. Make use of the DicomBrowser source code itself (via the "main" method of file CSVRemapper.java???)
Advantage: Direct calls from my Java program to other Java code
Disadvantage: Potentially more work to implement
So my question is which route would you recommend?
Best wishes,
Simon