Image orientation changed after running tedana



I am currently using to combine multi-echo data. The script runs smoothly, but the optimally combined data appears to be tilted.
Looking at the intermediate files I can see that this happens at the beginning of the script, i.e. after applying 3dZcat (see attached). Would you know why this change in orientation is happening, and is there any way to prevent it? AFNI does mention that I should consider running 3dWarp -deoblique, but this just does the exact same thing to the orientation.

Many thanks
Best regards,


What version of tedana are you using?


version__=“v2.5 beta11” is stated in my file


Hi @bramb !

It sounds like this is the tedana that ships with AFNI which – although it inspired the tedana @tsalo and I work on – is actually quite different in its internals. If there are any folks on here who monitor AFNI questions, they would be the experts on why you’re seeing this image orientation change ! Or you could post on the AFNI message board.

Hope that helps,



Hi Elizabeth, @emdupre @tsalo

Thank you for your reply. You are correct. I was under the impression that I was using your version after running pip install tedana, but somehow got lost in the process and ended up using the AFNI version.

I created a miniconda environment for running the updated tedana (after pip install it says version 0.0.7).
I am now able to run t2smap, but not tedana:
Traceback (most recent call last):
File “/home/bram/.local/bin/tedana”, line 7, in
from tedana.workflows.tedana import _main
File “/home/bram/.local/lib/python2.7/site-packages/tedana/”, line 8, in
from .due import (due, Doi)
File “/home/bram/.local/lib/python2.7/site-packages/tedana/”, line 19, in
from builtins import str
ImportError: No module named builtins

I am guessing that it has something to do with the environment trying to use python 2.7 (which I don’t understand, because it has version 3.7 installed)?

Just to see what happens with the orientation I ran t2smap, and I can gladly say that the orientation was preserved. Really keen on getting the ‘correct’ tedana to run, would you have any advice?

Many thanks,
Best regards,


Indeed, tedana requires Python 3. I’m not sure what happened, but my guess is that the Python 3 miniconda environment wasn’t activated when you called pip install tedana?


Hi Taylor,

I tried pip install tedana in both the base environment and tedana environment but ended up with the same error. Running pip install future in the base environment (even though it was already installed in the tedana environment) somehow fixed the problem.

I have tried to run tedana a few times, but the process was killed due to memory error (which seems odd with 32gb RAM/25gb swap space?). I have also tried running it with compressed files but it just seems to get stuck, running for several hours on a single subject dataset:

INFO:tedana.workflows.tedana:Loading input data: [‘rasubj08_func_cap_ET1.nii.gz’, ‘rasubj08_func_cap_ET2.nii.gz’, ‘rasubj08_func_cap_ET3.nii.gz’]
INFO:tedana.workflows.tedana:Computing EPI mask from first echo
INFO:tedana.workflows.tedana:Computing T2* map
INFO:tedana.combine:Optimally combining data with voxel-wise T2 estimates
INFO:tedana.decomposition.eigendecomp:Computing PCA of optimally combined multi-echo data
INFO:tedana.decomposition.eigendecomp:Making initial component selection guess from PCA results
INFO:tedana.combine:Optimally combining data with voxel-wise T2 estimates TE- and S0-dependent models to components

Apologies for the beginner questions. Your help is much appreciated.

Best regards,


We’ve seen memory issues happen once before, but I think solving the issue kind of fell onto the back burner. I’m sorry to see that it’s affecting your data. We will move it up the queue and try to resolve it soon.

Would you mind sharing some information about your data to make it easier for us to replicate the bug? I’m thinking total file size for one echo, size in X/Y/Z dimensions, and number of TRs should be sufficient.


No problem. Single echo time files are 1.1gb each (696mb compressed). These are relatively long functional runs as we are doing pharmacological fMRI: 36minutes with a TR of 1.6s = 1350 volumes. We are getting 50 slices of 2.2mm (X/Y/Z = 92/92/50)