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
DTI/DKI RESTORE using the CLI #2574
Comments
This is usually an indication of a sigma value that is too small. It means that so many values were marked as outliers in this particular voxel, that there are not enough values left to compute the tensor. Not solving the issue you are reporting, we should also really fix the error handling here, because that error message confuses many users. |
Thanks for the quick response yesterday and that explanation makes sense about the error message. The data were preprocessed using patch2self, so the expected noise level, particularly in non-brain/head areas (note: full head rodent images in my particular, current application) is small and therefore making the mean of the MP-PCA sigma image file in this example very small. That said, any recommendations on calculating sigma for RESTORE using preprocessed data, particularly using the CLI? I see the following challenges:
Thanks for any thoughts/insights. |
@araikes -- This is very interesting (at least to me)! Can you share some before after pictures so that we get a better sense of what's happening? Using Patch2Self there are 2 alternatives that can be used as
These are not merged in DIPY yet, but I am happy to share the code and test it out 👍🏽 |
Those are interesting options and I'd be happy to try either of them out to see if they are useful in this effort. As far as pictures go, what would you like to see? Obviously when I hit that error message, there's no picture to share since nothing gets produced. Other than that, CLI options with |
Hi @araikes -- Sorry for the slowness in my response! I think it may be a good idea to try doing: Raw Data -> DTI fit via 'OLS' model -> FA VS Raw Data -> Patch2Self -> DTI fit via 'OLS' model -> FA The reason I am asking to use OLS and not RESTORE or WLS (default) is: it will reflect clearly how much outliers are left in the data. AFAIK: Patch2Self should suppress most of them and you may not need to do RESTORE at all :) Thanks, |
Sure, I can do that but I want to clarify within my workflow. Here's the workflow to this point:
Happy to shorten for test cases here but let me know if there are any other images you want within that workflow. |
Models fit were |
Hi @araikes ! Sorry for the slowness in my response. As far as I can see, Patch2Self is suppressing a lot of the outliers in your data and you may not need RESTORE. Just as an experiment, can you also try to switch the order of your pipeline: |
Yes I will. I'll try and get it done tomorrow. Thanks |
Description
There isn't currently a direct way to compute the sigma value in the CLI framework for
dipy_fit_dti
ordipy_fit_dki
with the method asRESTORE
. Several noise estimation sigma options exist in DIPY, including:dipy.denoise.noise_estimate.estimate_sigma
: This is the method presented in the DTI RESTORE tutorial. However, this is not forward facing for the CLI and returns a 1D array with an estimate for each volume in the 4D DWI data. If not built directly into the DTI/DKI CLI workflows, this would need to be computed and passable as an array.Currently Option 1 isn't feasible as, per @skoudoro on Gitter,
--sigma
is expecting a singular value. I tried Option 2 but got back an error message:I don't know if that error is related to the
--sigma
parameter or not, but the same data and same mask using defaultdipy_fit_dti
methods computes the tensor without issue.[If reporting a bug, attach the entire traceback from Python and follow the way to reproduce below]
[If proposing an enhancement/new feature, provide links to related articles, reference examples, etc.]
Way to reproduce
[If reporting a bug, please include the following important information:]
singularity exec /groups/adamraikes/singularity_images/cibs_neurotools_1.0.15.sif dipy_fit_dti sub-control01_desc-preproc_dwi.nii.gz sub-control01_desc-preproc_dwi.bval sub-control01_desc-preproc_dwi.bvec sub-control01_desc-dsurqe_mask.nii.gz --fit_method 'RESTORE' --sigma 10.8819
The text was updated successfully, but these errors were encountered: