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

package: setup.py and reorganize #50

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
*.pyc
*.pyc
*.egg-info
.mypy_cache
__pycache__
tests/*.txt
tests/refin
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ RUN yum install -y numpy scipy

# Add everything to the container
ADD . /ICA-AROMA
RUN pip install -e /ICA-AROMA

239 changes: 0 additions & 239 deletions ICA_AROMA.py

This file was deleted.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ica_aroma/data/*.nii.gz
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:
.PHONY: test

test: tests/output.txt
tests/refin/mask.nii.gz:
cd tests && curl -L https://github.com/rtrhd/test-data/raw/master/icaaroma/0.4.0/refin.tar.bz2 | bunzip2 | tar x
tests/output.txt: tests/refin/mask.nii.gz $(wildcard tests/*.py) $(wildcard ica_aroma/*py)
python -m pytest -s tests/ | tee $@
2 changes: 1 addition & 1 deletion ica-aroma-via-docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
mod_args[targ_ind] = os.path.abspath(mod_args[targ_ind])

# Call the ICA-AROMA process
cmd = "python /ICA-AROMA/ICA_AROMA.py " + " ".join(mod_args)
cmd = "ica_aroma " + " ".join(mod_args)
print("Running: " + cmd + "\n")
process = Popen( cmd.split() )
sys.exit( process.wait() )
Expand Down
20 changes: 20 additions & 0 deletions ica_aroma/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import os
import ica_aroma

__version__ = "0.3-beta"


def get_data_path():
"""find directory location of
mask_csf.nii.gz, mask_edge.nii.gz, and mask_out.nii.gz.

will allow env var AROMADIR to overwrite package location
@return path to data/ (string)
"""
datadir = os.environ.get("AROMADIR", None) or \
os.path.join(os.path.dirname(ica_aroma.__loader__.path), "data")

assert os.path.isdir(datadir)
assert os.path.isfile(os.path.join(datadir, 'mask_csf.nii.gz'))

return datadir
File renamed without changes.
6 changes: 3 additions & 3 deletions classification_plots.py → ica_aroma/classification_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def classification_plot(myinput, outDir):
df = pd.DataFrame.from_records(res)
else:
df2 = pd.DataFrame.from_records(res)
df = df.append(df2, ignore_index=True)
df = pd.concat([df, df2], ignore_index=True)

count += 1

Expand All @@ -53,13 +53,13 @@ def classification_plot(myinput, outDir):
df3 = pd.DataFrame.from_records([["True", 1., 1., 0., 0.],
["True", 1., 1., 0., 0.],
["True", 1., 1., 0., 0.]])
df = df.append(df3, ignore_index=True)
df = pd.concat([df, df3], ignore_index=True)
tmp = df.loc[df[0] == "False"]
if len(tmp) < 3:
df3 = pd.DataFrame.from_records([["False", 0., 0., 0., 0.],
["False", 0., 0., 0., 0.],
["False", 0., 0., 0., 0.]])
df = df.append(df3, ignore_index=True)
df = pd.concat([df, df3], ignore_index=True)

# rename columns
df = df.rename(index=str, columns={0: 'Motion',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading