Skip to content

Commit

Permalink
Add more dcm2niix "BidsGuess" entity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelzwiers committed Sep 27, 2024
1 parent 396903e commit 63c93bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bidscoin/plugins/dcm2niix2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,11 @@ def bidscoiner_plugin(session: Path, bidsmap: BidsMap, bidsses: Path) -> Union[N
typeguess, targetguess = metadata.get('BidsGuess') or ['', ''] # BidsGuess: [datatype, filename]
if typeguess and run.datatype != typeguess:
LOGGER.warning(f"The datatype of {run} does not match with the datatype suggested by dcm2niix: {typeguess}")
elif targetguess and run.bids.get('suffix') != bids.get_bidsvalue(targetguess, 'suffix'):
elif targetguess and run.bids['suffix'] != bids.get_bidsvalue(targetguess, 'suffix'):
LOGGER.warning(f"The suffix of {run} does not match with the suffix suggested by dcm2niix: {targetguess}")
if targetguess and run.bids.get('dir') and run.bids.get('dir') != bids.get_bidsvalue(targetguess, 'dir'):
LOGGER.warning(f"The (phase-encoding) 'dir' value in {run} does not match with the 'dir' value suggested by dcm2niix: {targetguess}")
for entity in ('part', 'inv', 'echo', 'dir'):
if targetguess and run.bids.get(entity) and run.bids[entity] != bids.get_bidsvalue(targetguess, entity):
LOGGER.warning(f"The '{entity}' value in {run} does not match with the '{entity}' value suggested by dcm2niix: {targetguess}")

# Write the scans_table to disk
LOGGER.verbose(f"Writing acquisition time data to: {scans_tsv}")
Expand Down

0 comments on commit 63c93bf

Please sign in to comment.