3dNLfim demri_3

Dear AFNI team,

I am running 3dNLfim for the kinetic modeling (demri_3). I have a question regarding how to set T1 maps.

I got some results if AFNI_MODEL_D3_RIT environment variable is set to a typical constant value. However, the actual relaxation times at different tissues should be taken into account for a more accurate parameter estimation.

I computed T1 maps (msec) from multiple MR acquisitions and set AFNI_MODEL_D3_R1T_DSET environment variable with the name of the map. However, the code says that AFNI_MODEL_D3_RIT is missing. But, if I define both variables, I obtain the same result as if I had only defined AFNI_MODEL_D3_RIT.

Is there anything I am missing?



Hi Marcelo,

Have you looked at the AFNI_MODEL_D3_R1I_DSET variable?
That seems to be its purpose. See the help for details:

3dNLfim -DAFNI_MODEL_HELP_DEMRI_3=Y -signal corn_flakes

Warning: it has been a long time since thinking about this.

  • rick

Note that dset must contain the intrinsic relaxivity on a per voxel basis in inverse seconds. As Rick says, we haven’t thought or looked at this in quite some time, but I think it’s still a very useful analysis. Here is an example of how we computed the relaxivity map and used it with the DEMRI model.

% more calcR1Irat.script
set highangle = rat_as+orig
set highbase = reg_ss_dynDTPA+orig
set highangledeg = 12
set high_nfirst = 4
set lowangle = rat_as_lo+orig
set lowangledeg = 3
set low_nfirst = 0
set TR = 0.0081
set maskdset = rat_man_mask+orig

delete previous temporary files if they exist

rm -f high_mean+orig.*
rm -f high_norm+orig.*
rm -f low_mean+orig.*
rm -f low_mean_vr+orig.*
rm -f lowhigh_ratio+orig.*
rm -f R1I+orig.*

#calculate mean / median of each dataset for first n timepoints
3dTstat -prefix high_mean -median $highangle"[0…$high_nfirst]"
if ($low_nfirst == 0) then
3dcalc -a $lowangle’[0]’ -prefix low_mean -expr ‘a’
3dTstat -median -prefix low_mean $lowangle"[0…$low_nfirst]"
3dvolreg -base high_mean+orig. -prefix low_mean_vr low_mean+orig
3dcalc -a high_mean+orig -b low_mean_vr+orig -datum float
-prefix lowhigh_ratio -expr ‘b/a’

calculate R1I map in sec^-1

3dcalc -a lowhigh_ratio+orig -b $maskdset -datum float -prefix R1I
-expr “step(b)*min(2.5,(max(0.5,(log(
((a * cosd($lowangledeg)*sind($highangledeg)) -
cosd($highangledeg)sind($lowangledeg)) /
sind($highangledeg)-sind($lowangledeg))) / $TR))))”

calculate dataset normalized to first n sub-bricks

3dcalc -a $highbase -b high_mean+orig -c $maskdset -prefix high_norm
-datum float -expr ‘a*c/b’

% more nlfim.script

arn.nii and barr.nii are human data sets

there is no lo flip angle data here

these are dynamic sequences of 12 slices x 30 times

20 seconds/ volume

TR ~ 7.6 FA ~ 30

The other datasets are from a rat -

ss_loDTPA is for making a T1 map - TR 8.1 FA 3

reg_ss_dynDTPA is the dynamic with TR 8.1 and FA 12

setenv AFNI_MODEL_D3_R1 9.6
setenv AFNI_MODEL_D3_RIB 1600ms
setenv AFNI_MODEL_D3_RIT 1300ms
setenv AFNI_MODEL_D3_TR 8.1ms
setenv AFNI_MODEL_D3_TF 20s
setenv AFNI_MODEL_D3_R1I_DSET R1Irat+orig

setenv AFNI_MODEL_D3_MP_FILE rat_sagroi_only.1D


input dataset is a normalized dataset

scaled to the preinjection mean/median voxel value

3dNLfim -input high_norm+orig
-signal demri_3
-ignore 0
-noise Zero
-mask rat_man_mask+orig
-nrand 10000
-nbest 10
-sfit rat_sfit1
-jobs 2
-progress 10000
-bucket 0 rat_demri1