123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- Bootstrap: docker
- FROM: python:3.11.6-slim-bookworm
- Stage: base
- %setup
- # touch ${SINGULARITY_ROOTFS}/data
- %files
- save_feat.py /codes/
- predict_age_stacking.py /codes/
- analysis.sh /codes/
-
- %environment
- #
- %post
- pip install --upgrade pip
- pip install "scikit-learn==1.3.2" \
- "nibabel==4.0.2" \
- "nilearn==0.9.0" \
- "numpy==1.25.2" \
- "pandas==1.5.3" \
- "joblib==1.4.2" \
- "julearn==0.3.1"
- mkdir /model/
- mkdir /data/
- mkdir /extras
- # mkdir /codes
- # cp save_feat.py /codes/
- # cp predict_age_stacking.py /codes/
- # cp analysis.sh /codes/
- chmod +x /codes/*
- apt-get -y update && apt-get install -y unzip wget
- apt-get -y --quiet --no-install-recommends install build-essential curl ca-certificates
- curl https://gin.g-node.org/antogeo/stacking_model/raw/68c8723a15badbac0c26bf3d40aa9ba31264ea4a/extras/mask_4mm_binarized.nii --output /extras/mask_4mm_binarized.nii
- curl https://gin.g-node.org/antogeo/stacking_model/raw/68c8723a15badbac0c26bf3d40aa9ba31264ea4a/extras/mask_8mm_binarized.nii --output /extras/mask_8mm_binarized.nii
- curl https://gin.g-node.org/antogeo/stacking_model/raw/68c8723a15badbac0c26bf3d40aa9ba31264ea4a/extras/brainmask_12.8.nii --output /extras/brainmask_12.8.nii
- wget https://gin.g-node.org/antogeo/stacking_model/raw/master/stacking_enigmaModel%281%29.pkl -O /model/stacking_enigmaModel.pkl
- chmod +rw /extras/*
- # Octave
- # add-apt-repository 'http://ftp.debian.org/debian/ stable main contrib non-free'
- DEBIAN_FRONTEND=noninteractive apt-get --yes --quiet install octave liboctave-dev
- mkdir /opt/spm12
- curl -fsSL --retry 5 https://github.com/spm/spm12/archive/r7771.tar.gz | tar -xzC /opt/spm12 --strip-components 1
- curl -fsSL --retry 5 https://raw.githubusercontent.com/spm/spm-octave/main/spm12_r7771.patch | patch -p0
- make -C /opt/spm12/src PLATFORM=octave distclean
- make -C /opt/spm12/src PLATFORM=octave
- make -C /opt/spm12/src PLATFORM=octave install
- ln -s /opt/spm12/bin/spm12-octave /usr/local/bin/spm12
- rm -f /opt/spm12/src/*.{mex,o,a}
- apt-get --yes remove build-essential curl liboctave-dev
- apt-get --yes autoremove
- apt-get --yes clean
- %environment
- export SPM_HOME=/opt/spm12
- %runscript
- # # cp $1 /data
- # echo "Starting age prediction for following subject/subjects"
- # echo "predict subject's : $1"
- # exec echo "$1"
- bash /codes/analysis.sh "$@"
- %startscript
-
- %test
- grep -q NAME=\"Ubuntu\" /etc/os-release
- if [ "$(ls -A /data/)" ]; then
- echo "No data provided"
- else
- echo "Data found in data"
- fi
- %labels
- Author: Antonopoulos Georgios https://github.com/antogeo
- Version v0.0.1
- %help
- This def file builds a Singularity container with a brain-age prediction model based on
- "BrainAGE: Revisited and reframed machine learning workflow", Polona Kalc et al.
- It gets GMV and WMV nifti as inputs and predicts the age of the subject.
- You need to run the following command prior to building the container:
- > chmod -R 777 /tmp 255 !
- At first, it extracts the features by performing resampling (4mm and 8mm) and smoothing
- (4mm and 8mm) to the image. Four different combinations of resampling and smoothing of
- the two tissue images result in 8 different groups of features.
|