SteenMoeller / NORDIC_Raw

Matlab code for performing image reconstruction in MRI and performing the NORDIC denoising
Other
54 stars 25 forks source link

Issue with kernel_size_gfactor Option in NIFTI_NORDIC.m #19

Closed dvm-shlee closed 6 months ago

dvm-shlee commented 1 year ago

I've come across an issue in the NIFTI_NORDIC.m file when using the kernel_size_gfactor option while ARG.use_magn_for_gfactor not provided. (default = 0)

The error appears to be related to an index issue in the following line of code: https://github.com/SteenMoeller/NORDIC_Raw/blob/0aac63cd8907db8f6963bced63d34903cc545535/NIFTI_NORDIC.m#L351

Although kernel_size_gfactor is considered a 3-valued array, the code at this line attempts to access the 4th element, causing the program to crash due to an index error.

I'm not entirely sure about the intent of this code segment. Looking at the commented out code, it previously used the 3rd element of the array, so I'm wondering if the current code is meant to take an optional 4-element array for kernal_size_gfactor when a phase image is being used?

I appreciate any insight you could provide on this matter. Thanks!

P.S: My colleagues and I are thrilled about NORDIC, and we intend to incorporate it into our animal fMRI preprocessing pipeline. In light of this, I've compiled NORDIC into a Python library using MATLAB Compiler SDK and updated my forked repository of this project on GitHub. As I understand the licensing terms, I realize the need for caution while sharing such derivative work. Therefore, I have made efforts to accurately state the license in the README.md document of my repository (https://github.com/dvm-shlee/nordic_cli). Could you please review my repository and verify whether my statements are in line with the licensing terms as stated in your repository?

Should there be any requirement for updates or changes, I would be grateful if you could inform me.

SteenMoeller commented 1 year ago

The variation on estimating the gfactor is there. In addition to the kernel size, one can (and should) also prescribe how many volumes should be used for this. If you want the max, and don't know the number, just over estimate it. A gfactor kernel with size 3x4x5 and using 50 volumes would be kernel_size_gfactor = [ 3 4 5 50] and the same option using as many volume as possible could be kernel_size_gfactor = [ 3 4 5 99999]