From b74ff914b5799f36b572a8f150c77b6a2933dfee Mon Sep 17 00:00:00 2001 From: TinasheMTapera Date: Wed, 28 Apr 2021 15:50:31 -0400 Subject: [PATCH 1/9] update bids version --- fw_heudiconv/backend_funcs/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fw_heudiconv/backend_funcs/convert.py b/fw_heudiconv/backend_funcs/convert.py index 7ad0c5e..d797a82 100644 --- a/fw_heudiconv/backend_funcs/convert.py +++ b/fw_heudiconv/backend_funcs/convert.py @@ -327,7 +327,7 @@ def confirm_bids_namespace(project_obj, dry_run): bids = { 'BIDS': {'Acknowledgements': '', 'Authors': [], - 'BIDSVersion': '1.0.2', + 'BIDSVersion': '1.6.0', 'DatasetDOI': '', 'Funding': [], 'HowToAcknowledge': '', From c5ef4235f11da199a220895a142015f206cd3457 Mon Sep 17 00:00:00 2001 From: TinasheMTapera Date: Fri, 30 Apr 2021 16:38:03 -0400 Subject: [PATCH 2/9] add final doc updates --- docs/source/installation.rst | 7 +++++++ docs/source/stepbystep.rst | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 42742e6..cee1c9f 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -1,6 +1,13 @@ Installation ============= +``fw-heudiconv`` can be run in the Flywheel GUI as a gear, or locally using the +Command Line Interface distributed using `pip`. ``flaudit`` can `only` be run +in the Flywheel GUI. + +.. note:: + FlywheelTools are intended for use with a Flywheel site. At the University of + Pennsylvania, our site is available at `upenn.flywheel.io `_. To use locally, follow instructions below to set up your system for using ``fw-heudiconv`` on your machine: diff --git a/docs/source/stepbystep.rst b/docs/source/stepbystep.rst index 4e429c5..19f53e7 100644 --- a/docs/source/stepbystep.rst +++ b/docs/source/stepbystep.rst @@ -223,6 +223,12 @@ uncheck it after this test run. When you're ready, hit "Run Gear"! Take note of the analysis' name to refer back to later. +To monitor progress of the gear, click on the session’s “Provenance” tab. A +grey pause symbol indicates that the job is queued, a blue cog indicates that +it is running, and a green check or red triangle indicates that the gear has +finished, successfully or unsuccessfully, respectively; refresh the page to +update the status of running gears. + At the command line, this achieved with the following command: .. code-block:: python From b8a320ec1caeea68a7577e03fe15971918d82bf3 Mon Sep 17 00:00:00 2001 From: TinasheMTapera Date: Wed, 12 May 2021 10:44:32 -0400 Subject: [PATCH 3/9] cosmetic updates and version bump --- Dockerfile | 2 +- manifest.json | 9 ++------- setup.cfg | 2 +- setup.py | 4 ++-- testing/test_fwheudiconv.py | 7 +++++++ 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2a30a14..22ef44f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apt-get -y update && apt-get install -y zip nodejs RUN npm install -g bids-validator RUN python3 -m pip install --upgrade pip RUN pip install --no-cache nipype pathvalidate -RUN pip install --no-cache flywheel-sdk==11.* +RUN pip install --no-cache flywheel-sdk~=14.6.5 COPY . /src diff --git a/manifest.json b/manifest.json index 2cc918c..921f7d6 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "fw-heudiconv", "label": "Flywheel HeuDiConv", "description": "HeuDiConv-style BIDS curation on Flywheel. Flywheel HeuDiConv (or fw-heudiconv, pronounced /fwuː di kɑː n(v)/) is a Python-based toolkit that leverages the flexibility and comprehensiveness of HeuDiConv to curate neuroimaging data on Flywheel into a BIDS-valid format.", - "version": "0.2.15_0.3.4", + "version": "0.2.15_0.4.0", "inputs": { "api_key": { "base": "api-key" @@ -24,11 +24,6 @@ "default": true, "description": "Run without applying changes", "type": "boolean" - }, - "default_heuristic": { - "default": "", - "description": "Use a default heuristic from the HeuDiConv modules [DEPRECATED]", - "type": "string" } }, "command": "./fw_heudiconv_run.py", @@ -41,7 +36,7 @@ "custom": { "gear-builder": { "category": "analysis", - "image": "pennbbl/fw-heudiconv:0.2.15_0.3.4" + "image": "pennbbl/fw-heudiconv:0.2.15_0.4.0" }, "flywheel":{"suite": "PennBBL"} } diff --git a/setup.cfg b/setup.cfg index bd82ec5..0c4f537 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,7 +26,7 @@ classifiers = [options] install_requires = - flywheel-sdk + flywheel-sdk ~= 14.6.5 bids-validator nibabel >=3.0.0 indexed_gzip >=0.8.8 diff --git a/setup.py b/setup.py index 3b877ec..0f6101c 100644 --- a/setup.py +++ b/setup.py @@ -7,10 +7,10 @@ setuptools.setup( name="fw_heudiconv", - version="0.3.4", + version="0.4.0", author="Tinashe M. Tapera, Matt Cieslak, Harsha Kethineni", author_email="tinashemtapera@gmail.com", - description="Use heudiconv heuristics for BIDS curation on flywheel", + description="Use heudiconv-like heuristics for BIDS curation on flywheel", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/PennBBL/fw_heudiconv", diff --git a/testing/test_fwheudiconv.py b/testing/test_fwheudiconv.py index ded089a..d9a2a85 100644 --- a/testing/test_fwheudiconv.py +++ b/testing/test_fwheudiconv.py @@ -4,8 +4,15 @@ import pytest import sys +import flywheel def test_init(): print(sys.version) assert 1 return + +def test_client(): + + client = flywheel.Client() + assert client + return 1 From e64bdf29fdfd579f01bcfe791a68706ed6b949c3 Mon Sep 17 00:00:00 2001 From: TinasheMTapera Date: Wed, 12 May 2021 11:07:40 -0400 Subject: [PATCH 4/9] patch downloader --- fw_heudiconv/cli/export.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fw_heudiconv/cli/export.py b/fw_heudiconv/cli/export.py index 67bb899..4b811b9 100644 --- a/fw_heudiconv/cli/export.py +++ b/fw_heudiconv/cli/export.py @@ -231,7 +231,7 @@ def download_bids( # Project's subject data for fi in to_download['project']: - if fi['BIDS'] is not None: + if fi['BIDS'] is not None and get_nested(fi, 'BIDS', 'Path') is not None: output_path = get_nested(fi, 'BIDS', 'Path') path = str(Path(output_path, fi['name'])) @@ -252,7 +252,7 @@ def download_bids( if fi['name'] not in attachments: continue - if fi['BIDS'] is not None: + if fi['BIDS'] is not None and get_nested(fi, 'BIDS', 'Path') is not None: output_path = get_nested(fi, 'BIDS', 'Path') path = str(Path(output_path, fi['name'])) @@ -272,7 +272,7 @@ def download_bids( if not any([re.search(att, fi['name']) for att in attachments]): continue - if fi['BIDS'] is not None: + if fi['BIDS'] is not None and get_nested(fi, 'BIDS', 'Path') is not None: output_path = Path(root_path, get_nested(fi, 'BIDS', 'Path')) path = str(Path(output_path, fi['name'])) From 7212832ee0ab137f2cb22af31f949fb1da0bb005 Mon Sep 17 00:00:00 2001 From: TinasheMTapera Date: Wed, 12 May 2021 11:20:58 -0400 Subject: [PATCH 5/9] try pinning version --- .circleci/config.yml | 4 ++-- requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4918176..b063ee2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,11 +38,11 @@ jobs: cd /tmp/validator/bids-validator && \ yarn --ignore-engines && \ cd bids-validator && npm install -g - # install fw cli https://storage.googleapis.com/flywheel-dist/cli/14.4.4/fw-linux_amd64-14.4.4.zip + # install fw cli https://storage.googleapis.com/flywheel-dist/cli/14.6.5/fw-linux_amd64-14.6.5.zip cd /tmp mkdir -p /tmp/fw_cli && \ cd /tmp/fw_cli - wget https://storage.googleapis.com/flywheel-dist/cli/14.4.4/fw-linux_amd64-14.4.4.zip -O fw-bin.zip + wget https://storage.googleapis.com/flywheel-dist/cli/14.6.5/fw-linux_amd64-14.6.5.zip -O fw-bin.zip unzip fw-bin.zip sudo mv /tmp/fw_cli/linux_amd64/fw /usr/local/bin - persist_to_workspace: diff --git a/requirements.txt b/requirements.txt index 3973294..4725fa3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -flywheel-sdk +flywheel-sdk ~= 14.6.5 heudiconv pandas bids-validator diff --git a/setup.py b/setup.py index 0f6101c..9970eae 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ url="https://github.com/PennBBL/fw_heudiconv", packages=setuptools.find_packages(), install_requires=[ - "flywheel-sdk", + "flywheel-sdk~=14.6.5", "heudiconv", "pandas", "bids-validator", From cce9462f4a4c29e8d94cfd054536ec1327619b24 Mon Sep 17 00:00:00 2001 From: TinasheMTapera Date: Wed, 12 May 2021 11:31:48 -0400 Subject: [PATCH 6/9] try again, pinning version --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b063ee2..4918176 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,11 +38,11 @@ jobs: cd /tmp/validator/bids-validator && \ yarn --ignore-engines && \ cd bids-validator && npm install -g - # install fw cli https://storage.googleapis.com/flywheel-dist/cli/14.6.5/fw-linux_amd64-14.6.5.zip + # install fw cli https://storage.googleapis.com/flywheel-dist/cli/14.4.4/fw-linux_amd64-14.4.4.zip cd /tmp mkdir -p /tmp/fw_cli && \ cd /tmp/fw_cli - wget https://storage.googleapis.com/flywheel-dist/cli/14.6.5/fw-linux_amd64-14.6.5.zip -O fw-bin.zip + wget https://storage.googleapis.com/flywheel-dist/cli/14.4.4/fw-linux_amd64-14.4.4.zip -O fw-bin.zip unzip fw-bin.zip sudo mv /tmp/fw_cli/linux_amd64/fw /usr/local/bin - persist_to_workspace: From 259a4e11ff834e353bc25e9409ae07d8edb6f0ec Mon Sep 17 00:00:00 2001 From: TinasheMTapera Date: Wed, 12 May 2021 11:47:51 -0400 Subject: [PATCH 7/9] include warning suppressor --- fw_heudiconv/backend_funcs/query.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fw_heudiconv/backend_funcs/query.py b/fw_heudiconv/backend_funcs/query.py index ba60d22..b577a93 100644 --- a/fw_heudiconv/backend_funcs/query.py +++ b/fw_heudiconv/backend_funcs/query.py @@ -1,7 +1,9 @@ import logging import collections import os -from nibabel.nicom.dicomwrappers import wrapper_from_data +with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=UserWarning) + from nibabel.nicom.dicomwrappers import wrapper_from_data from heudiconv import utils From 9343b110e75ad7fed0c92bef4d79a42aa4089628 Mon Sep 17 00:00:00 2001 From: TinasheMTapera Date: Wed, 12 May 2021 11:54:49 -0400 Subject: [PATCH 8/9] import first --- fw_heudiconv/backend_funcs/query.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fw_heudiconv/backend_funcs/query.py b/fw_heudiconv/backend_funcs/query.py index b577a93..e06b90d 100644 --- a/fw_heudiconv/backend_funcs/query.py +++ b/fw_heudiconv/backend_funcs/query.py @@ -1,6 +1,7 @@ import logging import collections import os +import warnings with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=UserWarning) from nibabel.nicom.dicomwrappers import wrapper_from_data From 2d1ec249fad42d57b8b965a01f3604bd1dbdf197 Mon Sep 17 00:00:00 2001 From: TinasheMTapera Date: Wed, 12 May 2021 13:06:59 -0400 Subject: [PATCH 9/9] added bash script to automate releases --- config.json | 0 release.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) delete mode 100755 config.json create mode 100644 release.sh diff --git a/config.json b/config.json deleted file mode 100755 index e69de29..0000000 diff --git a/release.sh b/release.sh new file mode 100644 index 0000000..282ea73 --- /dev/null +++ b/release.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +if [ $# -eq 0 ] + then + echo "No version argument supplied" + exit +fi + +echo Upgrading and uploading fw-heudiconv... + +VERSION=$1 + +echo Building docker image: +echo docker build -t pennbbl/fw-heudiconv:$VERSION . + +docker build -t pennbbl/fw-heudiconv:$VERSION . + +echo Testing local help call... + +fw gear local --help + +retVal=$? +if [ $retVal -ne 0 ]; then + echo "Error with local test" + exit $retVal +fi + +echo Uploading to pip... + +python setup.py sdist +twine upload dist/* + +echo Uploading gear... + +fw gear upload