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

ENH: set Siemens MeasurementFrame #387

Conversation

ihnorton
Copy link
Collaborator

@ihnorton ihnorton commented Aug 30, 2018

Per this page:

https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Diffusion_Tensor_Imaging

Siemens and Philips report gradient direction with respect to the scanner bore.

DWIConvert does already account for this in the Philips converter, so I believe we should do so for Siemens as well.

I tested this change with one of the large rotation test datasets linked there,
specifically, the 'dtitest_Siemens_GSU_GT/ep2d_DTI_30_ax_roll_4' dataset.

Example DTI image in Slicer, with direction-coded colors (left: current, right: with this patch):

image

Confirmed with large rotation test data from dcm2nii website:

https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Diffusion_Tensor_Imaging

Specifically, the 'dtitest_Siemens_GSU_GT/ep2d_DTI_30_ax_roll_4'
dataset. See principal eigenvalue images in the PR.
@ihnorton
Copy link
Collaborator Author

By the way, this makes the output bvec file in FSL mode match well with output from dcm2niix:

julia> vec_dwicp = readdlm("test_dwic_patched.bvec")
3×31 Array{Float64,2}:
 0.0  -0.558845  -0.207158  -0.0752197  -0.589165  -0.269029  -0.756038  -0.831669   -0.783142  …   0.078812   0.115386   0.328008   0.44147    0.735267  0.990763     0.915539
 0.0   0.54394    0.529593   0.179027    0.756425   0.953483   0.551316   0.554387    0.209761      0.938754   0.727798   0.16311    0.502128   0.490006  0.1354       0.138558
 0.0  -0.625957  -0.822567  -0.980964   -0.284088  -0.135989   0.352784  -0.0313337  -0.585397     -0.335455  -0.676015  -0.930487  -0.743621  -0.46827   0.00749746  -0.37761

julia> vec_dcm2nii = readdlm("__ep2d_DTI_30_ax_roll_20110331083655_4.bvec")
3×31 Array{Float64,2}:
 0.0  -0.558845  -0.207158  -0.0752197  -0.589165  -0.269029  -0.756038  -0.831669   -0.783142  …   0.0788119   0.115386   0.328008   0.44147    0.735267  0.990763     0.915539
 0.0   0.54394    0.529593   0.179027    0.756425   0.953483   0.551316   0.554387    0.209761      0.938754    0.727798   0.16311    0.502128   0.490006  0.1354       0.138558
 0.0  -0.625957  -0.822567  -0.980965   -0.284088  -0.135989   0.352784  -0.0313337  -0.585397     -0.335455   -0.676015  -0.930487  -0.743621  -0.46827   0.00749746  -0.37761

julia> norm(vec_dwicp - vec_dcm2nii)
2.724273932718676e-6

@hjmjohnson
Copy link
Member

@ihnorton Please be careful here. I am not convinced that this is correct. My recollection is that Siemens and Phillips are quite different. Perhaps is scanner version or scanner model dependent.

I would like to see more testing before this is committed.

@ihnorton
Copy link
Collaborator Author

I'm going to close this. After closely reading through Gordon's document, this figure and related pages on the NA-MIC wiki -- I agree the current behavior is correct. (which makes sense, of course... someone would have noticed it in all these years)

I've been working a lot with FSL Nifti<->NRRD, and have had issues with incorrect glyphs from rotated acquisitions. A source of confusion was my misunderstanding that measurement frame (going to NRRD) of FSL-style nifti+bvec should be identity. Sylvain here pointed out that is wrong, and making the change fixed issues with some rotated-acquisition test datasets.

Currently DWIConvert makes the same assumption, which I think should be changed -- e.g. the code behavior for FSLToNRRD matches this comment in issue 342 and sets the output NHDR measurement frame to identity:

Due to the fact that the BVEC and BVAL information is implicitly in an LAS corrdinate system (and the fact that the measurement frame is implicitly an identity matrix

I'll close this and re-open that issue to discuss.

@ihnorton ihnorton closed this Dec 17, 2018
@ihnorton ihnorton deleted the use_siemens_lpsdir_for_measurementframe branch December 17, 2018 16:13
@ihnorton
Copy link
Collaborator Author

Also thanks for pushing back on this.

@hjmjohnson
Copy link
Member

@ihnorton Thank you for working through this. I greatly appreciate your careful evaluation.

Hans

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

Successfully merging this pull request may close these issues.

2 participants