Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nph5class module #2

Open
wants to merge 1 commit into
base: new_modules
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions nph_5class/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# FROM python:3.6.15-buster
# FROM nvidia/cuda:11.7.1-base-ubuntu20.04
FROM python:3.8.13-buster

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get -y install python3
RUN apt-get -y install python3-pip

RUN apt install -y vim
RUN apt install -y wget

# ===================Module Dependencies============================

RUN pip install torch torchvision numpy nibabel matplotlib scipy scikit-image SimpleITK
# RUN wget -q http://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py && \
# chmod 775 fslinstaller.py && \
# python3 /fslinstaller.py -d /usr/local/fsl -V 6.0.4 -q && \
# rm -f /fslinstaller.py

# RUN mv /usr/local/fsl /usr/local/bin/fsl


# ===================Copy Source Code===============================

RUN mkdir /module
WORKDIR /module

COPY src /module/src
# RUN chmod +x /module/src/skull_strip.sh

# ===============bqapi for python3 Dependencies=====================
# pip install in this exact order
RUN pip3 install six
RUN pip3 install lxml
RUN pip3 install requests==2.18.4
RUN pip3 install requests-toolbelt
RUN pip3 install tables

# =====================Build Directory Structure====================

EXPOSE 8080
EXPOSE 5000
COPY PythonScriptWrapper.py /module/
COPY bqapi/ /module/bqapi

# Replace the following line with your {ModuleName}.xml
COPY NPHSegmentation.xml /module/NPHSegmentation.xml

ENV PATH /module:$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#:/usr/local/fsl/bin
ENV PYTHONPATH $PYTHONPATH:/module/src
# ENV FSLOUTPUTTYPE NIFTI_GZ
71 changes: 71 additions & 0 deletions nph_5class/NPHSegmentation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<module name="NPHSegmentation" type="runtime">

<tag name="inputs">

<tag name="Input Image" type="resource">
<template>
<tag name="label" value="Input Image"/>
<tag name="accepted_type" value="image"/>
<tag name="prohibit_upload" value="True"/>
</template>
</tag>
<tag name="mex_url" type="system-input_resource"/>
<tag name="bisque_token" type="system-input_resource"/>
</tag>

<tag name="outputs">

<tag name="NonImage">

<template>

<tag name="label" value="Outputs"/>

</template>

</tag>

<tag name="Segmented Image" type="image">
<template>
<tag name="label" value="Segmented Image"/>
</template>
</tag>
</tag>

<tag name="execute_options">

<tag name="iterable" value="image_url" type="dataset"/>

</tag>

<tag name="module_options">

<tag name="version" value="1"/>

</tag>

<tag name="display_options">

<tag name="group" value="Metadata"/>

</tag>

<tag name="interface">

<tag name="javascript" type="file" value="webapp.js"/>

<tag name="css" type="file" value="webapp.css"/>

</tag>

<tag name="help" type="file" value="public/help.html"/>

<tag name="thumbnail" type="file" value="public/thumbnail.jpg"/>

<tag name="title" type="string" value="NPHSegmentation"/>

<tag name="authors" type="string" value="VB"/>

<tag name="description" type="string" value="New NPH segmentation module"/>
</module>
Loading