I am trying to call the dcm4che utilities such as findscu from java code.
The code has not been designed with an API suitable for programmatic use, it is designed to create an executable. To call it from code I create a set of strings representing command line parameters and then call the main() method, passing those strings. The code outputs a set of XML files to disk, which I then parse.
I would strongly prefer to have a java API to call. For example it could have methods such as setConnectionString(), and it could return an array of objects, or a stream to parse.
For someone who knows the code I suspect this would be pretty easy; you would create a class to do the work, and then main() would parse the settings and pass them to the processor object. Main would then serialise the result.
But for me it is quite tricky, because the command line parsing is highly integrated with the implementation code.
Can anyone suggest how this can easily be done?
Do other people need this?