Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Linting, update imports #4

Merged
merged 6 commits into from
Apr 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 121 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,124 @@
FROM python:3
# 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

WORKDIR /usr/src/app
FROM ubuntu:trusty

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
ARG DEBIAN_FRONTEND=noninteractive

COPY . .
#----------------------------------------------------------
# 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 libxml2-dev libnlopt-dev libxslt-dev\
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#--------------------
# Install AFNI latest
#--------------------
ENV PATH=/opt/afni:$PATH
RUN apt-get update -qq && apt-get install -yq --no-install-recommends ed gsl-bin libglu1-mesa-dev libglib2.0-0 libglw1-mesa \
libgomp1 libjpeg62 libxm4 netpbm tcsh xfonts-base xvfb \
&& libs_path=/usr/lib/x86_64-linux-gnu \
&& if [ -f $libs_path/libgsl.so.19 ]; then \
ln $libs_path/libgsl.so.19 $libs_path/libgsl.so.0; \
fi \
# Install libxp (not in all ubuntu/debian repositories) \
&& apt-get install -yq --no-install-recommends libxp6 \
|| /bin/bash -c " \
curl --retry 5 -o /tmp/libxp6.deb -sSL http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb \
&& dpkg -i /tmp/libxp6.deb && rm -f /tmp/libxp6.deb" \
# Install libpng12 (not in all ubuntu/debian repositories) \
&& apt-get install -yq --no-install-recommends libpng12-0 \
|| /bin/bash -c " \
curl -o /tmp/libpng12.deb -sSL http://mirrors.kernel.org/debian/pool/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb \
&& dpkg -i /tmp/libpng12.deb && rm -f /tmp/libpng12.deb" \
# Install R \
&& apt-get install -yq --no-install-recommends \
r-base-dev r-cran-rmpi \
|| /bin/bash -c " \
curl -o /tmp/install_R.sh -sSL https://gist.githubusercontent.com/kaczmarj/8e3792ae1af70b03788163c44f453b43/raw/0577c62e4771236adf0191c826a25249eb69a130/R_installer_debian_ubuntu.sh \
&& /bin/bash /tmp/install_R.sh" \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& echo "Downloading AFNI ..." \
&& mkdir -p /opt/afni \
&& curl -sSL --retry 5 https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz \
| tar zx -C /opt/afni --strip-components=1 \
&& /opt/afni/rPkgsInstall -pkgs ALL \
&& rm -rf /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-latest-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 default --channel vida-nyu python=3.6.1 \
numpy pandas reprozip traits \
&& sync && conda clean -tipsy && sync \
&& /bin/bash -c "source activate default \
&& pip install -q --no-cache-dir \
nipype ipython scikit-learn scipy ipdb mdp" \
&& sync
ENV PATH=/opt/conda/envs/default/bin:$PATH

#------------------------------
# Create py27 conda environment
#------------------------------
RUN conda create -y -q --name py27 python=2.7 \
numpy pandas reprozip traits \
&& sync && conda clean -tipsy && sync \
&& /bin/bash -c "source activate default \
&& pip install -q --no-cache-dir \
nipype ipython scikit-learn scipy ipdb mdp" \
&& sync

USER root

# User-defined instruction
RUN mkdir /home/neuro/code

# User-defined instruction
RUN mkdir /home/neuro/data

WORKDIR /home/neuro
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ tedana is part of the ME-ICA pipeline, and therefore assumes that you're working

## About

Multi-echo fMRI data collection entails acquires multiple TEs (commonly called [echo times](http://mriquestions.com/tr-and-te.html)) for each collected fMRI volume. Our signal of interest, Blood Oxygen-Level Dependent or [BOLD signal](http://www.fil.ion.ucl.ac.uk/spm/course/slides10-zurich/Kerstin_BOLD.pdf), is known to decay at a set rate within each fMRI volume. Collecting multiple echos therefore allows us to infer if components of fMRI signal are BOLD-related or driven by acquisition artifacts, like partipant motion. For a review, see [Kundu et al. (2017), _NeuroImage_](https://paperpile.com/shared/eH3PPu).
Multi-echo fMRI data collection entails acquires multiple TEs (commonly called [echo times](http://mriquestions.com/tr-and-te.html)) for each collected fMRI volume.
Our signal of interest, Blood Oxygen-Level Dependent or [BOLD signal](http://www.fil.ion.ucl.ac.uk/spm/course/slides10-zurich/Kerstin_BOLD.pdf), is known to decay at a set rate within each fMRI volume.
Collecting multiple echos therefore allows us to infer if components of fMRI signal are BOLD-related or driven by acquisition artifacts, like participant motion.
For a review, see [Kundu et al. (2017), _NeuroImage_](https://paperpile.com/shared/eH3PPu).

In tedana, we combine all collected echos, then decompose the resulting timeseries into components that can be classified as BOLD or non-BOLD based. This is performed in a series of steps including:
In tedana, we combine all collected echos, then decompose the resulting time series into components that can be classified as BOLD or non-BOLD based. This is performed in a series of steps including:

* Principle components analysis
* Independent components analysis
Expand Down Expand Up @@ -40,3 +43,8 @@ We :yellow_heart: new contributors ! To get started, check out [our contributing
Want to learn more about our plans for developing tedana ? Check out [our roadmap](https://github.com/emdupre/tedana/projects). Have a question, comment, or suggestion ? Open or comment on one of [our issues](https://github.com/emdupre/tedana/issues) !

We ask that all contributions to tedana respect our [code of conduct](https://github.com/emdupre/tedana/blob/master/Code_of_Conduct.md).

### Mozilla Global Sprint (10-11 May, 2018)

This year, tedana will be participating in the [Mozilla Global Sprint](https://foundation.mozilla.org/opportunity/global-sprint/) !
Look out for issues tagged `global-sprint` for good places to get started during the sprint.
5 changes: 5 additions & 0 deletions tedana/interfaces/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 et:

from .t2smap import (t2sadmap, optcom)

__all__ = [
't2sadmap', 'optcom']
4 changes: 2 additions & 2 deletions tedana/interfaces/t2smap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
import nibabel as nib
from tedana.utils.utils import (niwrite, cat2echos,
makeadmask, unmask, fmask)
from tedana.utils import (niwrite, cat2echos,
makeadmask, unmask, fmask)


def t2sadmap(catd, mask, tes, masksum, start_echo):
Expand Down
Loading