bids.layout.BIDSFile

class BIDSFile(filename)[source]

Represents a single file or directory in a BIDS dataset.

Parameters:

filename (str) – The path to the corresponding file.

Attributes:
class_
dirname
filename
is_dir
path
relpath

Return path relative to layout root

tags

Methods

copy(path_patterns[, symbolic_link, root, ...])

Copy the contents of a file to a new location.

get_associations([kind, include_parents])

Get associated files, optionally limiting by association kind.

get_entities([metadata, values])

Return entity information for the current file.

get_metadata()

Return all metadata associated with the current file.

__init__(filename)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

Methods

__init__(filename)

A simple constructor that allows initialization from kwargs.

copy(path_patterns[, symbolic_link, root, ...])

Copy the contents of a file to a new location.

get_associations([kind, include_parents])

Get associated files, optionally limiting by association kind.

get_entities([metadata, values])

Return entity information for the current file.

get_metadata()

Return all metadata associated with the current file.

Attributes

class_

dirname

entities

filename

is_dir

metadata

path

registry

relpath

Return path relative to layout root

tags