-
Notifications
You must be signed in to change notification settings - Fork 437
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
Use the correct (row) order of the tensor components #1892
Conversation
Addresses #1890 |
Codecov Report
@@ Coverage Diff @@
## master #1892 +/- ##
=========================================
Coverage ? 84.68%
=========================================
Files ? 118
Lines ? 14682
Branches ? 2327
=========================================
Hits ? 12433
Misses ? 1703
Partials ? 546
|
Thanks @arokem for this PR; if we wanted to be fully compliant with the Nifti1 standard, there would still be 2 things to modify:
This would be cherry on the cake, but as it stands this PR solves #1890 |
Thanks for the feedback. I’ll do those things later today. I also want to
add a little test to be sure we get this right.
…On Tue, Jul 9, 2019 at 10:29 PM Emmanuel Caruyer ***@***.***> wrote:
Thanks @arokem <https://github.com/arokem> for this PR; if we wanted to
be fully compliant with the Nifti1 standard, there would still be 2 things
to modify:
- providing the right intent code in the header (using something like hdr.set_intent("symmetric
matrix") in nibabel)
- adding one more dimension to the image data (using something like data
= data[..., np.newaxis, :]) -- as far as I understand the 4th
dimension is dedicated to store temporal data, e.g. for fMRI.
This would be cherry on the cake, but as it stands this PR solves #1890
<#1890>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1892>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA46NU2Z3AQ54JCHB3DAVTP6VXS3ANCNFSM4H7J7KLQ>
.
|
Just a quick mention: I fully agree that we should follow the Nifti standard (using the 5 dimension for the elements, since the 4th is for temporal), and I even often argued that this should be the case. However, I was most often told that "other software expect the values to be in the 4th dimension". Same goes for the SH coefficients, etc. If we change it to the 5th dimension, I expect to see a few issues coming about external software not loading that correctly anymore. Just something to take into account. Also, @matthieudumont is probably not seeing those, even if he's sitting at the desk besides mine. I'm pretty sure that the reason the reordering was done was to conform to what the Fibernavigator expected at the time. I personally would say that this is not a valid reason anymore. Just legacy. |
dipy/workflows/reconst.py
Outdated
@@ -280,6 +287,8 @@ def run(self, input_files, bvalues_files, bvectors_files, mask_files, | |||
(default 'evecs.nii.gz') | |||
out_eval : string, optional | |||
Name of the eigenvalues to be saved (default 'evals.nii.gz') | |||
fsl_format : bool, optional | |||
Whether the tensor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter explanation here seems to be unfinished 📖.
Good catch! See last commit.
…On Thu, Jul 11, 2019 at 8:21 AM Jon Haitz Legarreta Gorroño < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In dipy/workflows/reconst.py
<#1892 (comment)>:
> @@ -280,6 +287,8 @@ def run(self, input_files, bvalues_files, bvectors_files, mask_files,
(default 'evecs.nii.gz')
out_eval : string, optional
Name of the eigenvalues to be saved (default 'evals.nii.gz')
+ fsl_format : bool, optional
+ Whether the tensor
The parameter explanation here seems to be unfinished 📖.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1892>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA46NQSMYW5JSXMBPAT7BDP65FZLANCNFSM4H7J7KLQ>
.
|
Nice. Thanks @arokem. |
Hello @arokem, Thank you for updating !
Comment last updated at 2019-07-29 20:49:57 UTC |
Hey @jchoude : does this allay your concerns? The default might break other software, but there's a flag. @MrBago : I understand the concern about back compatibility, but with 1.0 as our coming release, I think this is the time to break back compatibility if there ever was one. I am not sure what issues would come up, but we'd help the Nipype-ers refactor as needed. |
Sounds good.
…On Mon, Jul 15, 2019 at 8:41 AM Ariel Rokem ***@***.***> wrote:
Hey @jchoude <https://github.com/jchoude> : does this allay your
concerns? The default might break other software, but there's a flag.
@MrBago <https://github.com/MrBago> : I understand the concern about back
compatibility, but with 1.0 as our coming release, I think this is the time
to break back compatibility if there ever was one. I am not sure what
issues would come up, but we'd help the Nipype-ers refactor as needed.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1892>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABWP4ZKOOXOTSY6AT655ZDP7SLCXANCNFSM4H7J7KLQ>
.
|
Can you rebase this PR? Thank you! |
Use the nifti standard compliant form as default.
Rebased! |
Thank you @arokem. Any other comments? I will wait until tomorrow before merging this PR. |
dipy/workflows/reconst.py
Outdated
@@ -222,7 +223,7 @@ def run(self, input_files, bvalues_files, bvectors_files, mask_files, | |||
out_dir='', out_tensor='tensors.nii.gz', out_fa='fa.nii.gz', | |||
out_ga='ga.nii.gz', out_rgb='rgb.nii.gz', out_md='md.nii.gz', | |||
out_ad='ad.nii.gz', out_rd='rd.nii.gz', out_mode='mode.nii.gz', | |||
out_evec='evecs.nii.gz', out_eval='evals.nii.gz'): | |||
out_evec='evecs.nii.gz', out_eval='evals.nii.gz', fsl_tensor=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the parameter is misleading. Should we say nifti_standard_tensor or nifti_tensor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this would be set to True per default? The problem with that is that it's not so clear what the alternative means. Here, the idea is that this tells the users that this would give them a file that interoperates with FSL. Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to use software names in the past did not go well. Why fsl_tensor and not trackvis_tensor or other? I think having the nifti_standard
there is better and you can explain more in the docstring. And in the docstring we should have the convention explained for the choice of lower vs upper triangular and row vs column order. @ecaruyer do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How's this? See recent 24dc0ea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree with the nifti_standard
suggestion.
Just one last comment from me, I am quite sure trackvis does follow the row-order lower triangular convention, which is I think in contradiction with the docstring as it stands.
Thanks again for this PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah. I think the other software that was mentioned was Fibernavigator, but I think even that may no longer be true. Fixed in 162de19
Great, thank you all. Merging... |
No description provided.