Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug to convert philips DTI dcm files #51

Open
anbai106 opened this issue Apr 19, 2017 · 1 comment
Open

Bug to convert philips DTI dcm files #51

anbai106 opened this issue Apr 19, 2017 · 1 comment

Comments

@anbai106
Copy link

anbai106 commented Apr 19, 2017

Hello:
Thanks for your work, but I maybe have a very stupid question: your convertor works for all the machines or not? I tested with Siemens, GE, Philips, but I have problem to convert Philips:

I got errors like this, because im not familiar with dicom, so I can not figure out the bug from the python source code:

Traceback (most recent call last): File "/Users/junhao.wen/Hao/Code/Python/Economy/test_dcmstack.py", line 13, in <module> stack_data = my_stack.get_data() File "build/bdist.macosx-10.6-x86_64/egg/dcmstack/dcmstack.py", line 763, in get_data File "build/bdist.macosx-10.6-x86_64/egg/dcmstack/dcmstack.py", line 726, in get_shape dcmstack.dcmstack.InvalidStackError: The DICOM stack is not valid: Unable to guess key for sorting the fourth dimension

PS: I also tried the command line, it gave the same errors.
Really look forward to the reply:)

Good day

Hao

@moloney
Copy link
Owner

moloney commented Jun 2, 2017

Hi,

The goal is to work on any DICOM files regardless of the manufacturer. However, I mostly work with data from Siemens instruments so that has been what most of the testing was done with.

We still don't handle multi-frame DICOM files, so if that is what you are working with there is no quick and easy solution.

If you aren't working with multi-frame DICOM files, then that error is pretty self explanatory. Since the DICOM standard doesn't provide enough info to automatically determine what the extra-spatial dimensions should be, dcmstack is forced to try to guess. Basically we have a list of DICOM element we will try to use to order the 4th dimension (see https://github.com/moloney/dcmstack/blob/master/src/dcmstack/dcmstack.py#L412). We try each of those keys in turn until we find one that works. In the case of your data, none of those listed elements works.

You can manually specify the element to use for the extra spatial dimensions. In python you would pass in the keyword to use for the time_order and/or vector_order arguments to the DcmStack constructor. On the command line you would use the --time-var and/or --vector-var options.

If you can figure out which DICOM element to use for this ordering you can let me know and it can potentially be added to the default list of elements we try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants