Skip to content

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
TinasheMTapera committed May 12, 2021
2 parents 4275be2 + 2d1ec24 commit 1105196
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Empty file removed config.json
Empty file.
7 changes: 7 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
@@ -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 <https://upenn.flywheel.io>`_.

To use locally, follow instructions below to set up your system for using ``fw-heudiconv`` on your machine:

Expand Down
6 changes: 6 additions & 0 deletions docs/source/stepbystep.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fw_heudiconv/backend_funcs/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': '',
Expand Down
5 changes: 4 additions & 1 deletion fw_heudiconv/backend_funcs/query.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions fw_heudiconv/cli/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']))

Expand All @@ -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']))
Expand All @@ -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']))

Expand Down
9 changes: 2 additions & 7 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand All @@ -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"}
}
Expand Down
35 changes: 35 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flywheel-sdk
flywheel-sdk ~= 14.6.5
heudiconv
pandas
bids-validator
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]",
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",
Expand Down
7 changes: 7 additions & 0 deletions testing/test_fwheudiconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1105196

Please sign in to comment.