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/config.json b/config.json deleted file mode 100755 index e69de29..0000000 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 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': '', diff --git a/fw_heudiconv/backend_funcs/query.py b/fw_heudiconv/backend_funcs/query.py index ba60d22..e06b90d 100644 --- a/fw_heudiconv/backend_funcs/query.py +++ b/fw_heudiconv/backend_funcs/query.py @@ -1,7 +1,10 @@ import logging import collections import os -from nibabel.nicom.dicomwrappers import wrapper_from_data +import warnings +with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=UserWarning) + from nibabel.nicom.dicomwrappers import wrapper_from_data from heudiconv import utils 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'])) 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/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 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.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..9970eae 100644 --- a/setup.py +++ b/setup.py @@ -7,16 +7,16 @@ 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", packages=setuptools.find_packages(), install_requires=[ - "flywheel-sdk", + "flywheel-sdk~=14.6.5", "heudiconv", "pandas", "bids-validator", 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