Skip to content

AIBL-to-BIDS converter is not warning the user when not converting some sessions #1501

@AliceJoubert

Description

@AliceJoubert

In AIBL-to-BIDS, there are two ways an image can be missing from the output :

  • It can happen that the converter chooses not to convert some images. Sometimes, images actually exist, are under the expected format ie inside a folder named after the date of the examination but the session cannot be matched to the metadata because the examination date is not indicated in it.

For example :

Image

In this case, both sessions won't be converted even though the data exists since the value for EXAMDATE is missing.

The user is not warned about it at all, which can be confusing.

  • Conversion can fail. The following function is supposed to be warning users but it is not tested:
    def _warn_about_missing_files(files: list[list[Optional[Path]]]):
    from clinica.utils.stream import cprint
    missing_files = []
    for files_for_given_modality in files:
    for file in files_for_given_modality:
    if file is not None and not file.exists():
    missing_files.append(file)
    if missing_files:
    msg = "The following file were not converted:\n" + "\n".join(
    (str(f) for f in missing_files)
    )
    cprint(msg=msg, lvl="warning")

For example, if the conversion fails earlier and there is no filename for a failure then the user is not warned.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions