Proc.py timing file issue

Hi all,

I constantly have the error message below when running proc.py script.

afni_proc.py -anat_has_skull yes -blocks despike tshift align tlrc volreg
blur mask scale regress -copy_anat mprage/mprage.EBH101.T1+orig -dsets
/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/FNT/fnt.EBH101.T1+orig
-tcat_remove_first_trs 3 -out_dir results -script
py_result_EBH101.T1.script -scr_overwrite -subj_id EBH101 -verb 2
-align_opts_aea -deoblique off -giant_move -Allineate_opts -usetemp
-tlrc_base MNI152_T1_2009c+tlrc -tlrc_opts_at -ok_notice -dxyz 1
-pad_base 100 -init_xform AUTO_CENTER -tlrc_suffix _MNI152
-volreg_align_to third -volreg_interp -Fourier -volreg_opts_vr -twopass
-noclip -dfile volreg.EBH101.T1.1d -volreg_tlrc_warp -volreg_warp_dxyz
3 -blur_filter -1blur_fwhm -blur_opts_merge -doall -blur_size 6
-mask_apply epi -mask_dilate 1 -regress_stim_times
/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt
/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.Fix.txt
/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.NF.txt
-regress_stim_labels Famous Fixation Notfamous -regress_basis
‘BLOCK(4,1)’ -regress_censor_motion 0.3 -regress_opts_3dD -gltsym ‘SYM:
+Famous -Notfamous’ -glt_label 1 Famous_vs_Notfamous
-regress_est_blur_epits -regress_est_blur_errts

end get_user_opts SubjProcSream: subject regression
Dsets : not yet set
user_opts: OptionList: read_options (len 31)
opt 00: -anat_has_skull args found = 1
opt 01: -blocks args found = 9
opt 02: -copy_anat args found = 1
opt 03: -dsets args found = 1
opt 04: -tcat_remove_first_trs args found = 1
opt 05: -out_dir args found = 1
opt 06: -script args found = 1
opt 07: -scr_overwrite
opt 08: -subj_id args found = 1
opt 09: -verb args found = 1
opt 10: -align_opts_aea args found = 5
opt 11: -tlrc_base args found = 1
opt 12: -tlrc_opts_at args found = 7
opt 13: -tlrc_suffix args found = 1
opt 14: -volreg_align_to args found = 1
opt 15: -volreg_interp args found = 1
opt 16: -volreg_opts_vr args found = 4
opt 17: -volreg_tlrc_warp
opt 18: -volreg_warp_dxyz args found = 1
opt 19: -blur_filter args found = 1
opt 20: -blur_opts_merge args found = 1
opt 21: -blur_size args found = 1
opt 22: -mask_apply args found = 1
opt 23: -mask_dilate args found = 1
opt 24: -regress_stim_times args found = 3
opt 25: -regress_stim_labels args found = 3
opt 26: -regress_basis args found = 1
opt 27: -regress_censor_motion args found = 1
opt 28: -regress_opts_3dD args found = 5
opt 29: -regress_est_blur_epits
opt 30: -regress_est_blur_errts
** warning: removing first 3 TRs from beginning of each run
→ the stimulus timing files must reflect the removal of these TRs
++ -copy_anat +tlrc exists = 0
++ setting roi_dict[‘brain’] = full_mask.$subj
– dset FNT/fnt.EBH101.T1+orig : reps = 175, tr = 2.0s
– dset FNT/fnt.EBH101.T1+orig : reps = 175, tr = 2.0s
– reps = 175, tr = 2, datatype = 1, scaled = 0
– tcat: reps is now 172
++ updating polort to 3, from run len 344.0 s
– volreg: using base dset vr_base+orig
++ volreg: applying volreg/tlrc xforms to isotropic 3 mm tlrc voxels
– applying anat warps to 1 dataset(s): mprage.EBH101.T1
#Now running:
cd /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1
@FindAfniDsetPath MNI152_T1_2009c+tlrc
– masking: group anat = ‘MNI152_T1_2009c+tlrc’, exists = 1
++ applying mask as ‘epi’
– have 1 ROI dict entries …
ROI key ‘brain’ : full_mask.$subj+tlrc
– creating motion censor command, file = dfile_rall.1D
+d reading file /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt
** unusable token, bad floats : ??122
line = ??122 258 90 150 38 230 266 226 54 178 62 246 302 182 142 306 174 130 34 110 242 318 282 270 58 278 14 86 46 298
** A1D: failed to read data file /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt
** failed to load stimulus timing file ‘/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt’
+d reading file /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.Fix.txt
** unusable token, bad floats : ??18
line = ??18 22 42 50 74 134 138 170 190 194 202 214 222 234 238 254 274 290 310 314
** A1D: failed to read data file /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.Fix.txt
** failed to load stimulus timing file ‘/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.Fix.txt’
+d reading file /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.NF.txt
** unusable token, bad floats : ??106
line = ??106 154 198 26 102 10 6 322 294 70 262 146 162 66 158 218 30 94 126 286 210 82 78 186 118 114 166 206
** A1D: failed to read data file /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.NF.txt
** failed to load stimulus timing file ‘/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.NF.txt’

This problem makes me confused because some files were completed but some were not. Could you please let me know what is the issue here?

Thanks,
JW

It looks like you have bad characters in the timing files.
What editor did you use to create them?

What is the output of:

file_tool -test -infiles /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt

  • rick


– consider use of ‘-test_stim_files no’ if files are OK

** script creation failure for block ‘regress’
+d generated EPI review script @epi_review.$subj

I can see these two lines below.

Screenshot of timing file that results in error and timing file that doesn’t result in errors are attached. Other files were running successfully without error. I am not sure why that specific files have errors. Could you please advise?

Timing File with Error.png

Timing File without Error.png

Would you please run file_tool on those files? I missed
the ‘-’ before -infiles in my example. Please show the
output from:

file_tool -test -infile XXXX

  • rick

[hlhp-105:FNT/Scripts/FNFproc] titus% file_tool -test -infiles /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt
file ‘/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt’: missing final newline
/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt has 114 bad characters
– starting at line 1, position 0
file ‘/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt’ has BOM header: UTF-16, little-endian
file ‘/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt’ has non-printable chars
bad chars start at position 0
/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt file type: MAC
consider: file_tool -show_file_type -infile /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt -prefix FIXED.txt
[hlhp-105:FNT/Scripts/FNFproc] titus%

The above is the result.

If you add “-prefix FIXED.txt” to that file_tool command,
does it give you something that works?

  • rick

Sorry for the late response. So the code should look like
‘file_tool -test -infiles -prefix FIXED.txt /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt’ ?

It says ‘error: unknown option, </Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt>’

Note quite, the “-prefix FIXED.txt” has separated “-infiles” with the
actual input file name. Just move “-prefix FIXED.txt” to the end.

It might be more clear if you ‘cd’ to that directory so the long path
to the input file is not needed.

  • rick

Hi Rick,

I got the below result from your instruction. Does it look good? I am wondering if your instruction fixed the problem in the timing file.

file_tool -test -infiles /Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt -prefix FIXED.txt
– will fix any bad char check errors in FIXED.txt
file ‘/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt’: missing final newline
/Volumes/BRAINSMITH_DS/EBH/FNT/Analysis/EBH101/EBH101.T1/timing/EBH101.T1.F.txt has 114 bad characters
– starting at line 1, position 0
– fixed 114 rich quotes
– missing final newline was added
** non-Unix check output file ‘FIXED.txt’ exists, will overwrite
– will fix any non-Unix check errors in FIXED.txt
FIXED.txt file type: DOS
** bad backslash output file ‘FIXED.txt’ exists, will overwrite
– will fix any bad backslash errors in FIXED.txt
→ FIXED file written to FIXED.txt

Does it look right? Give it a try.

Note that since it mentioned fixing rich quotes, you may be
using an editor that is not appropriate, or you may be forgetting
to edit and save as plain text. These files need to be simple
ASCII.

  • rick