Skip to content

Commit

Permalink
Merge pull request #1 from scitran-apps/sdk-update
Browse files Browse the repository at this point in the history
SDK update
  • Loading branch information
lmperry authored Mar 20, 2019
2 parents ffd9cd0 + 4d99638 commit 155a7cd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
23 changes: 6 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +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

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 --upgrade pip && \
pip install fuzzywuzzy && \
pip install fuzzywuzzy[speedup]


############################
Expand Down
7 changes: 3 additions & 4 deletions fw_sdk_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 155a7cd

Please sign in to comment.