Skip to content

Brain_Data constructor flattens multiple files instead of preserving subject structure #449

@ssadhukha

Description

@ssadhukha

When loading multiple nifti files using the constructor Brain_Data(file_list), the resulting object flattens the data into a single vector instead of maintaining the multi-subject structure, which is making it difficult to perform group-level stuff.

Workaround I found:

all_subjects = Brain_Data()
for file in rsa_files:
    subject = Brain_Data(file)
    if all_subjects.isempty():
        all_subjects = subject
    else:
        all_subjects = all_subjects.append(subject)

This worked previously? I was always able to just do all_subjects = Brain_Data(rsa_files) and the multi-subject structure was preserved.

python version: 3.10.18
nltools version: 0.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions