nimh-dsst / dsst-defacing-pipeline

Defacing algorithm to improve and evaluate accuracy for large datasets.
2 stars 2 forks source link

Should exit with non-0 exit code in case of failing, and likely even upon initial fail to run AFNI / fsl tools #45

Open yarikoptic opened 3 months ago

yarikoptic commented 3 months ago

Discovered while trying

where invocation of

yoh@typhon:/mnt/DATA/data/yoh/1076_spacetop$ singularity run -B $PWD:$PWD:ro -B $PWD/derivatives:$PWD/derivatives:rw -B $PWD/scratch:$PWD/scratch:rw --scratch $PWD/scratch --pwd $PWD --net --network none ../dsst-defacing-pipeline/dsst-defacing-pipeline-test.sing -p 0001 -s 01 -- . derivatives/dss-defacing-1 

lead to a quick run without stating an ERROR but doing nothing, exiting with normal exit code (0), and producing bunch of log files which actually showed the error:

...
[]
Preparing for QC by visual inspection...

yoh@typhon:/mnt/DATA/data/yoh/1076_spacetop$ echo $?
0

yoh@typhon:/mnt/DATA/data/yoh/1076_spacetop$ cat /mnt/DATA/data/yoh/1076_spacetop/derivatives/dss-defacing-1/bids_defaced/sub-0133/ses-01/anat/defacing_pipeline.log
================================ afni_refacer_run command ================================
module load afni ; export OMP_NUM_THREADS=1 ; @afni_refacer_run -input /mnt/DATA/data/yoh/1076_spacetop/sub-0133/ses-01/anat/sub-0133_ses-01_acq-MPRAGEXp3X08mm_T1w.nii.gz -mode_deface -no_clean -prefix /mnt/DATA/data/yoh/1076_spacetop/derivatives/dss-defacing-1/bids_defaced/sub-0133/ses-01/anat/sub-0133_ses-01_acq-MPRAGEXp3X08mm_T1w
==========================================================================================
/bin/sh: line 1: module: command not found
/bin/sh: line 1: @afni_refacer_run: command not found
@afni_refacer_run work directory not found. Most probably because the refacer command failed.

which also showed that there is a hardcoded assumption of needing "environment modules" (module command) which is generally not needed and thus IMHO should be done OUTSIDE of the pipeline to load all desired components (different HPCs might have different names for them etc)

yarikoptic commented 3 months ago

a fix will be tested/proposed within