From 9ab572f102bbbfb7914a3391f60e9ea3e87406dc Mon Sep 17 00:00:00 2001 From: Thom Shaw <31721414+thomshaw92@users.noreply.github.com> Date: Fri, 27 Sep 2024 15:21:48 +1000 Subject: [PATCH] dcm2niix container recipe --- recipes/dcm2niix/README.md | 23 +++++++++++++++++++++++ recipes/dcm2niix/build.sh | 35 +++++++++++++++++++++++++++++++++++ recipes/dcm2niix/test.sh | 1 + 3 files changed, 59 insertions(+) create mode 100644 recipes/dcm2niix/README.md create mode 100644 recipes/dcm2niix/build.sh create mode 100644 recipes/dcm2niix/test.sh diff --git a/recipes/dcm2niix/README.md b/recipes/dcm2niix/README.md new file mode 100644 index 00000000..3011aefb --- /dev/null +++ b/recipes/dcm2niix/README.md @@ -0,0 +1,23 @@ + +---------------------------------- +## dcm2niix/v1.0.20240202' ## +dcm2niix is designed to convert neuroimaging data from the DICOM format to the NIfTI format. This web page hosts the developmental source code - a compiled version for Linux, MacOS, and Windows of the most recent stable release is included with MRIcroGL. A full manual for this software is available in the form of a NITRC wiki. + +Example: +``` +./dcm2niix ./test-dicom-dir -b y +``` + +More documentation can be found here: (https://github.com/rordenlab/dcm2niix?tab=readme-ov-file) + +To make the executables and scripts inside this container transparently available in the command line of environments where Neurocommand is installed: ml dcm2niix/v1.0.20240202 + +Citation: +``` +Li X, Morgan PS, Ashburner J, Smith J, Rorden C (2016) The first step for neuroimaging data analysis: DICOM to NIfTI conversion. J Neurosci Methods. 264:47-56. doi: 10.1016/j.jneumeth.2016.03.001. PMID: 26945974 +``` + +License: This software is open source. The bulk of the code is covered by the BSD license. Some units are either public domain (nifti*.*, miniz.c) or use the MIT license (ujpeg.cpp). See the license.txt file for more details. +https://github.com/rordenlab/dcm2niix/blob/master/license.txt + +---------------------------------- diff --git a/recipes/dcm2niix/build.sh b/recipes/dcm2niix/build.sh new file mode 100644 index 00000000..92e0c01f --- /dev/null +++ b/recipes/dcm2niix/build.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -e + +export toolName='dcm2niix' +export toolVersion='v1.0.20240202' + +# Don't forget to update version change in README.md!!!!! + +if [ "$1" != "" ]; then + echo "Entering Debug mode" + export debug=$1 +fi + +source ../main_setup.sh + +neurodocker generate ${neurodocker_buildMode} \ + --base-image ubuntu:20.04 \ + --pkg-manager apt \ + --run="printf '#!/bin/bash\nls -la' > /usr/bin/ll" \ + --run="chmod +x /usr/bin/ll" \ + --run="mkdir -p ${mountPointList}" \ + --install git wget ca-certificates pigz \ + --workdir /opt/${toolName}-${toolVersion} \ + --run="curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_lnx.zip \ + && unzip dcm2niix_lnx.zip \ + && chmod a+rwx /opt/${toolName}-${toolVersion}/${toolName} \ + && rm -rf dcm2niix_lnx.zip" \ + --env PATH='$PATH':/opt/${toolName}-${toolVersion} \ + --env DEPLOY_PATH=/opt/${toolName}-${toolVersion} \ + --copy README.md /README.md \ +> ${imageName}.${neurodocker_buildExt} + +if [ "$1" != "" ]; then + ./../main_build.sh +fi \ No newline at end of file diff --git a/recipes/dcm2niix/test.sh b/recipes/dcm2niix/test.sh new file mode 100644 index 00000000..68a155c1 --- /dev/null +++ b/recipes/dcm2niix/test.sh @@ -0,0 +1 @@ +dcm2niix \ No newline at end of file