daducci / AMICO

Accelerated Microstructure Imaging via Convex Optimization (AMICO) from diffusion MRI data
Other
104 stars 62 forks source link

Computation of Kernels #4

Closed NeuroImagingWorld closed 9 years ago

NeuroImagingWorld commented 9 years ago

Hello,

We have a question related to computing Kernels. In the documentation it is indicated that based on the data structure set up, kernels will be computed only once per each study to save time. However, if we have a scenario where different scans in the same project might be run with different protocols, does the software automatically detect the change in protocol and recompute the kernels if needed.

Appreciate your assistance.

Thanks, Prasanna

daducci commented 9 years ago

Hi Prasanna, at the moment the software first computes an high-resolution version of the kernels and then performs the rotations to build the lookup-tables in harmonic space (as this is much faster). The SH coefficients are then stored to files and then projected/resampled to the specific subject space in a second step. I made this choice because, in the usual scenario, all subjects in a given study have the same acquisition protocol (i.e. number of shells and their b-values).

In your use-case, the software is not aware that there are different protocols as the kernels are stored each time in the common folder "kernels". So, what you have to do is to force the computation for each subject/protocol with AMICO_GenerateKernels( true ). Of course this will be a bit slower (couple minutes more for each subject).

But if you try to explain me what is your use-case, I can try to modify the code to be more general.

NeuroImagingWorld commented 9 years ago

Thank you for the response. In our case, we wanted to see if we can have a common repository which can be used to query if the gradients already have corresponding computations. If not compute for missing gradients and add to the repository for later reference. However since the computation time is not significantly high, for now we are planning to go with force computation for each subject as you have suggested.

daducci commented 9 years ago

I think this is totally feasible and quite easy to implement. At the moment I am a bit busy, but I can work on it for sure after the ISMRM.

kohske commented 9 years ago

I have also a question related to kernel in NODDI. The tutorial https://github.com/daducci/AMICO/tree/master/matlab/doc/demos/NODDI says

  1. load data (dwi, mask, dwi-scheme)
  2. compute kernal
  3. fit the model

then, if I change the mask, will I need to recompute kernal? Or, is it okay just to load data, skip kernel computation, and fit the model with new mask?

daducci commented 9 years ago

Hi @kohske, yes, you're right, the kernels remain the same and can be reused. Simply change the mask (e.g. _mask2.nii):

CONFIG.maskFilename = fullfile( CONFIG.DATA_path, 'mask_2.nii' );
AMICO_LoadData

and then you can redo the fit as usual:

AMICO_Fit()
kohske commented 9 years ago

@daducci Thanks, I got it. It's pretty quick. Thanks for this great package!!

I'm also looking forward to seeing python tutorial!!