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

add_philips_info temporal id determination #73

Open
jpcoutu opened this issue Dec 20, 2017 · 1 comment
Open

add_philips_info temporal id determination #73

jpcoutu opened this issue Dec 20, 2017 · 1 comment

Comments

@jpcoutu
Copy link

jpcoutu commented Dec 20, 2017

I encountered an issue with Philips diffusion dicom files that did not get converted properly. The cause was this line in the add_philips_info sub in dicom_to_minc.c:

int id = (i1 < c1) ? i1 : (c1 + i2);

In this context, i1 is the b-value index of the file (varies between 1 and c1, which is the total number of different b-values), i2 is the gradient orientation index and c2 is the gradient orientation count (which I think stores the highest gradient orientation index rather than the actual count), which are defined in pms_elements_defs.h.

My dicom files have a c1 of 3 and c2 of 66. The first dicom had (i1 = 1, i2 = 66), followed by 64 dicoms with (i1 = 2, i2 between 2 and 65) and then 4 dicoms with (i1 = 3, i2 between 2 and 66). This repeats for every slice location. The corresponding b-values for i1 =1, 2 ,3 were 0, 1000 and 0 (technically 0.001, which is why it got a different i1 number). This scheme did not really work with the line above, which seems to assume that only the last i1 value / b-value has gradient orientations. I changed it to this line:

int id = (i1 - 1) * c2 + i2;

which makes sure to attribute a unique id for a given b-value and gradient orientation index. This doesn't necessarily create contiguous temporal position ids, but I think sort_dimensions() takes care of that. It
seems to have fixed my problem, so I figured I should post this fix here. Only side effect I can see seems to be that a bogus start and step gets attributed to the time dimension, but those don't really mean anything for diffusion. However I do not have much other Philips diffusion data to test this on.

@jpcoutu
Copy link
Author

jpcoutu commented Jun 14, 2021

This is fixed in #113

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

1 participant