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
Get a standard interface for the functions using the noise variance #636
Comments
Hi, this is an interesting proposition. I think nlmeans and restore are good candidates for now. In your comment above you talk about having a picture showing the advantage of your suggestion but you are not showing us the picture. |
Yes - I think that would be an improvement. For the time being, notice that the RESTORE implementation can accept an array of sigma values, if the user believes there is any reason that some directions might be noisier than others. This is not documented very well in the Looking through the code, I actually see no particular block to extending the As for the images you showed: are these images of the noise or of the signal? If signal, is the non diffusion-weighted (b0) signal? |
For the easy part, these are both at b1000, bvec the closest to (0,1,0) if I remember correctly. You don't see that effect much on the b0 since the signal is really strong and relatively homogeneous, but here you go, another scan at 1mm, 1.25mm, 1.5mm and 1.9mm. You can actually see the signal drop with the voxel size (or b-value), while the noise is the same across the board. For the second part of your comment, I'm not sure anything else than a single scalar or a 3D volume makes sense. What I mean by that is think as the noise as being sampled from a single magic distribution on a voxelwise basis. Disregarding the b-value or the sequence used, that distribution is sampled. Whenever the signal is high (T1, b0) the noise value is drowned in real signal, so no problem. Whenever you have a low signal (high b-value/high spatial resolution) you start to have more noise than signal, hence the impression that the noise is stronger, while it's more like the signal is getting weaker instead. So a 1D array for a 4D volume does not make sense, as the noise caracteristic should be the same unless you have weird hardware problems (like spiking/dropout/whatever can go bad in complex space) I think. As for the implementation details, the idea would be
Regarding point 2, I suggest doc fixing to make it clearer. Point 1 is changing interface/patching code around, and point 3 is well, depends. I have two way already implemented for that, mine and the one from http://www.ncbi.nlm.nih.gov/pubmed/25499191 (they also give out matlab code). There is also one from http://www.ncbi.nlm.nih.gov/pubmed/25465845 which is available in R code and seems to work well, but takes so much time it's not realistically useable I think. |
Thanks! If I understand these images and your interpretation correctly, the noise I agree with you that using a different sigma for each volume is a strange On Thu, Apr 30, 2015 at 10:54 AM, Samuel St-Jean notifications@github.com
|
I am convinced! Let's make a plan: From your list, number 2 is obviously the lowest-hanging fruit, because it Number 1 is not too hard, I think, so can be the next thing to do. Do you Finally, number 3 as you say depends. When you say that you already have a On Thu, Apr 30, 2015 at 11:28 AM, Samuel St-Jean notifications@github.com
|
I have another implementation based on the first mentionned paper, but it only works on rician distribution by design, while my invention works on everything. |
Apparently I have a somewhat old but probably working version over here https://github.com/samuelstjean/dipy/blob/stabilisation/dipy/denoise/signal_transformation_framework.py bottom completely, the last two functions. |
Thank you for this discussion! I guess we can close this issue for now. Feel free to reopen if anything on these lines pops up in the future. For diffusion data, we have MPPCA and Patch2Self both of which dont need an explicit sigma estimate! |
This is a bit confusing, but so far we have two method to estimate the noise, and almost no method to actually take advantage of what they offer nor point to the limitation of one or the other.
This should be made clearer, since people seems to get confused with their usage look at the mailing list for a recent discussion on restore and problems with dipy.denoise.estimate_sigma).
So, we should revamp the methods using incertainty in their formulation to accept global one valued input or local input for each voxel. So far, that would be restore and nlmeans, any other I'm not aware of/forgetting?
And also I suggest to make them more consistent. For example, restore has a built-in fix for rician noise computed from the variance of a gaussian distribution, but this does no make sense if you compute directly that value as piesno does. One way to uniformize this would be to put the fix inside the noise estimation module under a new function, and people could apply it themselves if need be.
Another thing is that no function accept a noise parameters on a voxelwise fashion, which is needed for spatially varying noise. It would be easier to have two codepath : one with a single value for the whole 4D volume, and one accepting a 3D volume for each voxel, thus covering all cases for all algorithm. And laos we should add in the doc that the noise_estimate function should really be used on a whole volume and not slices/subparts of the dataset, as it is based on a statistical estimator, i.e. you need a ton of data for it to be valid.
So that's it, I also have pretty picture to show why taking both single value and 3D volume of variance input is needed to cover all cases. So any other algorithm we should adapt while I'm at it?
The text was updated successfully, but these errors were encountered: