diff --git a/bidscoin/bidsapps/echocombine.py b/bidscoin/bidsapps/echocombine.py index d0874c1a..4e302c51 100755 --- a/bidscoin/bidsapps/echocombine.py +++ b/bidscoin/bidsapps/echocombine.py @@ -25,7 +25,7 @@ def echocombine(bidsfolder: str, pattern: str, participant: list, output: str, algorithm: str, weights: list, force: bool=False): """ - :param bidsdir: The bids-directory with the (multi-echo) subject data + :param bidsfolder: The bids-directory with the (multi-echo) subject data :param pattern: Globlike recursive search pattern (relative to the subject/session folder) to select the first echo of the images that need to be combined, e.g. '*task-*echo-1*' :param participant: List of sub-# identifiers to be processed (the sub-prefix can be left out). If not specified then all participants will be processed :param output: Determines where the output is saved. It can be the name of a BIDS datatype folder, such as 'func', or of the derivatives folder, i.e. 'derivatives'. If output = [the name of the input datatype folder] then the original echo images are replaced by one combined image. If output is left empty then the combined image is saved in the input datatype folder and the original echo images are moved to the {unknowndatatype} folder diff --git a/bidscoin/bidscoiner.py b/bidscoin/bidscoiner.py index 8bab92f7..4c4dc3d5 100755 --- a/bidscoin/bidscoiner.py +++ b/bidscoin/bidscoiner.py @@ -157,7 +157,7 @@ def bidscoiner(sourcefolder: str, bidsfolder: str, participant: list=(), force: # Create the job arguments and add it to the batch bidsfolder_tmp = bidsfolder/'HPC_work'/f"bids_{subid}" # NB: f"bids_{subid}" is used later, don't change bidsfolder_tmp.mkdir(parents=True, exist_ok=True) - jt.args = [rawfolder, bidsfolder_tmp, '-p', subject.name, '-b', bidsmapfile] + (['-f'] if force else []) + jt.args = [rawfolder, bidsfolder_tmp, '-p', subject.name, '-b', bidsmap.filepath] + (['-f'] if force else []) jt.jobName = f"bidscoiner_{subject.name}" jt.outputPath = f"{os.getenv('HOSTNAME')}:{bidsfolder_tmp}/{jt.jobName}.out" jobids.append(pbatch.runJob(jt)) diff --git a/bidscoin/plugins/dcm2niix2bids.py b/bidscoin/plugins/dcm2niix2bids.py index 58785d8f..4adb3e7c 100644 --- a/bidscoin/plugins/dcm2niix2bids.py +++ b/bidscoin/plugins/dcm2niix2bids.py @@ -508,17 +508,18 @@ def bidscoiner_plugin(session: Path, bidsmap: BidsMap, bidsses: Path) -> Union[N scans_table.loc[target.relative_to(bidsses).as_posix(), 'acq_time'] = acq_time # Check if the target output aligns with dcm2niix's "BidsGuess" datatype and filename entities - typeguess, targetguess = metadata.get('BidsGuess') or ['', ''] # BidsGuess: [datatype, filename] - LOGGER.bcdebug(f"BidsGuess: [{typeguess}, {targetguess}]") - if typeguess and run.datatype != typeguess: - LOGGER.warning(f"The datatype of {target.relative_to(bidsses)} does not match with the datatype guessed by dcm2niix: {typeguess}") - elif targetguess and run.bids['suffix'] != bids.get_bidsvalue(targetguess, 'suffix'): - LOGGER.warning(f"The suffix of {target.relative_to(bidsses)} does not match with the suffix guessed by dcm2niix: {targetguess}") - for entity in ('part', 'inv', 'echo', 'dir'): - targetvalue = bids.get_bidsvalue(target, entity) - guessvalue = bids.get_bidsvalue(targetguess, entity) - if targetvalue and guessvalue and targetvalue != guessvalue: - LOGGER.warning(f"The '{entity}_{targetvalue}' value in {target.relative_to(bidsses)} does not match with the '{entity}_{guessvalue}' value guessed by dcm2niix: {targetguess}") + if not ignore: + typeguess, targetguess = metadata.get('BidsGuess') or ['', ''] # BidsGuess: [datatype, filename] + LOGGER.bcdebug(f"BidsGuess: [{typeguess}, {targetguess}]") + if typeguess and run.datatype != typeguess: + LOGGER.info(f"The datatype of {target.relative_to(bidsses)} does not match with the datatype guessed by dcm2niix: {typeguess}") + elif targetguess and bids.get_bidsvalue(target, 'suffix') != bids.get_bidsvalue(targetguess, 'suffix'): + LOGGER.info(f"The suffix of {target.relative_to(bidsses)} does not match with the suffix guessed by dcm2niix: {targetguess}") + for entity in ('part', 'inv', 'echo', 'dir'): + targetvalue = bids.get_bidsvalue(target, entity) + guessvalue = bids.get_bidsvalue(targetguess, entity) + if targetvalue and guessvalue and targetvalue != guessvalue: + LOGGER.warning(f"The '{entity}_{targetvalue}' value in {target.relative_to(bidsses)} does not match with the '{entity}_{guessvalue}' value guessed by dcm2niix: {targetguess}") # Write the scans_table to disk LOGGER.verbose(f"Writing acquisition time data to: {scans_tsv}")