diff --git a/README.md b/README.md index 9eb0fd8..633f14b 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,8 @@ An environment file `envs/dosma_env.yml` file is provided in this repo containin To automatically install this environment (assumes Anaconda/Miniconda is installed): 1. Navigate to the DOSMA directory in the Terminal -2. Run `chmod +x initialize-dosma` -3. Run `./initialize-dosma` +2. Run `chmod +x setup` +3. Run `./setup` ### Weights For pretrained weights for MSK knee segmentation, request access using this [Google form](https://goo.gl/forms/JlxgS3aoUeeUUlVh2). Note that these weights are optimized to run on single-echo RMS DESS sequence as used in the [OsteoArthritis Initiative (OAI)](https://oai.epi-ucsf.org/datarelease/). diff --git a/initialize-dosma b/setup similarity index 56% rename from initialize-dosma rename to setup index e07a79e..ad2829c 100755 --- a/initialize-dosma +++ b/setup @@ -3,10 +3,11 @@ # Create virtual environment named (dosma_env) using conda # # @usage (from terminal/command line): -# ./initialize-dosma +# ./setup # # @initialization protocol: -# 1. Run "chmod +x create-env" from command-line (Linux) or Terminal (MacOS) +# 1. Navigate to DOSMA +# 1. Run "chmod +x setup" from command-line (Linux) or Terminal (MacOS) # # @author: Arjun Desai, Stanford University # (c) Stanford University, 2018 @@ -15,6 +16,7 @@ # Check if conda exists ANACONDA_KEYWORD="anaconda" MINICONDA_KEYWORD="miniconda" +GOOGLE_FORM="https://forms.gle/sprthTC2swyt8dDb6" hasAnaconda=0 @@ -29,7 +31,7 @@ then echo "Miniconda found in path" fi -if [ $hasAnaconda -eq 0 ]; then +if [[ $hasAnaconda -eq 0 ]]; then echo "Anaconda/Miniconda not installed - install from https://www.anaconda.com/distribution/" exit 125 fi @@ -43,9 +45,24 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then # Mac OSX env_file=`pwd`/envs/dosma_env.yml else - echo "only Linux and MacOS are supported" + echo "Only Linux and MacOS are supported" exit 125 fi -# create dosma_env -conda env create -f $env_file \ No newline at end of file +# Create Anaconda environment (dosma_env) +if [[ -z `conda env list | grep dosma_env` ]]; then + conda env create -f $env_file +else + echo "Environment 'dosma_env' found. Run 'conda activate dosma_env' to get started." +fi + +# Launch google form +if [[ "$OSTYPE" == "linux-gnu" ]]; then + xdg-open $GOOGLE_FORM +elif [[ "$OSTYPE" == "darwin"* ]]; then + # Mac OSX + open $GOOGLE_FORM +else + echo "Only Linux and MacOS are supported" + exit 125 +fi \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 9feafd7..0000000 --- a/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -""" -This is a setup.py script generated by py2applet - -Usage: - python setup.py py2app -""" - -from setuptools import setup - -APP = ['app.py'] -DATA_FILES = ['./elastix_params/*', 'libANNlib.dylib'] -OPTIONS = {} - -setup( - app=APP, - data_files=DATA_FILES, - options={'py2app': OPTIONS}, - setup_requires=['py2app'], -)