DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Sun, 2017-11-19, 20:52

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri, 2017-07-14, 16:51 
Offline

Joined: Fri, 2017-07-14, 15:05
Posts: 3
I'm trying to test the functionality of DCMTK, and I like the idea of use it through command line in my java program. I tried to send some command in java but did not receive the expected effects.

What I did:

1) I downloaded the latest version of the executable file, I took dcmodify.exe from it and an image.dcm and put all in C:\Users\Public\Documents
2) I wrote a fast java code in order to modify a DICOM metadata, but despite trying to change the command line, I could not make any variations in the image metadata.

Main body:
Code:
  try {
            System.out.println("Try to modify a.dcm ...");
            Process process = new ProcessBuilder("C:\\Users\\Public\\Documents\\dcmodify.exe",
                                  "dcmodify -i \"(0010,0010)= Mike\" a.dcm").start();
            System.out.println("done");
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }


I tried different command but none worked, I have no real idea of what created this problem, i think should be the command formatting. :? :?


Top
 Profile  
 
PostPosted: Fri, 2017-07-14, 16:54 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1633
Location: Oldenburg, Germany
Hi,

does the second parameter of ProcessBuilder really take the executable again, i.e. maybe it's:
Code:
 Process process = new ProcessBuilder("C:\\Users\\Public\\Documents\\dcmodify.exe",
                                  "-i \"(0010,0010)= Mike\" a.dcm").start();

Best,
Michael


Top
 Profile  
 
PostPosted: Fri, 2017-07-14, 17:01 
Offline

Joined: Fri, 2017-07-14, 15:05
Posts: 3
Michael Onken wrote:
Hi,

does the second parameter of ProcessBuilder really take the executable again, i.e. maybe it's:
Code:
 Process process = new ProcessBuilder("C:\\Users\\Public\\Documents\\dcmodify.exe",
                                  "-i \"(0010,0010)= Mike\" a.dcm").start();

Best,
Michael


I try it, It does not work.
(a.dcm is in the some folder of dcmodify.exe)


Top
 Profile  
 
PostPosted: Fri, 2017-07-14, 17:04 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1633
Location: Oldenburg, Germany
Then there should be an error, i.e exception. Note that a.dcm should be in the working directory, ie. normally the directory where you run the stuff.
I would try the following:
  • Verify that the command works on your file from the command line directly.
  • Try giving the full path to a.dcm in your ProcessBuilder() call.


Top
 Profile  
 
PostPosted: Fri, 2017-07-14, 17:22 
Offline

Joined: Fri, 2017-07-14, 15:05
Posts: 3
Michael Onken wrote:
Then there should be an error, i.e exception. Note that a.dcm should be in the working directory, ie. normally the directory where you run the stuff.
I would try the following:
  • Verify that the command works on your file from the command line directly.
  • Try giving the full path to a.dcm in your ProcessBuilder() call.


via cmd and full path:
Code:
C:\Users\Public\Documents\dcmodify.exe -i  "(0010,0010)= Mike" C:\Users\Public\Documents\a.dcm


the dcmodify creates a.dcm.bak file, But in my imagination I expected it change the patient name attribute in Mike, but is not so.

What am I wrong about approaching this program? :?


Top
 Profile  
 
PostPosted: Mon, 2017-07-17, 08:04 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1633
Location: Oldenburg, Germany
Hi,

No, you're imagination should be right ;)
Did you use dcmdump to check the content after you ran dcmodify?
Did you try running your dcmodify command from the commandline instead to find out if something goes wrong in general?

Best,
Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group