sct-pipeline / csa-atrophy

Evaluate the sensitivity of atrophy detection with SCT
https://csa-atrophy.readthedocs.io/
MIT License
1 stars 0 forks source link

FileNotFoundError: cannot find yml file #48

Closed jcohenadad closed 4 years ago

jcohenadad commented 4 years ago

When running on compute canada:

+ for i_transfo in '${seq_transfo[@]}'
+ affine_transfo -i sub-vuiisIngenia06_T1w_RPIr_crop_r1.nii.gz -transfo /scratch/jcohen/results_csa_t1_20200818/results/transfo_values.csv -config /scratch/jcohen/results_csa_t1_20200818/results/sub-vuiisIngenia06//home/jcohen/csa-atrophy/config_script_t1.yml -o _t1
/scratch/jcohen/results_csa_t1_20200818/results/sub-vuiisIngenia06//home/jcohen/csa-atrophy/config_script_t1.yml
Traceback (most recent call last):
  File "/home/jcohen/.local/bin/affine_transfo", line 11, in <module>
    load_entry_point('csa-atrophy', 'console_scripts', 'affine_transfo')()
  File "/home/jcohen/csa-atrophy/affine_transfo.py", line 219, in main
    config_param = yaml_parser(path_config_file)
  File "/home/jcohen/csa-atrophy/affine_transfo.py", line 82, in yaml_parser
    with open(config_file, 'r') as config_var:
FileNotFoundError: [Errno 2] No such file or directory: '/scratch/jcohen/results_csa_t1_20200818/results/sub-vuiisIngenia06//home/jcohen/csa-atrophy/config_script_t1.yml'

this concatenation of path is the culprit: '/scratch/jcohen/results_csa_t1_20200818/results/sub-vuiisIngenia06//home/jcohen/csa-atrophy/config_script_t1.yml'

it should be easy to fix

jcohenadad commented 4 years ago

This error is caused by the following line:

https://github.com/sct-pipeline/csa-atrophy/blob/7f48572b9c0503b4391c5ae53b547ae1a87bc482/process_data.sh#L181

and the fact that I set the full path for the script_args field:

path_data: /home/jcohen/data-multi-subject
path_output: /scratch/jcohen/results_csa_t1_20200818
script: /home/jcohen/csa-atrophy/process_data.sh
script_args: /home/jcohen/csa-atrophy/config_script_t1.yml
jobs: 0
zip: true

So, I suggest the following change in process_data.sh:

jcohenadad commented 4 years ago

Note, this also affects this line: https://github.com/sct-pipeline/csa-atrophy/blob/7f48572b9c0503b4391c5ae53b547ae1a87bc482/process_data.sh#L184