aramis-lab/clinica

Logging of `run_dcm2niix` is not consistent with the conversion result

Closed this issue · 0 comments

The run_dcm2niix function from the clinica.iotools.bids_utils module logs a "DICOM to BIDS conversion with dcm2niix failed" message whatever the result from the conversion:

cprint(
msg=(
"DICOM to BIDS conversion with dcm2niix failed:\n"
f"command: {' '.join(command)}\n"
f"{output_message}"
),
lvl="warning",
)
return False
cprint(
f"DICOM to BIDS conversion with dcm2niix failed:\ncommand: {' '.join(command)}\n",
lvl="debug",
)

The second log should be something like: "DICOM to BIDS conversion with dcm2niix successful".

This inconsistency was introduced in #1029