THANKS! following the simplest invocation example there in examples, and now found that within neurodesk we have it under /fastsurfer/run_fastsurfer.sh, here is full sequence to proceed in proper STAMPED / YODA style as depicted on GitHub - ReproNim/containers: Containers "distribution" for reproducible neuroimaging · GitHub
yoh@typhon:~/proj/repronim$ datalad create -d ds000003-freesurfer -c text2git
[INFO ] Running procedure cfg_text2git
[INFO ] == Command start (output follows) =====
[INFO ] == Command exit (modification check follows) =====
run(ok): /home/yoh/proj/repronim/ds000003-freesurfer (dataset) [/usr/bin/python3 /usr/lib/python3/dist-p...]
create(ok): . (dataset)
action summary:
create (ok: 1)
run (ok: 1)
yoh@typhon:~/proj/repronim$ cd ds000003-freesurfer/
yoh@typhon:~/proj/repronim/ds000003-freesurfer$ datalad install -d . -s https://github.com/ReproNim/ds000003-demo sourcedata/raw
[INFO ] Remote origin not usable by git-annex; setting annex-ignore
[INFO ] https://github.com/ReproNim/ds000003-demo/config download failed: Not Found
[INFO ] access to 1 dataset sibling s3-PRIVATE not auto-enabled, enable with:
| datalad siblings -d "/home/yoh/proj/repronim/ds000003-freesurfer/sourcedata/raw" enable -s s3-PRIVATE
install(ok): sourcedata/raw (dataset)
add(ok): sourcedata/raw (dataset)
add(ok): .gitmodules (file)
save(ok): . (dataset)
add(ok): .gitmodules (file)
save(ok): . (dataset)
action summary:
add (ok: 3)
install (ok: 1)
save (ok: 2)
yoh@typhon:~/proj/repronim/ds000003-freesurfer$ datalad install -d . -s ../containers code/containers # my local ///repronim/containers with prefetched containers
install(ok): code/containers (dataset)
add(ok): code/containers (dataset)
add(ok): .gitmodules (file)
save(ok): . (dataset)
add(ok): .gitmodules (file)
save(ok): . (dataset)
action summary:
add (ok: 3)
install (ok: 1)
save (ok: 2)
yoh@typhon:~/proj/repronim/ds000003-freesurfer$ datalad run -m "Copy/freeze neurodesk container run spec here" code/containers/scripts/freeze_versions --save-dataset=. neurodesk-fastsurfer
[INFO ] == Command start (output follows) =====
I: We will be copying/freezing versions in .
add(ok): .datalad/config (file)
save(ok): . (dataset)
action summary:
add (ok: 1)
save (ok: 1)
[INFO ] == Command exit (modification check follows) =====
run(ok): /home/yoh/proj/repronim/ds000003-freesurfer (dataset) [code/containers/scripts/freeze_versions ...]
yoh@typhon:~/proj/repronim/ds000003-freesurfer$ cat .datalad/config
[datalad "dataset"]
id = 9bf5084a-3f52-4860-9b8d-84c81dc2df8e
[datalad "containers.neurodesk-fastsurfer"]
image = code/containers/images/neurodesk/neurodesk-fastsurfer--2.4.2.simg
cmdexec = {img_dspath}/code/containers/scripts/singularity_cmd run {img} {cmd}
yoh@typhon:~/proj/repronim/ds000003-freesurfer$ ls sourcedata/raw/sub-02/
anat/ func/
yoh@typhon:~/proj/repronim/ds000003-freesurfer$ ls sourcedata/raw/sub-02/anat/sub-02_
sub-02_inplaneT2.nii.gz sub-02_T1w.nii.gz
yoh@typhon:~/proj/repronim/ds000003-freesurfer$ ls sourcedata/raw/sub-02/anat/sub-02_*
sourcedata/raw/sub-02/anat/sub-02_inplaneT2.nii.gz sourcedata/raw/sub-02/anat/sub-02_T1w.nii.gz
yoh@typhon:~/proj/repronim/ds000003-freesurfer$ datalad containers-run -n neurodesk-fastsurfer -i sourcedata/raw/sub-02/anat/sub-02_T1w.nii.gz -- /fastsurfer/run_fastsurfer.sh --t1 '{inputs}' --sid 02 --threads 4 --3T --sd sub-02
[INFO ] Making sure inputs are available (this may take some time)
get(ok): sourcedata/raw/sub-02/anat/sub-02_T1w.nii.gz (file) [from s3-PUBLIC...]
get(ok): code/containers/images/neurodesk/neurodesk-fastsurfer--2.4.2.simg (file) [from origin...]
[INFO ] == Command start (output follows) =====
INFO: The subject directory did not exist, creating it now.
=========================================================
Start of the log for a new run_fastsurfer.sh invocation
=========================================================
Version: 2.4.2+7e53343
Fri Apr 10 03:10:46 PM UTC 2026
Log file for FastSurfer pipeline, run_fastsurfer.sh and segmentation(s)
python3.10 -s /fastsurfer/FastSurferCNN/run_prediction.py --t1 sourcedata/raw/sub-02/anat/sub-02_T1w.nii.gz --asegdkt_segfile sub-02/02/mri/aparc.DKTatlas+aseg.deep.mgz --conformed_name sub-02/02/mri/orig.mgz --brainmask_name sub-02/02/mri/mask.mgz --aseg_name sub-02/02/mri/aseg.auto_noCCseg.mgz --sid 02 --seg_log sub-02/02/scripts/deep-seg.log --vox_size min --batch_size 1 --viewagg_device auto --device auto --threads 4 --sd sub-02
[INFO: run_prediction.py: 647]: Checking or downloading default checkpoints ...
One of the following three options has to be passed --in_dir, --csv_file or --t1 with an absolute file path. Please specify the data input directory, the subject list file or the full path to input volume
ERROR: FastSurfer asegdkt segmentation failed.
[INFO ] == Command exit (modification check follows) =====
run(error): /home/yoh/proj/repronim/ds000003-freesurfer (dataset) [./code/containers/scripts/singularity_cm...]
action summary:
get (notneeded: 2, ok: 2)
run (error: 1)
so it ran, and depicted a suboptimal strategy of the fastsurfer – abs paths should not be requested to be specified since then make record not portable (reexecutable). Fixing for that while keeping datalad run record ‘portable’ by using {pwd} placeholder for datalad *run
yoh@typhon:~/proj/repronim/ds000003-freesurfer$ git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
sub-02/
nothing added to commit but untracked files present (use "git add" to track)
yoh@typhon:~/proj/repronim/ds000003-freesurfer$ git clean -dfx
Removing sub-02/
yoh@typhon:~/proj/repronim/ds000003-freesurfer$ datalad containers-run -n neurodesk-fastsurfer -i sourcedata/raw/sub-02/anat/sub-02_T1w.nii.gz -- /fastsurfer/run_fastsurfer.sh --t1 '{pwd}/{inputs}' --sid 02 --threads 4 --3T --sd sub-02
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 256/256 [01:34<00:00, 2.71batch/s]
[INFO: inference.py: 408]: Inference on 256 batches for sagittal successful
[INFO: inference.py: 469]: Sagittal inference on /home/yoh/proj/repronim/ds000003-freesurfer/sourcedata/raw/sub-02/anat/sub-02_T1w.nii.gz finished in 94.4663 seconds
[INFO: run_prediction.py: 400]: Run axial prediction
[INFO: dataset.py: 74]: Loading Axial with input voxelsize (1.0, 1.0)
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 256/256 [01:33<00:00, 2.74batch/s]
[INFO: inference.py: 408]: Inference on 256 batches for axial successful
[INFO: inference.py: 469]: Axial inference on /home/yoh/proj/repronim/ds000003-freesurfer/sourcedata/raw/sub-02/anat/sub-02_T1w.nii.gz finished in 93.3688 seconds
[INFO: run_prediction.py: 454]: Successfully saved image as sub-02/02/sub-02/02/mri/aparc.DKTatlas+aseg.deep.mgz.
[INFO: run_prediction.py: 724]: Creating brainmask based on segmentation...
Creating dilated mask ...
Frontal region special treatment: 27202
Found 1 connected component(s)!
[INFO: run_prediction.py: 454]: Successfully saved image as sub-02/02/sub-02/02/mri/mask.mgz.
[INFO: run_prediction.py: 743]: Creating aseg based on segmentation...
Reducing to aseg ...
FlipWM: rh 0 and lh 0 flipped.
[INFO: run_prediction.py: 454]: Successfully saved image as sub-02/02/sub-02/02/mri/aseg.auto_noCCseg.mgz.
[INFO: run_prediction.py: 762]: Running volume-based QC check on segmentation...
Checking total volume ...
Voxel size in mm3: 1.0
Total segmentation volume in liter: 1.34
INFO: Running N4 bias-field correction...
python3.10 -s /fastsurfer/recon_surf/N4_bias_correct.py --in sub-02/02/mri/orig.mgz --rescale sub-02/02/mri/orig_nu.mgz --aseg sub-02/02/mri/aseg.auto_noCCseg.mgz --threads 4
N4 Bias Correction Parameters:
- verbosity: -1
- input volume: sub-02/02/mri/orig.mgz
- output volume: do not save
- rescaled volume: sub-02/02/mri/orig_nu.mgz
- mask: default (>0)
- aseg: sub-02/02/mri/aseg.auto_noCCseg.mgz
- shrink factor: 4
- number fitting levels: 4
- number iterations: 50
- convergence threshold: 0.0
- threads: 4
read MGZ (FreeSurfer) image via nibabel...
Traceback (most recent call last):
File "/venv/lib/python3.10/site-packages/nibabel/loadsave.py", line 101, in load
stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sub-02/02/mri/orig.mgz'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/fastsurfer/recon_surf/N4_bias_correct.py", line 792, in <module>
sys.exit(main(invol, **args))
File "/fastsurfer/recon_surf/N4_bias_correct.py", line 647, in main
itk_image, image_header = iio.readITKimage(
File "/fastsurfer/recon_surf/image_io.py", line 163, in readITKimage
image = nib.load(filename)
[INFO: run_prediction.py: 724]: Creating brainmask based on segmentation...
Creating dilated mask ...
Frontal region special treatment: 27202
Found 1 connected component(s)!
[INFO: run_prediction.py: 454]: Successfully saved image as sub-02/02/sub-02/02/mri/mask.mgz.
[INFO: run_prediction.py: 743]: Creating aseg based on segmentation...
Reducing to aseg ...
FlipWM: rh 0 and lh 0 flipped.
[INFO: run_prediction.py: 454]: Successfully saved image as sub-02/02/sub-02/02/mri/aseg.auto_noCCseg.mgz.
[INFO: run_prediction.py: 762]: Running volume-based QC check on segmentation...
Checking total volume ...
Voxel size in mm3: 1.0
Total segmentation volume in liter: 1.34
INFO: Running N4 bias-field correction...
python3.10 -s /fastsurfer/recon_surf/N4_bias_correct.py --in sub-02/02/mri/orig.mgz --rescale sub-02/02/mri/orig_nu.mgz --aseg sub-02/02/mri/aseg.auto_noCCseg.mgz --threads 4
N4 Bias Correction Parameters:
- verbosity: -1
- input volume: sub-02/02/mri/orig.mgz
- output volume: do not save
- rescaled volume: sub-02/02/mri/orig_nu.mgz
- mask: default (>0)
- aseg: sub-02/02/mri/aseg.auto_noCCseg.mgz
- shrink factor: 4
- number fitting levels: 4
- number iterations: 50
- convergence threshold: 0.0
- threads: 4
read MGZ (FreeSurfer) image via nibabel...
Traceback (most recent call last):
File "/venv/lib/python3.10/site-packages/nibabel/loadsave.py", line 101, in load
stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sub-02/02/mri/orig.mgz'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/fastsurfer/recon_surf/N4_bias_correct.py", line 792, in <module>
sys.exit(main(invol, **args))
File "/fastsurfer/recon_surf/N4_bias_correct.py", line 647, in main
itk_image, image_header = iio.readITKimage(
File "/fastsurfer/recon_surf/image_io.py", line 163, in readITKimage
image = nib.load(filename)
File "/venv/lib/python3.10/site-packages/nibabel/loadsave.py", line 103, in load
raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: 'sub-02/02/mri/orig.mgz'
ERROR: Biasfield correction failed!
[INFO ] == Command exit (modification check follows) =====
run(error): /home/yoh/proj/repronim/ds000003-freesurfer (dataset) [./code/containers/scripts/singularity_cm...]
action summary:
get (notneeded: 4)
run (error: 1)
shared this repo on GitHub - ReproNim/ds000003-demo-fastsurfer: Doing YODA style demo from https://github.com/ReproNim/containers?tab=readme-ov-file#a-typical-yoda-workflow but using fastsurfer from NeuroDesktop collection · GitHub – result file is not shared. you should (I didn’t try) be able to ‘datalad rerun’ the last commit and it should fail similarly 