hMRI-group / hMRI-toolbox

A toolbox for quantitative MRI and in vivo histology using MRI (hMRI)
GNU General Public License v2.0
61 stars 44 forks source link

add denoising module to toolbox: Java-Matlab interface for LCPCA denoising #97

Closed Barisevrenugur closed 6 months ago

Barisevrenugur commented 7 months ago

Description

This PR implements a denoising module to the toolbox. Two other denoising methods will be added but the first one is the Lcpca denoising:

Bazin, et al. (2019) "Denoising High-Field Multi-Dimensional MRI With Local Complex PCA", Front. Neurosci. doi:10.3389/fnins.2019.01066

The Java module for this denoising method was originally written by Pilou Bazin. In the denoising module, we implement a Java-Matlab interface together with the pre-compiled .jar files which makes it possible to run the Lcpca denoising in the Matlab environment, in the setting of hMRI-toolbox with both magnitude and phase (optional) images.

The initial tests were successful with the standard built-in defaults, both with magnitude-only data and magnitude-phase data. We offer below a selection of test results to illustrate that Gaussian noise was removed and Java-Matlab interface is working.

Notes to read before runnning

This is not a big concern for magnitude-only data but for magnitude-phase data, you might need to increase the Java heap memory. In our case, for our data, ~10GB was enough, perhaps even less is enough but we did not check this. Please set an appropriate Java heap memory size depending on your data set, if you do not want to bother about this, maybe set a high number.

The module has pretty much all the functionalities that the other modules possess currently:

Acknowledgements

I would like to thank:

References

TO-DO

Example Test Images

What is most important in these examples is what is removed and whether or not it is the Gaussian noise. As seen in the histograms, the removed part is Gaussian. In each case, the description of 4 images (as a matrix) is as follows:

0.5 mm PD data (only magnitude, 8 Echoes, .img/.hdr files)

PDecho8

0.6 mm T1w data (both magnitude and phase, 5 Echoes for both, .nii/.json files)

dpecho1mag

dpecho5Phase

lukeje commented 6 months ago

@Barisevrenugur Are you sure this was ready to be merged already? As far as I can tell there is still no convenient way to get the output of the denoising into the map creation batch script, and no test has been added for the new functionality.

Barisevrenugur commented 6 months ago

@lukeje yes, this was fully tested and ready to be used as is, therefore merged but a more convenient way for getting the output from dependencies (at the moment it lists all images with increasing number- one needs to add them to the createMaps having in mind the number of echos) and other useful additional functionalities (such as some test in hmri_code_tests) will be added when I do the pull request for the second denoising method.

lukeje commented 6 months ago

Thanks for the clarifications and for getting this into the toolbox. Don't forget to add some documentation to the wiki if you have time.