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

AttributeError: 'list' object has no attribute 'keys' #51

Closed dmd closed 3 years ago

dmd commented 3 years ago

This is with bidsonym_latest as pulled a few minutes ago.

$ singularity run -B /data /data/singularity-images/bidsonym_latest.sif /data/ddrucker/E15031658 participant --deid quickshear --brainextraction bet --participant_label 1 --bet_frac 0.5
Making sure the input data is BIDS compliant (warnings can be ignored in most cases).
bids-validator@1.5.4

This dataset appears to be BIDS compatible.

        Summary:                Available Tasks:        Available Modalities:
        9 Files, 642.1MB                                T1w
        1 - Subject                                     T2w
        1 - Session                                     bold

        If you have any questions, please post on https://neurostars.org/tags/bids.

/opt/miniconda-latest/envs/bidsonym/lib/python3.6/site-packages/bids/layout/models.py:152: FutureWarning: The 'extension' entity currently excludes the leading dot ('.'). As of version 0.14.0, it will include the leading dot. To suppress this warning and include the leading dot, use `bids.config.set_option('extension_initial_dot', True)`.
  FutureWarning)
Processing data from one session.
210413-10:00:53,745 nipype.workflow INFO:
         Workflow brainextraction_wf settings: ['check', 'execution', 'logging', 'monitoring']
210413-10:00:53,752 nipype.workflow INFO:
         Running serially.
210413-10:00:53,752 nipype.workflow INFO:
         [Node] Setting-up "brainextraction_wf.bet" in "/tmp/tmp4hae5ml8/brainextraction_wf/bet".
210413-10:00:53,756 nipype.workflow INFO:
         [Node] Running "bet" ("nipype.interfaces.fsl.preprocess.BET"), a CommandLine Interface with command:
bet /data/ddrucker/E15031658/sub-1/anat/sub-1_T1w.nii.gz /data/ddrucker/E15031658/sourcedata/bidsonym/sub-1/sub-1_T1w_brainmask_desc-nondeid.nii.gz -f 0.50
210413-10:00:57,487 nipype.workflow INFO:
         [Node] Finished "brainextraction_wf.bet".
Traceback (most recent call last):
  File "/opt/miniconda-latest/envs/bidsonym/bin/bidsonym", line 33, in <module>
    sys.exit(load_entry_point('bidsonym', 'console_scripts', 'bidsonym')())
  File "/home/bm/bidsonym/run_deeid.py", line 137, in run_deeid
    check_meta_data(args.bids_dir, subject_label, list_check_meta)
  File "/home/bm/bidsonym/utils.py", line 122, in check_meta_data
    for key, inf in zip(meta_data.keys(), meta_data.values()):
AttributeError: 'list' object has no attribute 'keys'
PeerHerholz commented 3 years ago

Hi @dmd,

thanks for reporting this. I tried to reproduce the error using a test dataset and bidsonym_latest as obtained via singularity pull docker://peerherholz/bidsonym, but did not observe the problem you are reporting. I just merged some updates from the container_tests branch to master and one change I made in response to your error was to add that all meta-data files that will be evaluated will be indicated during the run (which is also a good idea in general, so thanks for that!). Could you maybe try it again via either the latest or container_tests tags, after the automated build(s) finished in a few minutes? With that we might get a better idea of what is going wrong.

dmd commented 3 years ago

Hmm. I can't reproduce this even on master any more, so maybe there was something odd with my data.

PeerHerholz commented 3 years ago

Hi,

sorry for the late reply. Hm, that's good and bad I guess, hehe. I'll close this for now, but please feel free to re-open anytime.

Cheers