diff --git a/recipes/brainnetviewer/README.md b/recipes/brainnetviewer/README.md new file mode 100644 index 00000000..a8e0f482 --- /dev/null +++ b/recipes/brainnetviewer/README.md @@ -0,0 +1,15 @@ + +---------------------------------- +## brainnetviewer/toolVersion## + +BrainNet Viewer is a brain network visualization tool, which can help researchers to visualize structural and functional connectivity patterns from different levels in a quick, easy, and flexible way. + +**Citation:** Xia M, Wang J, He Y. BrainNet Viewer: a network visualization tool for human brain connectomics. PLoS One. 2013 Jul 4;8(7):e68910. doi: 10.1371/journal.pone.0068910. PMID: 23861951; PMCID: PMC3701683. + +**Homepage:** https://www.nitrc.org/projects/bnv/ + +**Example:** `brainnetviewer` + +**License:** GNU General Public License Version 3 (GPL-3.0) + +---------------------------------- diff --git a/recipes/brainnetviewer/bnv.star b/recipes/brainnetviewer/bnv.star new file mode 100644 index 00000000..a879faad --- /dev/null +++ b/recipes/brainnetviewer/bnv.star @@ -0,0 +1,36 @@ +bnv_binaries = "https://www.nitrc.org/frs/download.php/11585/BrainNetViewer20191031_sd_Linux_x64_compiled2018a.zip" +mcr_installer = "https://ssd.mathworks.com/supportfiles/downloads/R2018a/deployment_files/R2018a/installers/glnxa64/MCR_R2018a_glnxa64_installer.zip" + +mcr_installed = define.build_vm( + directives = [ + define.plan( + builder = "ubuntu@jammy", + packages = [ + query("openjdk-17-jdk"), + query("bash"), + ], + tags = ["level3", "defaults"], + ), + directive.archive(define.read_archive(define.fetch_http(mcr_installer), ".zip"), target = "/mcr"), + directive.run_command("/mcr/install -destinationFolder /opt/matlab -mode silent -agreeToLicense yes"), + directive.run_command("tar caf /matlab.tar.gz /opt/matlab"), + ], + storage_size = 16 * 1024, + output = "/matlab.tar.gz", +) + +mcr_installed_archive = define.read_archive(mcr_installed, ".tar.gz") + +bnv_root = define.build_fs([ + define.plan( + builder = "ubuntu@jammy", + packages = [ + query("openjdk-17-jdk"), + query("bash"), + ], + tags = ["level3", "defaults", "noScripts"], + ), + mcr_installed_archive, + directive.builtin("init", "/init"), + define.read_archive(define.fetch_http(bnv_binaries), ".zip"), +], "tar") diff --git a/recipes/brainnetviewer/brainnetviewer b/recipes/brainnetviewer/brainnetviewer new file mode 100755 index 00000000..5705303f --- /dev/null +++ b/recipes/brainnetviewer/brainnetviewer @@ -0,0 +1,3 @@ +#!/bin/bash + +exec /run_BrainNet.sh /opt/matlab/v94 $@ diff --git a/recipes/brainnetviewer/build.sh b/recipes/brainnetviewer/build.sh new file mode 100755 index 00000000..3ad0b063 --- /dev/null +++ b/recipes/brainnetviewer/build.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -e + +export toolName='brainnetviewer' +export toolVersion='1.7.20191031' + +if [ "$1" != "" ]; then + echo "Entering Debug mode" + export debug=$1 +fi + +source ../main_setup.sh + +# Use Singlrity/Apptainer to run TinyRange to generate the rootfs. +singularity run docker://ghcr.io/tinyrange/tinyrange:stable build bnv.star:bnv_root -o bnv.tar + +# Make sure the automaticcly included template doesn't add to the final layer. +neurodocker generate ${neurodocker_buildMode} \ + --base-image ubuntu \ + --pkg-manager apt \ + --base-image scratch \ + --add bnv.tar . \ + --run "/init -run-scripts /.pkg/scripts.json" \ + --run="printf '#!/bin/bash\nls -la' > /usr/bin/ll" \ + --run="chmod +x /usr/bin/ll" \ + --run="mkdir -p ${mountPointList}" \ + --copy brainnetviewer /usr/bin/brainnetviewer \ + --entrypoint "/usr/bin/brainnetviewer" \ + --env DEPLOY_BINS=brainnetviewer \ + --copy README.md /README.md \ + > ${imageName}.${neurodocker_buildExt} + +if [ "$1" != "" ]; then + ./../main_build.sh +fi