-
Notifications
You must be signed in to change notification settings - Fork 272
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: Generate the eddy QC report #155
ENH: Generate the eddy QC report #155
Conversation
One thing to think about is whether we want the QC report to be in its default location (${subject}/Diffusion/eddy/eddy_unwarped_images.qc/). It might be nice to move it to a location easier to find (e.g. ${subject}/QC/Diffusion/). |
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.
I would move it to an easier to find location. Thanks for the pull request.
It's not technically in the "T1w" space, but I wonder if we shouldn't copy it to |
Is it images or a QC report? If it is images, why not resample them to T1w space and do that? |
It is just a QC report (no NIFTI files). The report does contain pngs of the brain, which would of course not be showing the brain in T1-weighted space, but that should not be an issue. So I think the Another issue is: there are some text files with the movement, average residual, etc. per volume. Due to the resampling of two volumes into one after eddy, these can no longer be used as confound regressors (that is true both in the original diffusion space and the T1-weighted space). I don't see an obvious fix for this (and of course having the report itself would still be useful anyway). |
That said, while |
Transforming some of the output maps from eddy to T1-weighted space (in particular the CNR maps) would be easy to do. I agree with Jesper that it is probably not very useful, but we might as well. |
One other random thought: I don't suppose that |
TBH, it would not be very hard to include a python script to do that conversion from json to slspec ourselves (I don't think eddy does so). |
Ok, this version works. I've attached the produced QC report for reference. What I haven't implemented:
|
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.
Perhaps I'm missing it, but where does the output of QUAD get copied/moved to T1w/Diffusion/eddylogs
?
Now that we've figured out the spline resampling/masking issues, isn't it just a matter of a couple lines in |
I agree with Mike about the CNR maps. |
Ok, this version appears to work both with and without gradient distortion correction |
${FSLDIR}/bin/immv ${datadir}/data ${datadir}/data_warped | ||
# Note: data in the warped directory is eddy-current and suspectibility distortion corrected (via 'eddy'), but prior to gradient distortion correction | ||
# i.e., "data_posteddy_preGDC" would be another way to think of it | ||
mkdir -p ${datadir}/warped |
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.
If we want to consolidate the code a bit, we could define warpedDir=${datadir}/warped
and then use ${warpedDir}
throughout the following.
|
||
# Transform CNR maps | ||
${CARET7DIR}/wb_command -volume-dilate ${datadir}/warped/cnr_maps_warped.nii.gz $DilateDistance NEAREST ${datadir}/warped/cnr_maps_dilated.nii.gz | ||
${FSLDIR}/bin/applywarp --rel --interp=trilinear -i ${datadir}/warped/cnr_maps_dilated -r ${datadir}/warped/cnr_maps_dilated -w ${datadir}/warped/fullWarp -o ${datadir}/cnr_maps |
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.
Did you intentionally choose trilinear rather than spline interpolation here?
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.
No, that should have been spline interpolation
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.
Thanks for adding the CNR maps into the T1w space.
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.
Looks good to me. Are you running one more quick test, just to make sure the latest changes didn't break anything?
Indeed, the test will probably not finish today, but I'll let you know if it works. |
This version seems to work both with and without gradient-distortion correction |
I would merge this when the conflicts are resolved |
What conflicts? The PR is reporting that it has no conflicts and merging can be performed automatically. |
This branch cannot be rebased due to conflicts |
It conflicts for the rebasing merge mode, which I asked him to use. If @MichielCottaar can rebase this branch onto master and manually resolve any conflicts, that should fix it. However, if he has been merging in the latest master at several points, then we may have to use the merge commit mode. |
I am letting Tim handle any PR that does not Rebase and merge automatically since he has asked me not to use the other modes. |
Sorry, I did use merge onto master. If you prefer, I could just squash all of the history, which would allow a rebase to work. However, that would hide the history anyway, so I think it makes more sense to just use merge commit mode for this branch. |
This should add the single-subject QC report to the HCP pipelines. I am still testing this locally, but that requires rerunning eddy, so it will probably not be finished before the AHM.