From bc879555ac568124b5e170bc7307e02b53bfbcf3 Mon Sep 17 00:00:00 2001 From: Michael Perry Date: Wed, 20 Mar 2019 15:16:21 -0700 Subject: [PATCH 1/2] install/update flywheel sdk and adapt code to new version --- Dockerfile | 13 +------------ fw_sdk_functions.py | 7 +++---- manifest.json | 7 +++++-- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 151ae61..510004c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,18 +28,7 @@ RUN pip install --upgrade pip && \ ############################ # Install the Flywheel SDK -WORKDIR /opt/flywheel -# Commit for version of SDK to build -ENV COMMIT bf2e0d6 -ENV LD_LIBRARY_PATH_TMP ${LD_LIBRARY_PATH} -ENV LD_LIBRARY_PATH ' ' -RUN git clone https://github.com/flywheel-io/sdk workspace/src/flywheel.io/sdk -RUN ln -s workspace/src/flywheel.io/sdk sdk -RUN cd sdk && git checkout $COMMIT && cd ../ -RUN sdk/make.sh -RUN sdk/bridge/make.sh -ENV PYTHONPATH /opt/flywheel/workspace/src/flywheel.io/sdk/bridge/dist/python/flywheel -ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH_TMP} +RUN pip install flywheel-sdk ############################ diff --git a/fw_sdk_functions.py b/fw_sdk_functions.py index d55e208..e187c1b 100644 --- a/fw_sdk_functions.py +++ b/fw_sdk_functions.py @@ -17,14 +17,13 @@ def get_diffusion_acquisitions(acquisitions, diffusion_acquisition_label): # Find diffusion acquisitions by finding acquisitions with a diffusion type and a bvec file diffusion_acquisitions = [ x for x in acquisitions if [y for y in x['files'] - if y.has_key('measurements') and 'diffusion' in y['measurements']] + if y.classification.has_key('Measurement') and 'Diffusion' in y.classification['Measurement']] and [z for z in x['files'] if z['type'] == 'bvec' or z['type'] == 'bval'] ] # Determine acquisitions to use based on label fuzzy matching if len(diffusion_acquisitions) == 0: - print('No Diffusion acquisitions found! Either classification was not set or required \ - files (bvec, nifti, bval) do not exist in any aquisitions.') + print('No Diffusion acquisitions found! Either classification was not set or required files (bvec, nifti, bval) do not exist in any aquisitions.') return diffusion_acquisitions if len(diffusion_acquisitions) > 2: @@ -62,7 +61,7 @@ def get_anatomical_acquisitions(acquisitions, anatomical_acquisition_label): # Find diffusion acquisitions by finding acquisitions with a diffusion type and a bvec file anatomical_acquisitions = [ x for x in acquisitions if [y for y in x['files'] - if y.has_key('measurements') and 'anatomy_t1' in y['measurements']] + if y.classification.has_key('Measurement') and 'T1' in y.classification['Measurement']] and [z for z in x['files'] if z['type'] == 'nifti' ] ] else: diff --git a/manifest.json b/manifest.json index 7c5f128..0d49069 100644 --- a/manifest.json +++ b/manifest.json @@ -9,9 +9,12 @@ "source": "https://github.com/scitran-apps/afq-pipeline-sdk", "license": "Other", "flywheel": "0", - "version": "1.0.2", + "version": "1.1.0", "custom": { - "docker-image": "scitran/afq-pipeline-sdk:1.0.2" + "docker-image": "scitran/afq-pipeline-sdk:1.1.0", + "flywheel": { + "suite": "VISTA Lab" + } }, "inputs": { "api_key": { From 4d996388434a10fd74d5c2b56f18961893db73b2 Mon Sep 17 00:00:00 2001 From: Michael Perry Date: Wed, 20 Mar 2019 15:43:51 -0700 Subject: [PATCH 2/2] install sdk prior to wuzzy --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 510004c..fa98f40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,17 +18,17 @@ RUN apt-get update && apt-get install -y --force-yes \ ############################ -# FUZZY +# Install the Flywheel SDK -RUN pip install --upgrade pip && \ - pip install fuzzywuzzy && \ - pip install fuzzywuzzy[speedup] +RUN pip install flywheel-sdk ############################ -# Install the Flywheel SDK +# FUZZY -RUN pip install flywheel-sdk +RUN pip install --upgrade pip && \ + pip install fuzzywuzzy && \ + pip install fuzzywuzzy[speedup] ############################