From 2151cfbaebe8568bcf922fc4a7f5f91ba751fe00 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Thu, 26 Jan 2023 11:54:53 -0500 Subject: [PATCH 1/3] fix bids when multiple sessions --- scripts/scil_validate_bids.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/scil_validate_bids.py b/scripts/scil_validate_bids.py index 4704b78e5..4ff78b0ca 100755 --- a/scripts/scil_validate_bids.py +++ b/scripts/scil_validate_bids.py @@ -241,7 +241,6 @@ def get_data(layout, nSub, dwis, t1s, fs, default_readout, clean): else: topup = ['', ''] else: - print(dwis) logging.info(""" BIDS structure unkown.Please send an issue: https://github.com/scilus/scilpy/issues @@ -325,15 +324,15 @@ def associate_dwis(layout, nSub): phaseEncodingDirection = layout.get_PhaseEncodingDirection(**base_dict) if len(phaseEncodingDirection) == 1: logging.info("Found one phaseEncodingDirection.") - return [layout.get(part=Query.NONE, **base_dict) + + return [[el] for el in layout.get(part=Query.NONE, **base_dict) +\ layout.get(part='mag', **base_dict)] elif len(directions) == 1: logging.info("Found one direction.") - return [layout.get(part=Query.NONE, **base_dict) + + return [[el] for el in layout.get(part=Query.NONE, **base_dict) +\ layout.get(part='mag', **base_dict)] elif not directions: logging.info("Found no directions or PhaseEncodingDirections.") - return [layout.get(part=Query.NONE, **base_dict) + + return [[el] for el in layout.get(part=Query.NONE, **base_dict) + layout.get(part='mag', **base_dict)] if len(phaseEncodingDirection) > 2 or len(directions) > 2: @@ -426,6 +425,7 @@ def main(): logging.warning("-" * len(mess)) logging.warning(mess) dwis = associate_dwis(layout, nSub) + print(dwis) fs_inputs = [] t1s = [] From f07ab357f25516b7fb9cfeb70c8affd81586da60 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Thu, 26 Jan 2023 11:56:14 -0500 Subject: [PATCH 2/3] typo --- scripts/scil_validate_bids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/scil_validate_bids.py b/scripts/scil_validate_bids.py index 4ff78b0ca..7f2a95956 100755 --- a/scripts/scil_validate_bids.py +++ b/scripts/scil_validate_bids.py @@ -332,7 +332,7 @@ def associate_dwis(layout, nSub): layout.get(part='mag', **base_dict)] elif not directions: logging.info("Found no directions or PhaseEncodingDirections.") - return [[el] for el in layout.get(part=Query.NONE, **base_dict) + + return [[el] for el in layout.get(part=Query.NONE, **base_dict) +\ layout.get(part='mag', **base_dict)] if len(phaseEncodingDirection) > 2 or len(directions) > 2: From 593e3480a562e3784da7a8ab5d92ec9f9348547f Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Thu, 26 Jan 2023 12:30:10 -0500 Subject: [PATCH 3/3] remove extra print --- scripts/scil_validate_bids.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/scil_validate_bids.py b/scripts/scil_validate_bids.py index 7f2a95956..45e645d51 100755 --- a/scripts/scil_validate_bids.py +++ b/scripts/scil_validate_bids.py @@ -241,10 +241,12 @@ def get_data(layout, nSub, dwis, t1s, fs, default_readout, clean): else: topup = ['', ''] else: + print(dwis) logging.info(""" BIDS structure unkown.Please send an issue: https://github.com/scilus/scilpy/issues """) + return {} # T1 setup t1_path = 'todo' @@ -425,7 +427,6 @@ def main(): logging.warning("-" * len(mess)) logging.warning(mess) dwis = associate_dwis(layout, nSub) - print(dwis) fs_inputs = [] t1s = []