From 2f72d058e2a9cb49234792f340fe9a53145d8ac6 Mon Sep 17 00:00:00 2001 From: Marcel Zwiers Date: Tue, 20 Feb 2024 01:46:11 +0100 Subject: [PATCH] Upgrade BIDScoin to v4.3.0 (#594) * - Upgrade BIDScoin to 4.3.0 - Remove tools that need FSL or FreeSurfer * Fix URL typo * Fix versionstring replacement --- recipes/bidscoin/README.md | 21 ++++++++------------- recipes/bidscoin/build.sh | 24 +++++++++++++----------- recipes/bidscoin/test.sh | 3 ++- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/recipes/bidscoin/README.md b/recipes/bidscoin/README.md index afe8668c..c8af8cde 100644 --- a/recipes/bidscoin/README.md +++ b/recipes/bidscoin/README.md @@ -1,27 +1,23 @@ ---------------------------------- -## bidscoin/4.2.1 ## -Contains a collection of tools needed for DICOM to BIDS conversion, as well as MRS spectroscopy and physiological data to BIDS conversion +## bidscoin/4.3.0 ## +Contains a GUI and CLI tools needed for DICOM to BIDS conversion, as well as MRS spectroscopy and physiological data to BIDS conversion -Tools included: +Tools included (NB: some tools that depend on FSL or FreeSurfer are not included): ``` -bidscoin: https://bidscoin.readthedocs.io/en/4.2.1 +dcm2niix: https://github.com/rordenlab/dcm2niix (v1.0.20240202) +spec2nii: https://github.com/wtclarke/spec2nii (v0.7.2) +bidscoin: https://bidscoin.readthedocs.io/en/4.3.0 bidscoin bidscoiner bidseditor bidsmapper bidsparticipants - deface dicomsort echocombine - medeface physio2tsv plotphysio rawmapper - skullstrip - slicereport -dcm2niix: v1.0.20230411 https://github.com/rordenlab/dcm2niix -spec2nii: v0.7.0: https://github.com/wtclarke/spec2nii ``` Example converting dicom to BIDS: @@ -35,14 +31,13 @@ bidscoiner inputfolder bidsoutputfolder ``` More documentation can be found here: -https://bidscoin.readthedocs.io/en/4.2.1 - +https://bidscoin.readthedocs.io/ Citation: ``` Zwiers MP, Moia S, Oostenveld R. BIDScoin: A User-Friendly Application to Convert Source Data to Brain Imaging Data Structure. Front Neuroinform. 2022 Jan 13;15:770608. doi: 10.3389/fninf.2021.770608. PMID: 35095452; PMCID: PMC8792932. ``` -To run container outside of this environment: `ml bidscoin/4.2.1` +To run container outside of this environment: ml bidscoin/4.3.0 ---------------------------------- diff --git a/recipes/bidscoin/build.sh b/recipes/bidscoin/build.sh index 4329217c..e1b417f1 100755 --- a/recipes/bidscoin/build.sh +++ b/recipes/bidscoin/build.sh @@ -3,30 +3,27 @@ set -e # this template file builds tools required for dicom conversion to bids export toolName='bidscoin' -export toolVersion='4.2.1' -# Don't forget to update version change in README.md!!!!! +export toolVersion='4.3.0' # Don't forget to update version change in README.md!!!!! if [ "$1" != "" ]; then echo "Entering Debug mode" + export BIDSCOIN_DEBUG=TRUE export debug=$1 fi source ../main_setup.sh -# Changes made to .def file: -# 1. turned the apt-get install to neurodocker install -# 2. put commands with cd with && in between -# TODO: update these list items to better reflect the changes made -neurodocker generate ${neurodocker_buildMode} `# Based on Singularity .def file provided by bidscoin at https://github.com/Donders-Institute/bidscoin/blob/master/singularity.def` \ - `# Install the latest dcm2niix from source` \ +# Changes made to .def file: turned the apt-get install to neurodocker install and use Ubuntu/Qt6 +neurodocker generate ${neurodocker_buildMode} `# Based on Singularity .def file provided by bidscoin at https://github.com/Donders-Institute/bidscoin/blob/master/apptainer.def` \ --pkg-manager apt \ --base-image debian:stable \ --env DEBIAN_FRONTEND=noninteractive \ --run="printf '#!/bin/bash\nls -la' > /usr/bin/ll" \ --run="chmod +x /usr/bin/ll" \ --run="mkdir -p ${mountPointList}" \ + `# Install the latest dcm2niix from source` \ --install git build-essential cmake \ - --run "export GIT_SSL_NO_VERIFY=1 && git clone https://github.com/rordenlab/dcm2niix.git" `# first command solves some issue with the close as explaine here: https://stackoverflow.com/questions/21181231/server-certificate-verification-failed-cafile-etc-ssl-certs-ca-certificates-c` \ + --run "export GIT_SSL_NO_VERIFY=1 && git clone https://github.com/rordenlab/dcm2niix.git" `# first command solves some issue with the clone, see: https://stackoverflow.com/questions/21181231/server-certificate-verification-failed-cafile-etc-ssl-certs-ca-certificates-c` \ --run "cd dcm2niix; mkdir build && cd build; cmake ..; make install" \ `# Install curl (sometimes needed by dcm2niix)` \ --install curl \ @@ -36,11 +33,16 @@ neurodocker generate ${neurodocker_buildMode} `# Based on Singularity .def file `# NOTE: PyQt5 is installed as Debian package to solve dependencies issues occurring when installed with pip.` \ --install python3-pyqt5 \ --miniconda version=latest \ - pip_install='bidscoin[spec2nii2bids,deface]@git+https://github.com/Donders-Institute/bidscoin@v4.2.1+qt5' \ - --env DEPLOY_BINS=bidscoin:bidscoiner:bidseditor:bidsmapper:bidsparticipants:deface:dicomsort:echocombine:medeface:physio2tsv:plotphysio:rawmapper:skullstrip:slicereport:dcm2niix:pydeface:spec2nii \ + pip_install="bidscoin[spec2nii2bids]@git+https://github.com/Donders-Institute/bidscoin@v${toolVersion}+qt5" \ + --env DEPLOY_BINS=bidscoin:bidscoiner:bidseditor:bidsmapper:bidsparticipants:dicomsort:echocombine:physio2tsv:plotphysio:rawmapper:dcm2niix:spec2nii \ --copy README.md /README.md \ > ${toolName}_${toolVersion}.Dockerfile if [ "$1" != "" ]; then ./../main_build.sh fi + +# Test image with: +# sudo docker run --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix bidscoin_${toolVersion}:TAG bidscoin -t +# sudo docker run -it -v /root:/root --entrypoint /bin/bash -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix bidscoin_${toolVersion}:TAG +# bidscoin -t diff --git a/recipes/bidscoin/test.sh b/recipes/bidscoin/test.sh index b9594b7c..14107f2c 100644 --- a/recipes/bidscoin/test.sh +++ b/recipes/bidscoin/test.sh @@ -1,3 +1,4 @@ export QT_DEBUG_PLUGINS=1 bidscoin -t - bidseditor myproject/bids \ No newline at end of file + bidseditor myproject/bids + # sudo docker run --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix bidscoin_4.3.0:20240219 bidscoin -t