Closed Barisevrenugur closed 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.
@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.
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.
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:
Creation of Results and Supplementary directories (supplementary directory contains the logs, processing paramameters, local dimension and residual maps). Results contains the denoised images and metadata sidecar json files.
Creation of warnings-errors in case minimum requirements are not met and there are missing inputs.
Extended metadata writing to the resulting denoised images that carries the denoising parameters.
Including in the resulting images the acquisition parameters (if available) so that the denoised images can be fed back to the toolbox through dependencies.
Acknowledgements
I would like to thank:
Pilou Bazin for several discussions during the compilation of the .jar files of the (Java) Lcpca denoising modules and also during the implementation of the Java-Matlab interface of this module.
Luke for pointing me to the CreateB1Map module as possibility for the Matlab batch GUI of the denoising module. In the end, I have implemented the Matlab batch for this module by combining features of the Matlab batches for CreateB1map and Pipelines (Spatial Processing) modules.
Luke and Siawoosh for their suggestions on the Matlab batch.
Kerrin for supplying additional 0.6mm data (both magnitude and phase) for testing.
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:
(1,1): denoised image
(1,2): original image
(2,1): difference
(2,2): histogram of the difference
0.5 mm PD data (only magnitude, 8 Echoes, .img/.hdr files)
Echo 1:
Echo 8:
0.6 mm T1w data (both magnitude and phase, 5 Echoes for both, .nii/.json files)