-
Notifications
You must be signed in to change notification settings - Fork 532
dMRI pre-processing (complete) #530
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
Conversation
* Added pipeline to __init__.py so its loadable the same way the others are * Polished code in pipeline creation
Removed some useless functions and improved susceptibility pipeline
In order that supporting logging for fdt_rotate_bvecs script, the verbose output of FLIRT is saved to file if the save_log input is provided.
* Added motion correction pipeline, rotating the b-matrix * Some minor fixes on the rest of pipelines
* ENH: modified parameter for parallel imaging, now it is possible to modify the acceleration factor * ENH: created new pipeline for full dMRI-EPI full distortions correction. Includes: motion, eddy currents and susceptibility correction
outputs['out_log'] = os.path.abspath( outputs['out_log'] ) | ||
return outputs | ||
|
||
def aggregate_outputs(self, runtime=None, needed_outputs=None): |
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.
Adds support to save the output log of FLIRT in verbose mode. It was necessary when I wanted to use the fdt_rotate_bvecs script from FSL. Finally, I decided to perform the B-matrix rotation using numpy.
Removed files regarding MBIS tool
new_bvecs = [ bvecs[:,0] ] | ||
|
||
for i,vol_matrix in enumerate(in_matrix[1::]): | ||
bvec = np.matrix( bvecs[:,i] ) |
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.
use np.array instead of np.matrix.
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.
Isn't it necessary for the posterior matrix multiplication?
very nice effort. a couple of things:
|
* Improved documentation, and added warning about bvec rotation * Improved FSL FLIRT interface to support spline interpolation * Added spline interpolation wherever resampling is required * Syntax checked with autopep8
Excellent work again. I think we can simplify this a bit. As far as I know eddy correction (as implemented in FSL) is just affine registration of all volumes to the reference volume. Which is the same what create_motion_correct_pipeline is doing (with addition of bvecs rotation). And the same what create_susceptibility_correct_pipeline would do. Instead I propose the following:
This way the corregistration code is not repeated and we can drop create_dmri_preprocessing pipeline. |
Thanks, I explicitly separated eddy_correct and motion correction because they should be treated separately (it is detailed here: http://wiredminds.blogspot.com.es/2011/06/dti-preprocessing-in-fsl-b-vector.html) For fMRI, both pipelines could (and should) be performed at once, as you suggest. As it is implemented right now, you can keep using only eddy_correct (actually, you should). About refactoring organization, I would be happy to make it, no problem. EDIT (explanation): eddy_correct needs dof=12 for FLIRT |
Ok I get it now - so the difference is that for bvecs rotation you need 6 dof and for actual correction 12 dof? In this case I propose the following:
I'm just trying to avoid code redundancy. |
Great :) Sounds good that all the spliting-coregistration-merging process is performed with just one pipeline. I don't know if I fully understand 3). In the susceptibility pipeline, the optional coregistration is against the magnitude of the fieldmap... About 2): this is OK for dMRI, but you could not use this pipeline for fMRI, that only needs one coregistration with dof=12. So, this could be a possible structure: Pipeline 1: dwi corregistration:
Pipeline 2: eddy_correct The complete correction pipeline (calling all the rest) could be avoided, but it is really convenient... |
(and it is useful and illustrating to have the 3 different corrections separated, specially for dMRI experienced people) |
the other thing that might be useful, since you are using the fsl tools anyway, is to get another pipeline with the newer tools - topup and eddy - we don't have interfaces for those yet. but all of that can be in two separate PRs. |
Yes, I did not see those two new tools :$, but I agree, they should go through two separate PRs |
@chrisfilo I quickly created the co-registration pipeline, but realized that it is only apt for the eddy currents and motion correction pipelines. Parameters are quite different in the susceptibility correction pipeline. I agree with @satra: probably it is better to explore interfacing the newer tools (topup and eddy) and provide workflows for them, allowing the community to make comparisons. Are you still interested on creating this extra pipeline? It just saves 3 or 4 lines in each pipeline (and adds constraints for people interested on modifying them). |
Ok fair enough (sorry for misreading the pipeline3 - you are right of course). In the future we should think of extracting rotation components from the 12 DOF affine matrices instead of doing it in two steps (see http://callumhay.blogspot.de/2010/10/decomposing-affine-transforms.html ). |
dMRI pre-processing (complete)
* master: (42 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: (47 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files
* master: (47 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: (32 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: (28 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: (28 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: (28 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files
* master: (28 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: (28 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: (47 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: (28 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: (47 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: (47 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
* master: (47 commits) fixed applymask output fixed test Fixed some details for the PR nipy#530 Removed accidentally added files (nipy#530) Updated changelog Updated dMRI and fMRI pre-processing Added motion correction pipeline Modified FSL FLIRT interface to provide log support Polished code buildtemplateparallel.sh - issue with input files Update legacy.py - buildtemplateparallel.sh Minor fixes Added MBIS to sub-package configuration list Standardized import to add all utilities at once First implementation for MBIS New EPI dewarp workflow (nipy#525) New EPI dewarping using a workflow api: force users to explicitly define whether to sort files BF: Fix SplitNifti to generate unique filenames for outputs. added mask input for bias field correction ...
Continuing with #525, a full pre-processing pipeline for dMRI is proposed:
TODO: it would be nice to separate workflows for consistency, collecting all of them simultaneously appropriate for fMRI and dMRI on one side and separating the ones specific for dMRI (the motion correction pipeline and the full pre-processing pipeline).