QIICR / dcmqi

dcmqi (DICOM for Quantitative Imaging) is a free, open source C++ library for conversion between imaging research formats and the standard DICOM representation for image analysis results
https://qiicr.gitbook.io/dcmqi-guide/
BSD 3-Clause "New" or "Revised" License
232 stars 62 forks source link

Question: Using dcmqi #436

Closed ctzavaras closed 3 years ago

ctzavaras commented 3 years ago

Greetings, I was wondering if it is possible to use dcmqi in a python script or if there is a way to use it in order to convert automatic many Dicom segs to Nrrd files?

Thank you in advance! Chris

fedorov commented 3 years ago

Here's one example where dcmqi was used from a python script to do conversion in batch: https://github.com/QIICR/lidc2dicom/blob/master/lidc2dicom.py#L94-L99.

You should be able to do something similar for your task.

ctzavaras commented 3 years ago

@fedorov Thank you again!

So if I got it right by reading the code in the example above, I can run dcmqi by the module subprocess.Popen() and this module will call the dcmqi in a command prompt window ,right?

fedorov commented 3 years ago

That's right - you need to install dcmqi on your system using the latest release binary available here: https://github.com/QIICR/dcmqi/releases, and make sure the dcmqi binaries are available in your system path. After that you can use the approach in that script to call the converter and pass inputs as files.

ctzavaras commented 3 years ago

@fedorov Perfect! Thank you again!

fedorov commented 3 years ago

No problem. I will close this issue, but please reopen if you run into issues with this approach.

ctzavaras commented 3 years ago

That's right - you need to install dcmqi on your system using the latest release binary available here: https://github.com/QIICR/dcmqi/releases, and make sure the dcmqi binaries are available in your system path. After that you can use the approach in that script to call the converter and pass inputs as files.

@fedorov Hello again! I downloaded the zip file for windows from the link that you provided, but there are some exe files that they don't do anything when I run them. So, do I have to do something else in order to use them or should I build from source first in order to run dcmqi in windows(as it is said in the guide)?

fedorov commented 3 years ago

I don't have a windows machine handy, but from what I recall, the terminal may not show the console output when running command line tools. Are you saying nothing shows up in the terminal when you run those exe files with --help, for example?

No, you don't need to build from source! I need to update the documentation - that page was written before we established a process to publish binaries for all platforms under releases.

ctzavaras commented 3 years ago

@fedorov Eventually, I figure it out. I used cmd to go to the folder that the exe files are located and I executed the command with the arguments that I found in help and it worked. Thank you very much!