add_description_to_bids_path#

petpal.utils.bids_utils.add_description_to_bids_path(filepath: str, description: str) str#

Create a copy of a BIDS filepath string with a description entity inserted before the suffix.

Note

If a description ‘desc-’ entity already exists, it will be overwritten.

Parameters:
  • filepath (str) – BIDS-compliant filepath.

  • description (str) – ‘desc’ label to add to filename.

Returns:

string with ‘desc’ entity added (i.e. ‘filename_desc-[description]_pet.nii.gz’)