clinicadl.io.bids.BidsFileType

class clinicadl.io.bids.BidsFileType(**data: Any) None[source]

To define the files you are interested in within your BIDS dataset.

A BidsFileType can refer either to data files or metadata files.

match() method determines if a file matches the specifications defined in the current BidsFileType.

Parameters:
  • suffix (str | Pattern) – The BIDS suffix of the relevant files. Regular expressions are accepted.

  • data_type (Optional[str | Pattern], default=None) –

    The BIDS data type, which is the folder where the relevant files are stored (e.g., "anat" if the relevant files are structural imaging files). Regular expressions are accepted.

    If None, the files are expected to be at the root of the directory that is being explored.

  • extension (str | Pattern, default=re.compile(".nii.*")) – The file extension of the relevant files. Regular expressions are accepted.

  • with_entities (Optional[dict[AlphanumericStr, str | Pattern]], default=None) –

    The BIDS entities that the relevant files must contain . For example, if with_entities={"trc": "18FFDG"}, all the files with trc-18FFDG in their filenames are candidate. Regular expressions are accepted for the entity values.

    Important

    • No need to mention the entities "sub" and "ses" here.

  • without_entities (Optional[dict[AlphanumericStr, str | Pattern]], default=None) – The BIDS entities that the files must not contain. For example, if without_entities={"trc": "18FFDG"}, all the files with trc-18FFDG are excluded. Regular expressions are accepted for the entity values.

  • description (Union[str], default=None) –

    A potential description of the files.

    Note

    This description is not used; it is provided for information purposes only.