Skip to content

Commit

Permalink
Merge pull request #797 from NeuroDesk/brainnetviewer
Browse files Browse the repository at this point in the history
  • Loading branch information
stebo85 authored Sep 4, 2024
2 parents da33134 + 528727d commit 2d31519
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
15 changes: 15 additions & 0 deletions recipes/brainnetviewer/README.md
Original file line number Diff line number Diff line change
@@ -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)

----------------------------------
36 changes: 36 additions & 0 deletions recipes/brainnetviewer/bnv.star
Original file line number Diff line number Diff line change
@@ -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")
3 changes: 3 additions & 0 deletions recipes/brainnetviewer/brainnetviewer
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exec /run_BrainNet.sh /opt/matlab/v94 $@
35 changes: 35 additions & 0 deletions recipes/brainnetviewer/build.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2d31519

Please sign in to comment.