meica.py -e 0.012,0.028,0.044,0.06 -d sub-04710_task-rest_echo-1_bold.nii.gz,sub-04710_task-rest_echo-2_bold.nii.gz,sub-04710_task-rest_echo-3_bold.nii.gz,sub-04710_task-rest_echo-4_bold.nii.gz --prefix meica_output --out_dir ~/Downloads/data/sub-04710 ~/Downloads/data/sub-04710/func
Hi-
What error did you get?
And can you please provide the output of:
afni_system_check.py -check_all
?
My guess is you might have Python ver=3.*, and that (now very) old version of MEICA only works in Python ver=2.7. NB: pretty much every Python-based program distributed with AFNI works in either Python 2 or 3, except for that old MEICA program from Kundu et al. 2015, which only works in the Python 2.7 in which it was written; it isn't really actively maintained or updated, because there was a larger consortium that rewrote a new+updated version of MEICA, the tedana group (see Du Pre et al., 2021):
https://tedana.readthedocs.io/en/stable/
Note that you can also integrate both of the older and newer MEICA versions within afni_proc.py
, as part of a full FMRI processing pipeline; there is a demo for that, which you can get by running:
@Install_APMULTI_Demo1_rest
which has README files, and for which there is also this OHBM-2022 poster.
--pt
thank you for your response. the error is File "/home/masy/abin/meica.py", line 317
zeropad_opts=" -I %s -S %s -A %s -P %s -L %s -R %s " % (tuple([addslabs]*6))
^
TabError: inconsistent use of tabs and spaces in indentation
Hi-
OK, thanks, I think I do see an issue there in how the original program was written there: it seems to mix tabs and spaces; while visually it looks OK, it can be unstable. Sigh. But that should be fixable.
One question is: do you need to use this version of MEICA? It has mostly been left in the code base so developers of the newer version can test against it, and so users could see what differences there are. I think at this point in time, it would make most sense to use the most recent one, which I cited above. Does your project depend on using this specific, much older one?
thanks,
pt
I have put (what I believe to be) the fix into the codebase. At our next version update, you will have it available, but if you want to get it sooner you can run the following:
# go into binary file directory
cd /home/masy/abin
# make backup of current version
cp meica.py meica_OLD.py
# download the new version
curl -O https://raw.githubusercontent.com/afni/afni/master/src/pkundu/meica.py
# make the new version executable
chmod 755 meica.py
... and then you should be able to execute your command.
Please let me know how that goes, but again I would strongly suggest that using the more modern MEICA would be recommended.
--pt
no my project doesn't depend on using this specific.
OK, then I would suggest trying the new tedana-produced MEICA. An example of conveniently incorporating this into afni_proc.py is here:
@Install_APMULTI_Demo1_rest
You can even start with AFNI's optimal combination (OC) of multiple echos and see the boost in SNR that ME-FMRI provides. You can get tedana on your computer in multiple ways, but we do include it in one of our miniconda recipes, in particular here.
--pt
Hello Ptaylor,
I did all the above code including:
go into binary file directory
cd /home/masy/abin
make backup of current version
cp meica.py meica_OLD.py
download the new version
curl -O https://raw.githubusercontent.com/afni/afni/master/src/pkundu/meica.py
make the new version executable
chmod 755 meica.py
and
@Install_APMULTI_Demo1_rest and after that Set up Conda (verbose)(https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/background_install/miniconda.html#id2)
Hello Ptaylor,
I did all the above code including:
cd /home/masy/abin
cp meica.py meica_OLD.py
curl -O https://raw.githubusercontent.com/afni/afni/master/src/pkundu/meica.py
chmod 755 meica.py
and
@Install_APMULTI_Demo1_rest and after that Set up Conda (verbose)
But I can't run this code:
- Make a new text file called [
environment_ex1.yml
]:
name: py3_afni_tiny # TO MAKE: conda env create -f env*_ex1.yml dependencies: - python - "matplotlib>=2.2.3" # minimal ver for 'pythonic' APQC HTML - numpy - scipy - "flask>=2.1.2" # for local server for APQC HTML - "flask-cors>=3.0.10" # for local server for APQC HTML
... and then :
conda env create -f environment_ex1.yml
- Make a new text file called [
environment_ex2.yml
]
name: py2_afni_tiny # TO MAKE: conda env create -f env*_ex2.yml dependencies: - python=2.7 - "matplotlib>=2.2.3" # minimal ver for 'pythonic' APQC HTML - numpy - scipy - pillow - ipython - flask # for local server for APQC HTML - flask-cors # for local server for APQC HTML
... and then :
conda env create -f environment_ex2.yml
it gave me the error:
EnvironmentFileNotFound: '/home/masy/abin/environment_afni_ted.yml' file not found
However, my code ran and the output was like this:
python2.7 meica.py -e 0.012,0.028,0.044,0.06 -d sub-04620_task-rest_echo-1_bold.nii.gz,sub-04620_task-rest_echo-2_bold.nii.gz,sub-04620_task-rest_echo-3_bold.nii.gz,sub-04620_task-rest_echo-4_bold.nii.gz --prefix meica_out
-- Multi-Echo Independent Components Analysis (ME-ICA) v2.5 beta11 --
Please cite:
Kundu, P., Brenowitz, N.D., Voon, V., Worbe, Y., Vertes, P.E., Inati, S.J., Saad, Z.S.,
Bandettini, P.A. & Bullmore, E.T. Integrated strategy for improving functional
connectivity mapping using multiecho fMRI. PNAS (2013).
Kundu, P., Inati, S.J., Evans, J.W., Luh, W.M. & Bandettini, P.A. Differentiating
BOLD and non-BOLD signals in fMRI time series using multi-echo EPI. NeuroImage (2011).
++ Checking system for dependencies...
- Python version: 2.7.18
- Numpy version: 1.16.6
- Scipy version: 1.2.1
- Using AFNI 3dSeg for gray matter weighted anatomical-functional coregistration
- Dependencies OK.
++ Continuing with preprocessing.
++ Writing script file: _meica_sub-04620_task-rest_echo-1_bold.sh
++ Executing script file: _meica_sub-04620_task-rest_echo-1_bold.sh
Oblique data detected.
++++++++++++++++++++++++
+* Set up script run environment
ME-ICA directory exists, exiting
But I can not see the output,meica_out.
pls help me to solve this error.
I installed tedana . but i have problem with this part:
name: py3_afni_ted # conda env create -f env*afni_ted.yml
channels:
- conda-forge
- defaults
dependencies: - python
- "matplotlib>=2.2.3" # minimal ver for 'pythonic' APQC HTML
- numpy
- scipy
- "flask>=2.1.2" # for local server for APQC HTML
- "flask-cors>=3.0.10" # for local server for APQC HTML
- pip # used for TEDANA
- pip:
- tedana # getting TEDANA
how can i find the correct directory for yaml file?
the error is :
masy@ubuntu:~/Downloads/data/sub-04620/func$ conda env create -f env*afni_ted.yml
- tedana # getting TEDANA
EnvironmentFileNotFound: '/home/masy/Downloads/data/sub-04620/func/env*afni_ted.yml' file not found