and tedana on a few runs

Dear all,
I have 4 Multi-band-multi-echo EPI runs (3T Siemens Prisma)

When I run each run the pipeline works fine.
HOWEVER, when I like to preprocess more than one run I get an error (in the following example 4 runs, each has 3 echos);

    -dsets_me_run epi_run?_face_echo_00?+orig.HEAD                
    -echo_times 12 31.7 51.4                                 
    -combine_method 'm_tedana'

The error:

INFO tedana:tedana_workflow:609 Computing T2* map
Traceback (most recent call last):
File “/home/taliw/.local/bin/tedana”, line 8, in
File “/home/taliw/.local/lib/python3.8/site-packages/tedana/workflows/”, line 933, in _main
File “/home/taliw/.local/lib/python3.8/site-packages/tedana/workflows/”, line 610, in tedana_workflow
t2s_limited, s0_limited, t2s_full, s0_full = decay.fit_decay(
File “/home/taliw/.local/lib/python3.8/site-packages/tedana/”, line 356, in fit_decay
raise ValueError(
ValueError: Second dimension of data (12) does not match number of echoes provided (tes; 3)

Can I add a line to so it recognize that the data is concatenated between runs?
output.proc.SM327_all4runs.txt (182.9 KB)
proc.SM327_all4runs.txt (27.8 KB)

Furthermore, how can I change the default of tedana when I run

Thank you,
Tali Weiss

Hi Tali,

I believe you need to use multiple -dsets_me_run, with each corresponding to one run, rather than the run? wildcard you have there. Or, perhaps the better way would be to use the -dsets_me_echo option (AFNI program:

I see the following suggestions there:

-dsets_me_echo dset1 dset2 ...  : specify ME datasets for one echo
                                      (all runs with each option)

       These examples might correspond to 3 echoes across 4 runs.

            e.g. -dsets_me_echo epi_run*.echo_1+orig.HEAD
                 -dsets_me_echo epi_run*.echo_2+orig.HEAD
                 -dsets_me_echo epi_run*.echo_3+orig.HEAD

            e.g. -dsets_me_echo r?.e1.nii
                 -dsets_me_echo r?.e2.nii
                 -dsets_me_echo r?.e3.nii


-dsets_me_run dset1 dset2 ...   : specify ME datasets for one run
                                      (all echoes with each option)

       These examples might correspond to 4 echoes across 2 runs.

            e.g. -dsets_me_run epi_run1.echo_*+orig.HEAD
                 -dsets_me_run epi_run2.echo_*+orig.HEAD

            e.g. -dsets_me_run r1.e*.nii
                 -dsets_me_run r2.e*.nii

            e.g. -dsets_me_run r1.e1.nii r1.e2.nii r1.e3.nii r1.e4.nii
                 -dsets_me_run r2.e1.nii r2.e2.nii r2.e3.nii r2.e4.nii

Hi Tali,

@dowdlelt beat me to the response. tedana only denoises each run separately so afni_proc will call tedana once for each run. The above response is good. Here is code from a recent study of mine that might also be a useful demonstration:


Hi Tali,

Sorry about this. was supposed to fail if the length of -echo_times did not match the number of echoes implied by the -dset_me_* options, but I neglected to return that status. This will be fixed to fail up front, so you won’t have to wait for processing to get to tedana.

  • rick

Thank you @dowdlelt @handwerkerd, now it is working :slightly_smiling_face: