Skip to content
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Pipfile

models
*.h5
outputs
download*
download
logs

# Byte-compiled / optimized / DLL files
Expand Down
5 changes: 3 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
recursive-include bidsmreye/config *.json
recursive-include bidsmreye/templates/ *.bib
recursive-include bidsmreye/templates/ *.mustache
recursive-include bidsmreye/templates *.bib
recursive-include bidsmreye/templates *.mustache
recursive-include bidsmreye/models registry.txt
include versioneer.py
include bidsmreye/_version.py
71 changes: 22 additions & 49 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ BROWSER := python -c "$$BROWSER_PYSCRIPT"
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

clean: clean-build clean-pyc clean-test clean-models clean-demo ## remove all build, test, coverage and Python artifacts
clean: clean-build clean-pyc clean-test clean-models clean-demo clean-models ## remove all build, test, coverage and Python artifacts

clean-build: ## remove build artifacts
rm -fr build/
Expand All @@ -49,10 +49,6 @@ clean-test: ## remove test and coverage artifacts
rm -fr .pytest_cache
rm -fr tests/data

clean-models: ## remove pretrained models
rm -fr models/


## INSTALL

install: clean models ## install the package to the active Python's site-packages
Expand All @@ -71,15 +67,24 @@ dist: clean ## builds source and wheel package


## PRE-TRAINED MODELS
models: models/dataset1_guided_fixations.h5 models/dataset5_free_viewing.h5 ## gets all pretrained models from OSF
.PHONY: models

clean-modesl: ## remove pretrained models
rm -fr models/
models: ## gets all pretrained models from OSF
bidsmreye_model --model_name all
models/dataset1_guided_fixations.h5:
mkdir -p models
wget -q https://osf.io/download/cqf74/ -O models/dataset1_guided_fixations.h5

bidsmreye_model
models/dataset2_pursuit.h5:
bidsmreye_model --model_name 2_pursuit
models/dataset3_openclosed.h5:
bidsmreye_model --model_name 3_openclosed
models/dataset3_pursuit.h5:
bidsmreye_model --model_name 3_pursuit
models/dataset4_pursuit.h5:
bidsmreye_model --model_name 4_pursuit
models/dataset5_free_viewing.h5:
mkdir -p models
wget -q https://osf.io/download/89nky/ -O models/dataset5_free_viewing.h5
bidsmreye_model --model_name 5_free_viewing


## STYLE
Expand Down Expand Up @@ -114,7 +119,7 @@ servedocs: docs ## compile the docs watching for changes

## TESTS

test: models tests/data/moae_fmriprep ## run tests quickly with the default Python
test: tests/data/moae_fmriprep ## run tests quickly with the default Python
python -m pytest --cov bidsmreye

tests/data/moae_fmriprep: ## gets fmriprep preprocessed data of the SPM MOAE dataset from OSF
Expand All @@ -131,7 +136,7 @@ tests/data/moae_fmriprep: ## gets fmriprep preprocessed data of the SPM MOAE dat
clean-demo:
rm -fr outputs/moae_fmriprep

demo: clean-demo tests/data/moae_fmriprep models/dataset1_guided_fixations.h5 ## demo: runs all demo steps on MOAE dataset
demo: clean-demo tests/data/moae_fmriprep ## demo: runs all demo steps on MOAE dataset
bidsmreye --action all \
--verbosity INFO \
--debug true \
Expand All @@ -140,7 +145,7 @@ demo: clean-demo tests/data/moae_fmriprep models/dataset1_guided_fixations.h5 ##
$$PWD/outputs/moae_fmriprep/derivatives \
participant

prepare: tests/data/moae_fmriprep models/dataset1_guided_fixations.h5 ## demo: prepares the data of MOAE dataset
prepare: tests/data/moae_fmriprep ## demo: prepares the data of MOAE dataset
bidsmreye --action prepare \
--verbosity INFO \
--debug true \
Expand All @@ -149,19 +154,9 @@ prepare: tests/data/moae_fmriprep models/dataset1_guided_fixations.h5 ## demo: p
$$PWD/outputs/moae_fmriprep/derivatives \
participant

combine: ## demo: combines data and dummy labels of MOAE dataset
bidsmreye --action combine \
--verbosity INFO \
--debug true \
--reset_database true \
$$PWD/tests/data/moae_fmriprep \
$$PWD/outputs/moae_fmriprep/derivatives \
participant

generalize: ## demo: predicts labels of MOAE dataset
bidsmreye --model guided_fixations \
--action generalize \
--verbosity INFO \
bidsmreye --action generalize \
--verbosity WARNING \
--debug true \
--reset_database true \
$$PWD/tests/data/moae_fmriprep \
Expand Down Expand Up @@ -192,16 +187,6 @@ ds002799_prepare: get_ds002799 models/dataset1_guided_fixations.h5
--space MNI152NLin2009cAsym T1w \
--run 1 2

ds002799_combine:
bidsmreye --action combine \
--verbosity INFO \
$$PWD/tests/data/ds002799/derivatives/fmriprep \
$$PWD/outputs/ds002799/derivatives \
participant \
--participant_label 302 307 \
--space MNI152NLin2009cAsym T1w \
--run 1 2

ds002799_generalize:
bidsmreye --action generalize \
--verbosity INFO \
Expand Down Expand Up @@ -260,10 +245,10 @@ docker/Dockerfile_dev: ## Dockerfile for the bidsmreye docker image using local
--run "mkdir -p /home/neuro/bidsMReye" \
--copy . /home/neuro/bidsMReye \
--workdir /home/neuro/bidsMReye \
--run "make models" \
--miniconda \
use_env="bidsmreye" \
pip_install="." \
--run "make models" \
--copy ./docker/entrypoint.sh /neurodocker/startup.sh \
--run "chmod +x /neurodocker/startup.sh" \
--cmd bidsmreye \
Expand All @@ -277,7 +262,6 @@ docker_dev_build_no_cache: docker/Dockerfile_dev

docker_demo: Docker_build clean-demo
make Docker_prepare_data
make Docker_combine
make Docker_generalize

docker_prepare_data:
Expand All @@ -291,17 +275,6 @@ docker_prepare_data:
participant \
--action prepare

docker_combine:
docker run --rm -it \
--user "$(id -u):$(id -g)" \
-v $$PWD/tests/data/moae_fmriprep:/home/neuro/data \
-v $$PWD/outputs:/home/neuro/outputs \
bidsmreye:latest \
/home/neuro/data/ \
/home/neuro/outputs/ \
participant \
--action combine

docker_generalize:
docker run --rm -it \
--user "$(id -u):$(id -g)" \
Expand Down
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,13 @@ Clone this repository.
git clone git://github.com/cpp-lln-lab/bidsmreye
```

Then install the package and download the pre-trained models with:
Then install the package:

```bash
cd bidsMReye
make install
```

For Windows you will have to download the pre-trained model weights manually.

- model:
- URL: [https://osf.io/download/cqf74/](https://osf.io/download/cqf74/)
- destination file: `models/dataset1_guided_fixations.h5`

## Usage

```bash
Expand All @@ -69,10 +63,6 @@ bidsmreye --action prepare \
bids_dir \
output_dir

bidsmreye --action combine \
bids_dir \
output_dir

bidsmreye --action generalize \
bids_dir \
output_dir
Expand Down
125 changes: 0 additions & 125 deletions bidsmreye/combine.py

This file was deleted.

Loading