nimh-dsst / dsst-defacing-pipeline

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

Should just skip a subject without anatomical #44

Open yarikoptic opened 6 months ago

yarikoptic commented 6 months ago

Also relates to

as indeed that flag did not select only the subject I specified, but went through all and then crashed with

Traceback (most recent call last):
  File "/opt/dsst-defacing-pipeline/run.py", line 192, in <module>
    main()
  File "/opt/dsst-defacing-pipeline/run.py", line 132, in main
    missing_refacer_out = deface.deface_primary_scan(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dsst-defacing-pipeline/deface.py", line 218, in deface_primary_scan
    primary_t1 = mapping_dict[subj_id][sess_id]['primary_t1']
                 ~~~~~~~~~~~~^^^^^^^^^
KeyError: 'sub-0046'

as that subject is missing ses-01 (but has 02-04) which usually contained the anat/ (relevant here also #42) .

I think pipeline should not crash, since such inconsistency is not per se violation of BIDS etc.