Skip to content

Commit

Permalink
update dependencies;
Browse files Browse the repository at this point in the history
new merged sequence and julia
  • Loading branch information
korbinian90 authored and stebo85 committed Sep 28, 2023
1 parent 6b3203e commit a797655
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 42 deletions.
17 changes: 7 additions & 10 deletions recipes/mrsiproc/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@

----------------------------------
## mrsiproc/0.0.1 ##
## mrsiproc/toolVersion ##

Includes the following:
##### -- OS: Ubuntu 20.04 (Built off Matlab 2022a Deep learning Docker)
##### -- OS: Ubuntu 20.04 (Built from fsl neurodocker)
##### -- Minc (Version 1.9.15)
##### -- MATLAB (Version R2021b)
##### -- MATLAB Runtime (Version R2021b)
##### -- HD-BET (Version 1.0)
##### -- tar
##### -- gzip
##### -- gunzip
##### -- LCModel (Version 6.3.1)
##### -- dcm2nii
##### -- dcm2niix
##### -- Python (Version 3.10)
##### -- Julia (Version 1.9.0-rc2)
##### -- Julia (Version 1.9.3)


Overview
Expand Down Expand Up @@ -61,7 +58,7 @@ Run MRSI scripts
-----------------------------------------
Run the scripts from within a singularity shell inside Neurodesk. Example:
```bash
singularity shell singularity shell /cvmfs/neurodesk.ardc.edu.au/containers/mrsiproc_0.0.1_20221026/mrsiproc_0.0.1_20221026.simg
singularity shell singularity shell /cvmfs/neurodesk.ardc.edu.au/containers/mrsiproc_toolVersion_20221026/mrsiproc_toolVersion_20221026.simg
```
```bash
Singularity> cd /neurodesktop-storage/mrsi_proc
Expand All @@ -71,7 +68,7 @@ Singularity> ./Run_MRSI_test.sh
To run applications outside of this container
---------------------------------------------
(This is not working yet)
ml mrsiproc/0.0.1
ml mrsiproc/toolVersion

Citation
--------
Expand Down
58 changes: 26 additions & 32 deletions recipes/mrsiproc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ set -e
# this template file builds datalad and is then used as a docker base image for layer caching + it contains examples for various things like github install, curl, ...
export toolName='mrsiproc'
export toolVersion='0.0.1' # the version number cannot contain a "-" - try to use x.x.x notation always
export matlabVersion='2021b' # compatible with MATLAB.jl (julia)
export matlabVersion='2021b' # this has to match the version on which the matlab scripts were compiled
export matlabUpdateVersion='6'
export mincVersion='1.9.15'
export lcmodelVersion='6.3'
export hdbetVersion='1.0' # note the hdbet doesn't really have a version
export fslVersion='6.0.5.1'
export pythonVersion='py310'
export minicondaVersion='23.3.1-0'
export dcm2niiVersion='003f0d19f1e57b0129c9dcf3e653f51ca3559028' # copied from qsmxt
export juliaVersion='1.9.0-rc3'
export fslVersion='6.0.7.1'
export minicondaVersion='latest'
export dcm2niixVersion='003f0d19f1e57b0129c9dcf3e653f51ca3559028' # copied from qsmxt
export juliaVersion='1.9.3'

# Don't forget to update version change in README.md!!!!!
# toolName or toolVersion CANNOT contain capital letters or dashes or underscores (Docker registry does not accept this!)
Expand All @@ -35,11 +35,11 @@ source ../main_setup.sh
# NOTE 2: THE BACKSLASH (\) AT THE END OF EACH LINE MUST FOLLOW THE COMMENT. A BACKSLASH BEFORE THE COMMENT WON'T WORK!
##########################################################################################################################################
neurodocker generate ${neurodocker_buildMode} \
--base-image vnmd/fsl_${fslVersion}:20221016 \
--base-image vnmd/fsl_${fslVersion} \
--pkg-manager apt \
--env DEPLOY_PATH=/opt/${toolName}-${toolVersion}/bin/ \
--user=root `# otherwise some permission denied error occurs during docker build` \
--dcm2niix method=source version=${dcm2niiVersion} \
--dcm2niix method=source version=${dcm2niixVersion} \
--minc version=${mincVersion} \
\
--install wget curl git ca-certificates ltrace strace libxml2 gcc build-essential gzip tar unzip datalad libfftw3-3 software-properties-common bc `# install apt-get packages` \
Expand All @@ -49,7 +49,7 @@ neurodocker generate ${neurodocker_buildMode} \
&& dpkg -i libjpeg62-turbo_2.0.6-4_amd64.deb \
&& rm libjpeg62-turbo_2.0.6-4_amd64.deb" `# LIBJPEGTURBO_6.2 is required by dcm2mnc` \
\
--miniconda version=${pythonVersion}_${minicondaVersion} \
--miniconda version=${minicondaVersion} \
\
--workdir /opt `# HD-BET` \
--run="git clone https://github.com/MIC-DKFZ/HD-BET" \
Expand All @@ -63,7 +63,6 @@ neurodocker generate ${neurodocker_buildMode} \
--run="curl -o /opt/HD-BET/hd-bet_params/3.model https://zenodo.org/record/2540695/files/3.model?download=1" \
--run="curl -o /opt/HD-BET/hd-bet_params/4.model https://zenodo.org/record/2540695/files/4.model?download=1" \
--run="pip install -e ." \
--env DEPLOY_BINS=hd-bet \
\
--workdir=/opt/lcmodel-${lcmodelVersion}/ `# install LCModel and things to make it work ` \
--install curl ca-certificates libxft2 libxss1 libnet-ifconfig-wrapper-perl vim nano unzip gv unrar `# LCModel dependencies (libtk8.6 removed asks interactive question)` \
Expand Down Expand Up @@ -99,39 +98,34 @@ neurodocker generate ${neurodocker_buildMode} \
--copy gui-defaults /opt/lcmodel-${lcmodelVersion}/.lcmodel/profiles/1/gui-defaults \
--run="chmod a+rwx /opt/lcmodel-${lcmodelVersion} -R" \
--env DEPLOY_PATH=/opt/lcmodel-${lcmodelVersion}/.lcmodel/bin/:/opt/lcmodel-${lcmodelVersion}/.lcmodel/ \
--env PATH=/opt/lcmodel-${lcmodelVersion}/.lcmodel/bin/:/opt/lcmodel-${lcmodelVersion}/.lcmodel/:'$PATH' \
--env PATH="\${PATH}:/opt/lcmodel-${lcmodelVersion}/.lcmodel/bin/:/opt/lcmodel-${lcmodelVersion}/.lcmodel/" \
\
--workdir /opt `# Add Julia` \
`# Add MATLAB compiler runtime (doesn't need license)` \
--install bc curl libncurses5 libxext6 libxmu6 libxpm-dev libxt6 unzip openjdk-8-jre dbus-x11 \
--run="wget https://ssd.mathworks.com/supportfiles/downloads/R${matlabVersion}/Release/${matlabUpdateVersion}/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R${matlabVersion}_Update_${matlabUpdateVersion}_glnxa64.zip && \
unzip MATLAB_Runtime_R${matlabVersion}_Update_${matlabUpdateVersion}_glnxa64.zip -d mcrtmp && \
mcrtmp/install -mode silent -destinationFolder /opt/MATLAB_Runtime_R${matlabVersion} -agreeToLicense yes && \
rm -rf mcrtmp && \
rm -f MATLAB_Runtime_R${matlabVersion}_Update_${matlabUpdateVersion}_glnxa64.zip" \
\
--env LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:/opt/MATLAB_Runtime_R${matlabVersion}/R${matlabVersion}/runtime/glnxa64:/opt/MATLAB_Runtime_R${matlabVersion}/R${matlabVersion}/bin/glnxa64:/opt/MATLAB_Runtime_R${matlabVersion}/R${matlabVersion}/sys/os/glnxa64:/opt/MATLAB_Runtime_R${matlabVersion}/R${matlabVersion}/extern/bin/glnxa64" \
--workdir /opt `# Add Julia with MRSI packages` \
--run="wget https://julialang-s3.julialang.org/bin/linux/x64/${juliaVersion:0:3}/julia-${juliaVersion}-linux-x86_64.tar.gz && \
tar zxvf julia-${juliaVersion}-linux-x86_64.tar.gz && \
rm -rf julia-${juliaVersion}-linux-x86_64.tar.gz" \
--env PATH='$PATH':/opt/julia-${juliaVersion}/bin \
--env JULIA_DEPOT_PATH=/opt/julia_depot \
--env PATH="\${PATH}:/opt/julia-${juliaVersion}/bin" \
--copy install_packages.jl "/opt" \
--env JULIA_DEPOT_PATH="/opt/julia_depot" \
--run="julia install_packages.jl" \
--env JULIA_DEPOT_PATH="~/.julia:/opt/julia_depot" \
\
`# Add MATLAB compiler runtime (doesn't need license)` \
--install bc curl libncurses5 libxext6 libxmu6 libxpm-dev libxt6 multiarch-support unzip openjdk-8-jre dbus-x11 \
--run="wget https://ssd.mathworks.com/supportfiles/downloads/R${matlabVersion}/Release/6/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R${matlabVersion}_Update_6_glnxa64.zip && \
unzip MATLAB_Runtime_R${matlabVersion}_Update_6_glnxa64.zip -d mcrtmp && \
mcrtmp/install -mode silent -destinationFolder /opt/MATLAB_Runtime_R${matlabVersion} -agreeToLicense yes && \
rm -rf mcrtmp && \
rm -f MATLAB_Runtime_R${matlabVersion}_Update_6_glnxa64.zip" \
--env DEPLOY_BINS="julia:python:dcm2niix:hd-bet:lcmodel:nii2mnc:bet:fsl" \
\
--copy README.md /README.md `# include README file in container` \
\
> ${imageName}.${neurodocker_buildExt} `# LAST COMMENT; NOT FOLLOWED BY BACKSLASH!`

## To add in future version
#--matlabmcr version=2023a `# Add MATLAB runtime for compiled MATLAB code without license` \ doesn't work for some reason..
#--run "export MatlabFunctionsFolder=/opt/mrsiproc/matlab/MatlabFunctions" `#export dir for matlab scripts` \
#--run "mkdir -p /opt/mrsiproc/matlab/MatlabFunctions" \
#--run "chmod a+rwx /opt/mrsiproc/matlab/ -R" `#setup script dir for matlab functions and assorted scripts` \
#--run "git clone insert/https/here"
#--copy ./run_scripts/*mat /opt/mrsiproc/matlab/MatlabFunctions/ \
#--copy ./run_scripts/*m /opt/mrsiproc/matlab/MatlabFunctions/ \
#--copy ./run_scripts/*sh /opt/mrsiproc/ \
#--run "chmod a+rwx /opt/mrsiproc/ -R" \
#--run "/opt/mrsiproc/startup_matlab.sh" \

if [ "$1" != "" ]; then
./../main_build.sh
fi
4 changes: 4 additions & 0 deletions recipes/mrsiproc/install_packages.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Pkg
packages = ["MAT", "Comonicon"]
Pkg.add(packages)
Pkg.add(Pkg.PackageSpec(url="https://github.com/korbinian90/MRSI.jl"))

0 comments on commit a797655

Please sign in to comment.