Skip to content

Commit 1f1fa79

Browse files
committed
Remove flawed and fragile check for existing output data (GitHub issue #243)
1 parent 00e751a commit 1f1fa79

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

bidscoin/bidscoiner.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -262,21 +262,11 @@ def bidscoiner(sourcefolder: str, bidsfolder: str, participant: list=(), force:
262262
if not datasource.dataformat:
263263
LOGGER.info(f">>> No datasources found in '{sesfolder}'")
264264
continue
265+
LOGGER.info(f">>> Coining datasources in: {sesfolder}")
265266
subid = bidsmap.dataformat(datasource.dataformat).subject
266267
sesid = bidsmap.dataformat(datasource.dataformat).session
267268
subid, sesid = datasource.subid_sesid(subid, sesid or '')
268269
bidssession = bidsfolder/subid/sesid # TODO: Support DICOMDIR with multiple subjects (as in PYDICOMDIR)
269-
if not force and bidssession.is_dir():
270-
datatypes = set()
271-
for datatype in [dtype for dtype in lsdirs(bidssession) if next(dtype.iterdir(), None)]: # See what non-empty datatypes we already have in the bids session-folder
272-
for dataformat in bidsmap.dataformats:
273-
if datatype.name in dataformat.datatypes: # See if we are going to add data for this datatype
274-
datatypes.add(datatype.name)
275-
if datatypes:
276-
LOGGER.info(f">>> Skipping processed session: {bidssession} already has {datatypes} data (you can carefully use the -f option to overrule)")
277-
continue
278-
279-
LOGGER.info(f">>> Coining datasources in: {sesfolder}")
280270
if bidssession.is_dir():
281271
LOGGER.warning(f"Existing BIDS output-directory found, which may result in duplicate data (with increased run-index). Make sure {bidssession} was cleaned-up from old data before (re)running the bidscoiner")
282272
bidssession.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)