PeerHerholz / BIDSonym

a BIDS app for pseudo-anonymization of neuroimaging data
https://peerherholz.github.io/BIDSonym/
BSD 3-Clause "New" or "Revised" License
51 stars 14 forks source link

Doesn't tolerate relative path to the bids dataset (works ok with full path) #28

Open yarikoptic opened 4 years ago

yarikoptic commented 4 years ago

Running

~/proj/nuisance/data/dbic-deid$ singularity run --cleanenv  envs/bidsonym_latest.sif sourcedata participant --participant_label=sid000003 --deid mri_deface

lead to the crash (sorry -- not cut pasting - needs sensoring of paths) unable to find the file with relative path under sourcedata/. Providing full path resolved it.

yarikoptic commented 1 month ago

I wish I pasted a full output because I think I ran into this again

(dev3) yoh@typhon:/data/yoh/1076_spacetop$ docker run -it --entrypoint bash --user $(id -u):$(id -g) -v $PWD:$PWD -w $PWD   --entrypoint bash bidsonym:local                                                                                                      bash-5.2$ pwd
/data/yoh/1076_spacetop
bash-5.2$ bidsonym . participant --brainextraction bet --bet_frac 0.5 --skip_bids_validation --participant_label 0001 0002
Input data will not be checked for BIDS compliance.
Found the following session(s) for participant 0001:
['01', '02', '03', '04']
...
240612-17:26:41,457 nipype.workflow ERROR:
         Saving crash info to /data/yoh/1076_spacetop/crash-20240612-172641-UID47521-bet-a3e9c725-39ac-4eff-a063-9df349e73348.pklz
Traceback (most recent call last):
  File "/opt/miniconda-latest/lib/python3.11/site-packages/nipype/pipeline/plugins/linear.py", line 47, in run
    node.run(updatehash=updatehash)
  File "/opt/miniconda-latest/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda-latest/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda-latest/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node bet.

Cmdline:
        bet sub-0001_ses-01_acq-MPRAGEXp3X08mm_T1w.nii.gz sourcedata/bidsonym/sub-0001/sub-0001_ses-01_acq-MPRAGEXp3X08mm_T1w_brainmask_desc-nondeid.nii.gz -f 0.50
Stdout: 
        /opt/fsl-6.0.7.4/bin/bet failed during command:sub-0001_ses-01_acq-MPRAGEXp3X08mm_T1w.nii.gz sourcedata/bidsonym/sub-0001/sub-0001_ses-01_acq-MPRAGEXp3X08mm_T1w_brainmask_desc-nondeid.nii.gz -f 0.50
bash-5.2$ nipypecli  crash crash-20240612-172641-UID47521-bet-a3e9c725-39ac-4eff-a063-9df349e73348.pklz

File: /data/yoh/1076_spacetop/crash-20240612-172641-UID47521-bet-a3e9c725-39ac-4eff-a063-9df349e73348.pklz
Node: brainextraction_wf.bet
Working directory: /tmp/tmpzwjsmxnu/brainextraction_wf/bet

Node inputs:

args = <undefined>
center = <undefined>
environ = {'FSLOUTPUTTYPE': 'NIFTI_GZ'}
frac = 0.5
functional = <undefined>
in_file = /tmp/tmpzwjsmxnu/brainextraction_wf/bet/sub-0001_ses-01_acq-MPRAGEXp3X08mm_T1w.nii.gz
mask = False
mesh = <undefined>
no_output = <undefined>
out_file = sourcedata/bidsonym/sub-0001/sub-0001_ses-01_acq-MPRAGEXp3X08mm_T1w_brainmask_desc-nondeid.nii.gz
...

so while in a temp folder for the node it was trying to write into "relative" to the top of the dataset path (although it is also odd that it takes it as output for bet but it is under sourcedata/ so there might be more to the bug...). I will now redo with full path