Scaling step in afni_proc gives infinite values

Hello folks,

I get very weird behavior in scaling step.
on two of my participants, I get values up 10^38 and line like images (cf. image) on two consecutive TRs of my fMRI data.

The previous steps has normal images and the scaling of all other TRs have a mean of 100 and max 200 values in all voxels.

What could possibly get this behavior.

I ran two different afni_proc analysis (HRF and RRF regressors) On 4 different ASL analysis (high pass filtering on echo1, Suround substraction on echo1, MEICA all 4 echos, and mean of all 4 echos), this behavior only occurs in two subject after the MEICA extraction of perfusion weights, on the HRF regression analysis.
So all together, I have this behavior in two scaling out of 88 different datasets scaling.

Script are identical for the scaling part and before, for RRF and HRF analysis.
Scaling blocs do the same calculation between the 4 ASL analysis.

Here is the image :
TRs in question :

Hi-

Could you please share one of these afni_proc.py commands? And could you also provide more detail on what that image you are showing is?

In terms of tracking this down, it would help to start for looking at and verifying features from the very beginning. I would look at the time series of the initial input datasets in the GUI, and see if anything jumps out at me. The afni_proc.py-created QC HTML contains images of the raw data in the ‘vorig’ section, with ranges of values—how do those look?

One initial thing I wonder is if the datatype of input datasets are different for these bad cases than for another one. You can check this with:
3dinfo -datum -prefix DATA_SET_LIST

–pt

1 Like

Hello, thanks for the reply.

I can add some information indeed for it to be more clear :

here is the command I play to scale in afni_proc script :
" 3dTstat -prefix rm.mean_r$run rm.pb05.$subj.r$run.blur+tlrc
3dcalc -a rm.pb05.$subj.r$run.blur+tlrc -b rm.mean_r$run+tlrc
-c mask_epi_anat.${subj}+tlrc
-expr ‘c * min(200, a/b*100)*step(a)*step(b)’
-prefix pb06.$subj.r$run.scale "

As said, other methods of ASL extraction don’t have same problem, it is only the MEICA.
Multi-echo ICA uses tedana to extract BOLD signal for raw data.
IT is done as such :
"
foreach e (1 2 3 4)
# Low pass filtering for MEICA
3dTproject -polort -1 -input pb03.$subj.r$run.e0$e.volreg+tlrc -prefix BOLD_ECHO${e}.r$run.nii -stopband 0.09 9999 -mask mask_epi_anat.${subj}+tlrc.HEAD
end

tedana -d BOLD_ECHO*.r$run.nii -e 9.1 25 39.6 54.3 --fittype loglin --out-dir ./MEICAtoBEerased --mask mask_epi_anat.${subj}+tlrc.HEAD --seed 69
# extracting PW data with MEICA technique
3dTproject -input pb03.$subj.r$run.e01.volreg+tlrc -prefix rm.MEICA_PW_ECHO1.r$run.nii -dsort ./MEICAtoBEerased/desc-optcomRejected_bold.nii* -dsort ./MEICAtoBEerased/desc-optcomAccepted_bold.nii* -mask mask_epi_anat.${subj}+tlrc.HEAD
3dTproject -input rm.MEICA_PW_ECHO1.r$run.nii -prefix rm.highPassedEcho1.r$run -polort -1 -stopband 0 0.09
1deval -expr 'cos(PI*(t+1))' -num $tr_counts[$run] > cos.1D
3dcalc -a rm.highPassedEcho1.r$run+tlrc.BRIK -b cos.1D -prefix pb04.$subj.r$run.e01.MEICA -expr 'a*b' "

The signals don’t have any artefacts at first look, and other methods show coherent results (tSNR, CNR, variance explained…).

I will check the data still in case

So, all runs have correct data, only the all_runs in NIFTI format has these artefacts.

It seems it was a bad transfer from one computer to my harddrive.
When I check the NIFTI version on the computer it is clean, the one on my harddrive is corrupted. I don’t know how or why it gives this strange artefacts.

This image is on afni, it seems that some slices are correct in two dimensions or one, but never on all three.

So I copied the original dataset and everything is fine, just a strange behavior on UBUNTU.