Skip to content

Save .tsv file that stores dimensions of .nii.gz files #288

@JohannesWiesner

Description

@JohannesWiesner

Is your feature request related to a problem? Please describe.

After converting my data to BIDS using bidscoin, some subjects end up with multiple runs for the same modality. This most often occurs for functional scans, where an initial run was aborted and one or more subsequent runs were acquired. In most cases (≈90%), the aborted runs contain an insufficient number of volumes, while the final run contains the expected number.

In practice, this means I can often assume that the last run is the correct one, but this still requires a sanity check. At the moment, I load all .nii.gz files and inspect their shapes using nilearn.image.load_img(path).shape to verify that I only keep runs with the correct number of volumes. However, this approach is quite time-consuming.

Describe the solution you'd like

I am wondering whether this check could be performed on the fly during BIDS conversion in bidscoin. For example, does bidscoin already have access to the number of .IMA files (or slices/volumes) for a given run in memory at some point in the pipeline, such that this information could be stored or exposed? If so, this might allow filtering or flagging incomplete runs without additional computational overhead.

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