Skip to content

Incorrect identification of BIDS files #36

@clane9

Description

@clane9

The is_bids_files() function doesn't correctly detect all/only BIDS files. For example, the ome.zarr directories are not included in the generated table.

def is_bids_file(path: StrOrPath) -> bool:
"""
Check if `path` is a valid BIDS data file. E.g. not a directory or JSON sidecar
associated to another data file.
"""
# TODO: other checks?
# - skip files matching patterns in .bidsignore?
path = Path(path)
return (
not path.is_dir()
and path.name.startswith("sub-")
and not is_associated_sidecar(path)
)

One possible better way to identify BIDS files could use bidschematools and match the extension to known BIDS extensions.

cc @effigies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions