From 750a2324b02f3ca92114d82c6e9b72d2fbc98919 Mon Sep 17 00:00:00 2001 From: Elizabeth DuPre Date: Sat, 12 May 2018 23:09:59 -0400 Subject: [PATCH 1/8] [ENH] update ICA to sklearn from mdp --- tedana/cli/run.py | 8 ++--- tedana/decomposition/eigendecomp.py | 46 +++++++++++++++++++++-------- tedana/workflows/tedana.py | 9 ++---- 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/tedana/cli/run.py b/tedana/cli/run.py index 4b2b1d7d3..5a21cb4d6 100644 --- a/tedana/cli/run.py +++ b/tedana/cli/run.py @@ -76,15 +76,11 @@ def get_parser(): action='store_true', help='Denoise each TE dataset separately', default=False) - parser.add_argument('--initcost', - dest='initcost', + parser.add_argument('--cost', + dest='cost', help=('Initial cost func. for ICA: ' 'tanh (default), pow3, gaus, skew'), default='tanh') - parser.add_argument('--finalcost', - dest='finalcost', - help='Final cost func, same opts. as initial', - default='tanh') parser.add_argument('--stabilize', dest='stabilize', action='store_true', diff --git a/tedana/decomposition/eigendecomp.py b/tedana/decomposition/eigendecomp.py index d890b7ea0..437519fec 100644 --- a/tedana/decomposition/eigendecomp.py +++ b/tedana/decomposition/eigendecomp.py @@ -185,7 +185,7 @@ def tedpca(catd, OCcatd, combmode, mask, t2s, t2sG, stabilize, return n_components, dd -def tedica(n_components, dd, conv, fixed_seed, cost, final_cost): +def tedica(n_components, dd, conv, fixed_seed, cost='tanh'): """ Performs ICA on `dd` and returns mixing matrix @@ -198,12 +198,10 @@ def tedica(n_components, dd, conv, fixed_seed, cost, final_cost): echos, and `T` is time conv : float Convergence limit for ICA + cost : {'tanh', 'pow3', 'gaus', 'skew'} str, optional + Cost function for ICA fixed_seed : int Seed for ensuring reproducibility of ICA results - initcost : {'tanh', 'pow3', 'gaus', 'skew'} str, optional - Initial cost function for ICA - finalcost : {'tanh', 'pow3', 'gaus', 'skew'} str, optional - Final cost function for ICA Returns ------- @@ -216,14 +214,36 @@ def tedica(n_components, dd, conv, fixed_seed, cost, final_cost): Uses `mdp` implementation of FastICA for decomposition """ - import mdp + from sklearn.decomposition import FastICA + + def cost_func(cost): + """ + Cost function supplied to ICA. + + Parameters + ---------- + cost: {'tanh', 'pow3', 'gaus', 'skew'} str + """ + def gaus(x): + return x * np.exp(-1 * x**2 / 2) + + def skew(x): + return x**2 + + if cost is 'tanh': + return 'logcosh' + if cost is 'pow3': + return 'cube' + if cost is 'gaus': + return gaus + if cost is 'skew': + return skew + climit = float(conv) - mdp.numx_rand.seed(fixed_seed) - icanode = mdp.nodes.FastICANode(white_comp=n_components, approach='symm', g=cost, - fine_g=final_cost, coarse_limit=climit*100, - limit=climit, verbose=True) - icanode.train(dd) - smaps = icanode.execute(dd) # noqa - mmix = icanode.get_recmatrix().T + rand_state = np.random.RandomState(seed=fixed_seed) + ica = FastICA(n_components=n_components, algorithm='parallel', + fun=cost_func(cost), tol=climit, random_state=rand_state) + ica.fit(dd) + mmix = ica.mixing_ mmix = stats.zscore(mmix, axis=0) return mmix diff --git a/tedana/workflows/tedana.py b/tedana/workflows/tedana.py index 14bd8479c..a45429730 100644 --- a/tedana/workflows/tedana.py +++ b/tedana/workflows/tedana.py @@ -24,7 +24,7 @@ def main(data, tes, mixm=None, ctab=None, manacc=None, strict=False, no_gscontrol=False, kdaw=10., rdaw=1., conv=2.5e-5, ste=-1, - combmode='t2s', dne=False, initcost='tanh', finalcost='tanh', + combmode='t2s', dne=False, cost='tanh', stabilize=False, fout=False, filecsdata=False, label=None, fixed_seed=42): """ @@ -63,10 +63,8 @@ def main(data, tes, mixm=None, ctab=None, manacc=None, strict=False, Combination scheme for TEs: 't2s' (Posse 1999, default), 'ste' (Poser). dne : :obj:`bool`, optional Denoise each TE dataset separately. Default is False. - initcost : {'tanh', 'pow3', 'gaus', 'skew'}, optional + cost : {'tanh', 'pow3', 'gaus', 'skew'}, optional Initial cost function for ICA. Default is 'tanh'. - finalcost : {'tanh', 'pow3', 'gaus', 'skew'}, optional - Final cost function. Default is 'tanh'. stabilize : :obj:`bool`, optional Stabilize convergence by reducing dimensionality, for low quality data. Default is False. @@ -149,8 +147,7 @@ def main(data, tes, mixm=None, ctab=None, manacc=None, strict=False, n_components, dd = decomposition.tedpca(catd, OCcatd, combmode, mask, t2s, t2sG, stabilize, ref_img, tes=tes, kdaw=kdaw, rdaw=rdaw, ste=ste) - mmix_orig = decomposition.tedica(n_components, dd, conv, fixed_seed, cost=initcost, - final_cost=finalcost) + mmix_orig = decomposition.tedica(n_components, dd, conv, fixed_seed, cost=cost) np.savetxt(op.join(out_dir, '__meica_mix.1D'), mmix_orig) seldict, comptable, betas, mmix = model.fitmodels_direct(catd, mmix_orig, mask, t2s, t2sG, From 14d5ed14620bd7049b1882ebd8dec7b21f08ec2c Mon Sep 17 00:00:00 2001 From: Elizabeth DuPre Date: Thu, 17 May 2018 14:39:33 -0400 Subject: [PATCH 2/8] Address review comments --- tedana/decomposition/eigendecomp.py | 31 ++++++----------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/tedana/decomposition/eigendecomp.py b/tedana/decomposition/eigendecomp.py index 437519fec..03125fd55 100644 --- a/tedana/decomposition/eigendecomp.py +++ b/tedana/decomposition/eigendecomp.py @@ -185,7 +185,7 @@ def tedpca(catd, OCcatd, combmode, mask, t2s, t2sG, stabilize, return n_components, dd -def tedica(n_components, dd, conv, fixed_seed, cost='tanh'): +def tedica(n_components, dd, conv, fixed_seed, cost='logcosh'): """ Performs ICA on `dd` and returns mixing matrix @@ -198,7 +198,7 @@ def tedica(n_components, dd, conv, fixed_seed, cost='tanh'): echos, and `T` is time conv : float Convergence limit for ICA - cost : {'tanh', 'pow3', 'gaus', 'skew'} str, optional + cost : {'logcosh', 'exp', 'cube'} str, optional Cost function for ICA fixed_seed : int Seed for ensuring reproducibility of ICA results @@ -216,33 +216,14 @@ def tedica(n_components, dd, conv, fixed_seed, cost='tanh'): from sklearn.decomposition import FastICA - def cost_func(cost): - """ - Cost function supplied to ICA. - - Parameters - ---------- - cost: {'tanh', 'pow3', 'gaus', 'skew'} str - """ - def gaus(x): - return x * np.exp(-1 * x**2 / 2) - - def skew(x): - return x**2 - - if cost is 'tanh': - return 'logcosh' - if cost is 'pow3': - return 'cube' - if cost is 'gaus': - return gaus - if cost is 'skew': - return skew + if cost not in ('logcosh', 'cube', 'exp'): + LGR.error('ICA cost function not understood') + raise climit = float(conv) rand_state = np.random.RandomState(seed=fixed_seed) ica = FastICA(n_components=n_components, algorithm='parallel', - fun=cost_func(cost), tol=climit, random_state=rand_state) + fun=cost, tol=climit, random_state=rand_state) ica.fit(dd) mmix = ica.mixing_ mmix = stats.zscore(mmix, axis=0) From 2097bd041c807400a7b333ce1a2558af3413cb1a Mon Sep 17 00:00:00 2001 From: Elizabeth DuPre Date: Fri, 18 May 2018 14:08:24 -0400 Subject: [PATCH 3/8] Patch merge errors --- tedana/cli/run_tedana.py | 7 ++++--- tedana/workflows/tedana.py | 6 +----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tedana/cli/run_tedana.py b/tedana/cli/run_tedana.py index 4d20eab78..278e9a879 100644 --- a/tedana/cli/run_tedana.py +++ b/tedana/cli/run_tedana.py @@ -105,9 +105,10 @@ def get_parser(): default=False) parser.add_argument('--cost', dest='cost', - help=('Initial cost func. for ICA: ' - 'tanh (default), pow3, gaus, skew'), - default='tanh') + help=('Cost func. for ICA: ' + 'logcosh (default), cube, exp'), + choices=['logcosh', 'cube', 'exp'], + default='logcosh') parser.add_argument('--stabilize', dest='stabilize', action='store_true', diff --git a/tedana/workflows/tedana.py b/tedana/workflows/tedana.py index b5e3af9b2..9b4a5f339 100644 --- a/tedana/workflows/tedana.py +++ b/tedana/workflows/tedana.py @@ -157,13 +157,9 @@ def tedana(data, tes, mixm=None, ctab=None, manacc=None, strict=False, n_components, dd = decomposition.tedpca(catd, OCcatd, combmode, mask, t2s, t2sG, stabilize, ref_img, tes=tes, kdaw=kdaw, rdaw=rdaw, ste=ste) -<<<<<<< HEAD mmix_orig = decomposition.tedica(n_components, dd, conv, fixed_seed, cost=cost) -======= - mmix_orig = decomposition.tedica(n_components, dd, conv, fixed_seed, cost=initcost, - final_cost=finalcost, verbose=debug) ->>>>>>> upstream/master np.savetxt(op.join(out_dir, '__meica_mix.1D'), mmix_orig) + LGR.info('Making second component selection guess from ICA results') seldict, comptable, betas, mmix = model.fitmodels_direct(catd, mmix_orig, mask, t2s, t2sG, From c7241b77dd9770bbadecd83191336916562c4278 Mon Sep 17 00:00:00 2001 From: Elizabeth DuPre Date: Sun, 27 May 2018 23:01:17 -0400 Subject: [PATCH 4/8] Update testing environment --- Dockerfile | 75 ------------------------------------- circle.yml | 28 ++++++++------ tedana/tests/test_tedana.py | 4 +- 3 files changed, 19 insertions(+), 88 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 247e73027..000000000 --- a/Dockerfile +++ /dev/null @@ -1,75 +0,0 @@ -# Generated by Neurodocker v0.2.0-12-g1a1c6f6. -# -# Thank you for using Neurodocker. If you discover any issues -# or ways to improve this software, please submit an issue or -# pull request on our GitHub repository: -# https://github.com/kaczmarj/neurodocker -# -# Timestamp: 2017-08-30 19:05:17 - -FROM ubuntu:trusty - -ARG DEBIAN_FRONTEND=noninteractive - -#---------------------------------------------------------- -# Install common dependencies and create default entrypoint -#---------------------------------------------------------- -ENV LANG="C.UTF-8" \ - LC_ALL="C.UTF-8" \ - ND_ENTRYPOINT="/neurodocker/startup.sh" -RUN apt-get update -qq && apt-get install -yq --no-install-recommends \ - bzip2 ca-certificates curl unzip \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ - && chmod 777 /opt && chmod a+s /opt \ - && mkdir -p /neurodocker \ - && if [ ! -f "$ND_ENTRYPOINT" ]; then \ - echo '#!/usr/bin/env bash' >> $ND_ENTRYPOINT \ - && echo 'set +x' >> $ND_ENTRYPOINT \ - && echo 'if [ -z "$*" ]; then /usr/bin/env bash; else $*; fi' >> $ND_ENTRYPOINT; \ - fi \ - && chmod -R 777 /neurodocker && chmod a+s /neurodocker -ENTRYPOINT ["/neurodocker/startup.sh"] - -RUN apt-get update -qq && apt-get install -yq --no-install-recommends git vim \ - && apt-get clean \ -&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# Create new user: neuro -RUN useradd --no-user-group --create-home --shell /bin/bash neuro -USER neuro - -#------------------ -# Install Miniconda -#------------------ -ENV CONDA_DIR=/opt/conda \ - PATH=/opt/conda/bin:$PATH -RUN echo "Downloading Miniconda installer ..." \ - && miniconda_installer=/tmp/miniconda.sh \ - && curl -sSL -o $miniconda_installer https://repo.continuum.io/miniconda/Miniconda3-4.3.31-Linux-x86_64.sh \ - && /bin/bash $miniconda_installer -f -b -p $CONDA_DIR \ - && rm -f $miniconda_installer \ - && conda config --system --prepend channels conda-forge \ - && conda config --system --set auto_update_conda false \ - && conda config --system --set show_channel_urls true \ - && conda update -y -q --all && sync \ - && conda clean -tipsy && sync - -#----------------------------- -# Create py3 conda environment -#----------------------------- -RUN conda create -y -q --name py36 python=3.6 \ - numpy scikit-learn mdp nilearn scipy 'nibabel>=2.1.0' \ - && sync && conda clean -tipsy && sync \ - && bash -c "source activate py36 \ - && pip install -q --no-cache-dir \ - https://github.com/ME-ICA/tedana/archive/master.tar.gz" \ - && sync \ - && sed -i '$isource activate py36' $ND_ENTRYPOINT - -USER root - -# User-defined instruction -RUN mkdir /home/neuro/code /home/neuro/data - -WORKDIR /home/neuro diff --git a/circle.yml b/circle.yml index bdb9ba852..a752bf272 100644 --- a/circle.yml +++ b/circle.yml @@ -5,30 +5,36 @@ version: 2 jobs: build: + working_directory: ~/code docker: - - image: emdupre/meica-docker:0.0.4 - - working_directory: /home/neuro/code/ + - image: circleci/python:3.6.1 steps: + - run: + name: Create data and code directories + command: mkdir code data + + - run: + name: Initialize git repository + command: git init + - checkout - run: name: Download input test data - command: curl -L -o /home/neuro/data/zcat_ffd.nii.gz https://www.dropbox.com/s/ljeqskdmnc6si9d/zcat_ffd.nii.gz?dl=0 + command: curl -L --create-dirs -o ~/data/zcat_ffd.nii.gz https://www.dropbox.com/s/ljeqskdmnc6si9d/zcat_ffd.nii.gz?dl=0 - run: name: Download expected output data command: | - curl -L -o /home/neuro/data/test_TED.tar.gz https://www.dropbox.com/s/x5xhzs3x6p3ukjl/test_TED.tar.gz?dl=0 - tar -xvzf /home/neuro/data/test_TED.tar.gz --no-same-owner -C /home/neuro/data/ - + curl -L -o ~/data/test_TED.tar.gz https://www.dropbox.com/s/x5xhzs3x6p3ukjl/test_TED.tar.gz?dl=0 + tar -xvzf ~/data/test_TED.tar.gz --no-same-owner -C ~/data/ - run: name: Create test environment command: | - conda create --name venv python=3.6 - source activate venv + python3 -m venv venv + . venv/bin/activate pip install pytest pip install -r requirements.txt python setup.py install @@ -36,10 +42,10 @@ jobs: - run: name: Run tests command: | - source activate venv + . venv/bin/activate py.test ./tedana/tests/test_tedana.py no_output_timeout: "40m" post: bash <(curl -s https://codecov.io/bash) - store_artifacts: - path: /home/neuro/code/TED/ + path: ~/code/TED/ diff --git a/tedana/tests/test_tedana.py b/tedana/tests/test_tedana.py index 8ebb8ccbd..ddff362e8 100644 --- a/tedana/tests/test_tedana.py +++ b/tedana/tests/test_tedana.py @@ -17,7 +17,7 @@ def test_basic_tedana(): """ parser = run_tedana.get_parser() - options = parser.parse_args(['-d', '/home/neuro/data/zcat_ffd.nii.gz', + options = parser.parse_args(['-d', '~/data/zcat_ffd.nii.gz', '-e', '14.5', '38.5', '62.5']) workflows.tedana(**vars(options)) assert os.path.isfile('comp_table.txt') @@ -63,4 +63,4 @@ def test_outputs(): 'sphis_hik.nii' ] for fn in nifti_test_list: - compare_nifti(fn, Path('/home/neuro/data/TED/'), Path('/home/neuro/code/TED/')) + compare_nifti(fn, Path('~/data/TED/'), Path('~/code/TED/')) From a1c1f4ca1aaa63e771602652f99aba615dd3a91f Mon Sep 17 00:00:00 2001 From: Elizabeth DuPre Date: Mon, 28 May 2018 17:19:33 -0400 Subject: [PATCH 5/8] Modify circle yaml --- circle.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/circle.yml b/circle.yml index a752bf272..c091c3a74 100644 --- a/circle.yml +++ b/circle.yml @@ -12,13 +12,7 @@ jobs: steps: - run: name: Create data and code directories - command: mkdir code data - - - run: - name: Initialize git repository - command: git init - - - checkout + command: mkdir ~/data - run: name: Download input test data @@ -30,6 +24,8 @@ jobs: curl -L -o ~/data/test_TED.tar.gz https://www.dropbox.com/s/x5xhzs3x6p3ukjl/test_TED.tar.gz?dl=0 tar -xvzf ~/data/test_TED.tar.gz --no-same-owner -C ~/data/ + - checkout + - run: name: Create test environment command: | From e85b0a3307aa69d4f58b77c02c7608ca31a16744 Mon Sep 17 00:00:00 2001 From: Elizabeth DuPre Date: Wed, 30 May 2018 15:25:17 -0400 Subject: [PATCH 6/8] Link full path --- tedana/tests/test_tedana.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tedana/tests/test_tedana.py b/tedana/tests/test_tedana.py index ddff362e8..e410329d8 100644 --- a/tedana/tests/test_tedana.py +++ b/tedana/tests/test_tedana.py @@ -17,7 +17,7 @@ def test_basic_tedana(): """ parser = run_tedana.get_parser() - options = parser.parse_args(['-d', '~/data/zcat_ffd.nii.gz', + options = parser.parse_args(['-d', os.path.expanduser('~/data/zcat_ffd.nii.gz'), '-e', '14.5', '38.5', '62.5']) workflows.tedana(**vars(options)) assert os.path.isfile('comp_table.txt') @@ -63,4 +63,5 @@ def test_outputs(): 'sphis_hik.nii' ] for fn in nifti_test_list: - compare_nifti(fn, Path('~/data/TED/'), Path('~/code/TED/')) + compare_nifti(fn, Path(os.path.expanduser('~/data/TED/')), + Path(os.path.expanduser('~/code/TED/'))) From 1c65fa32b253e11c3d55064a1cd170b0930af749 Mon Sep 17 00:00:00 2001 From: Elizabeth DuPre Date: Mon, 12 Nov 2018 16:49:42 -0500 Subject: [PATCH 7/8] [DOC] remove mdp package reference --- README.md | 1 - docs/installation.rst | 3 +-- requirements.txt | 1 - tedana/info.py | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 848b7fd57..3e08cc32c 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,6 @@ More information and documentation can be found at https://tedana.readthedocs.io You'll need to set up a working development environment to use `tedana`. To set up a local environment, you will need Python >=3.6 and the following packages will need to be installed: -[mdp](https://pypi.org/project/MDP/) [numpy](http://www.numpy.org/) [scikit-learn](http://scikit-learn.org/stable/) [scipy](https://www.scipy.org/) diff --git a/docs/installation.rst b/docs/installation.rst index 7645b9859..f11492274 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -2,10 +2,9 @@ Installation ------------ You'll need to set up a working development environment to use ``tedana``. -To set up a local environment, you will need Python >=3.6 and the following +To set up a local environment, you will need Python >=3.5 and the following packages will need to be installed: -- mdp - nilearn - nibabel>=2.1.0 - numpy diff --git a/requirements.txt b/requirements.txt index 634b90d0d..4a139520a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ numpy>=1.14 scikit-learn scipy -mdp nilearn nibabel>=2.1.0 pywavelets diff --git a/tedana/info.py b/tedana/info.py index 4135e22b6..cbe5e91e2 100644 --- a/tedana/info.py +++ b/tedana/info.py @@ -30,7 +30,6 @@ REQUIRES = [ 'numpy', 'scikit-learn', - 'mdp', 'pywavelets', 'nilearn', 'nibabel>=2.1.0', From 1025acef8ea6f07875eea32d58128b71e7de91cb Mon Sep 17 00:00:00 2001 From: Elizabeth DuPre Date: Tue, 13 Nov 2018 10:38:49 -0500 Subject: [PATCH 8/8] [FIX] Fix bad merge --- tedana/cli/run_tedana.py | 168 --------------------------------------- 1 file changed, 168 deletions(-) delete mode 100644 tedana/cli/run_tedana.py diff --git a/tedana/cli/run_tedana.py b/tedana/cli/run_tedana.py deleted file mode 100644 index 8468fea4d..000000000 --- a/tedana/cli/run_tedana.py +++ /dev/null @@ -1,168 +0,0 @@ -""" -Call tedana from the command line. -""" -import os.path as op - -import argparse - -from tedana import workflows - -import logging -logging.basicConfig(format='[%(levelname)s]: ++ %(message)s', - level=logging.INFO) - - -def is_valid_file(parser, arg): - """ - Check if argument is existing file. - """ - if not op.isfile(arg) and arg is not None: - parser.error('The file {0} does not exist!'.format(arg)) - - return op.abspath(arg) - - -def get_parser(): - """ - Parses command line inputs for tedana - - Returns - ------- - parser.parse_args() : argparse dict - """ - parser = argparse.ArgumentParser() - parser.add_argument('-d', - dest='data', - nargs='+', - metavar='FILE', - type=lambda x: is_valid_file(parser, x), - help=('Multi-echo dataset for analysis. May be a ' - 'single file with spatially concatenated data ' - 'or a set of echo-specific files, in the same ' - 'order as the TEs are listed in the -e ' - 'argument.'), - required=True) - parser.add_argument('-e', - dest='tes', - nargs='+', - metavar='TE', - type=float, - help='Echo times (in ms). E.g., 15.0 39.0 63.0', - required=True) - parser.add_argument('--mix', - dest='mixm', - metavar='FILE', - type=lambda x: is_valid_file(parser, x), - help=('File containing mixing matrix. If not ' - 'provided, ME-PCA & ME-ICA is done.'), - default=None) - parser.add_argument('--ctab', - dest='ctab', - metavar='FILE', - type=lambda x: is_valid_file(parser, x), - help=('File containing a component table from which ' - 'to extract pre-computed classifications.'), - default=None) - parser.add_argument('--manacc', - dest='manacc', - help=('Comma separated list of manually ' - 'accepted components'), - default=None) - parser.add_argument('--kdaw', - dest='kdaw', - type=float, - help=('Dimensionality augmentation weight (Kappa). ' - 'Default=10. -1 for low-dimensional ICA'), - default=10.) - parser.add_argument('--rdaw', - dest='rdaw', - type=float, - help=('Dimensionality augmentation weight (Rho). ' - 'Default=1. -1 for low-dimensional ICA'), - default=1.) - parser.add_argument('--conv', - dest='conv', - type=float, - help='Convergence limit. Default 2.5e-5', - default='2.5e-5') - parser.add_argument('--sourceTEs', - dest='ste', - type=str, - help=('Source TEs for models. E.g., 0 for all, ' - '-1 for opt. com., and 1,2 for just TEs 1 and ' - '2. Default=-1.'), - default=-1) - parser.add_argument('--combmode', - dest='combmode', - action='store', - choices=['t2s', 'ste'], - help=('Combination scheme for TEs: ' - 't2s (Posse 1999, default), ste (Poser)'), - default='t2s') - parser.add_argument('--denoiseTEs', - dest='dne', - action='store_true', - help='Denoise each TE dataset separately', - default=False) - parser.add_argument('--cost', - dest='cost', - help=('Cost func. for ICA: ' - 'logcosh (default), cube, exp'), - choices=['logcosh', 'cube', 'exp'], - default='logcosh') - parser.add_argument('--stabilize', - dest='stabilize', - action='store_true', - help=('Stabilize convergence by reducing ' - 'dimensionality, for low quality data'), - default=False) - parser.add_argument('--fout', - dest='fout', - help='Output TE-dependence Kappa/Rho SPMs', - action='store_true', - default=False) - parser.add_argument('--filecsdata', - dest='filecsdata', - help='Save component selection data', - action='store_true', - default=False) - parser.add_argument('--wvpca', - dest='wvpca', - help='Perform PCA on wavelet-transformed data', - action='store_true', - default=False) - parser.add_argument('--label', - dest='label', - type=str, - help='Label for output directory.', - default=None) - parser.add_argument('--seed', - dest='fixed_seed', - type=int, - help='Seeded value for ICA, for reproducibility.', - default=42) - parser.add_argument('--debug', - dest='debug', - help=argparse.SUPPRESS, - action='store_true', - default=False) - parser.add_argument('--quiet', - dest='quiet', - help=argparse.SUPPRESS, - action='store_true', - default=False) - return parser - - -def main(argv=None): - """Tedana entry point""" - options = get_parser().parse_args(argv) - if options.debug and not options.quiet: - logging.getLogger().setLevel(logging.DEBUG) - elif options.quiet: - logging.getLogger().setLevel(logging.WARNING) - workflows.tedana(**vars(options)) - - -if __name__ == '__main__': - main()