Skip to content

Commit

Permalink
Remove (an old) conditional statement when keeping track of the sidec…
Browse files Browse the repository at this point in the history
…ars (Github PR #213))
  • Loading branch information
marcelzwiers committed Feb 4, 2024
1 parent fda3471 commit 3d88e18
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions bidscoin/plugins/dcm2niix2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,8 @@ def bidscoiner_plugin(session: Path, bidsmap: Bidsmap, bidsses: Path) -> Union[N
# Rename all associated files (i.e. the json-, bval- and bvec-files)
oldjsonfile = dcm2niixfile.with_suffix('').with_suffix('.json')
newjsonfile = newbidsfile.with_suffix('').with_suffix('.json')
if not oldjsonfile.is_file():
LOGGER.warning(f"Unexpected file conversion result: {oldjsonfile} not found")
else:
sidecars.discard(oldjsonfile)
sidecars.add(newjsonfile)
sidecars.discard(oldjsonfile)
sidecars.add(newjsonfile)
for oldfile in outfolder.glob(dcm2niixfile.with_suffix('').stem + '.*'):
oldfile.replace(newjsonfile.with_suffix(''.join(oldfile.suffixes)))

Expand Down

0 comments on commit 3d88e18

Please sign in to comment.