Fitting code contribution: SR_LUMC Matlab code for IVIM, DTI, and IVIM-DTI fitting - #170
Fitting code contribution: SR_LUMC Matlab code for IVIM, DTI, and IVIM-DTI fitting#170s-rauh wants to merge 1 commit into
Conversation
…ting code contributions.
|
I went through the code and spotted a few things:
tmpdat and tmpb are re-initialized from scratch at the start of every loop iteration (tmpdat = datafit(:,v); tmpb = bval;), so the v == 1 condition means only the first voxel gets the b-value range selection. All other voxels fit the full range. Compare with how v == 1 is correctly used elsewhere in the same file - for one-time initialization of bounds that persist: Looks like the v == 1 condition was carried over from the two_step case where it's used for one-time bounds init, but here the data selection needs to happen every iteration.
This is called after bval_scaling() divides b-values by 1000 (when max(bval) > 100). So typical clinical b-values [0, 50, 200, 800] become [0, 0.05, 0.2, 0.8]. Since min(bval) = 0 < 1, it uses bval < 1, which selects ALL b-values (they're all < 1 after scaling). The normalization factor becomes the mean of ALL signals across ALL b-values, not just b=0. This effectively destroys the normalization - it should be bval == min(bval) or bval < 0.001 in the else branch. |
Fitting code contribution in src/original/fitting. The code contains Matlab fitting routines for IVIM, IVIM-DTI, and DTI.