Python Create JSON file--Runs getting overwritten?

Hi everyone,

I’m trying to create a JSON file in Python as a reference for neuroimaging preprocessing but my data keeps getting over-written.

The output for print(anat_t1_files) and print(anat_t2_files) is as follows:

*As you can see subject YT7057704E T2w has run-01 and run-02. But when I try and create the json file I only get T2w to capture run-02.

image

What I am getting:

What I am looking for:

Both T2w run-01 and run-02 I want under T2w object with , after each run.

Any help would be appreciated.

Thanks.

–Subbi M.