From 694c1338d35666148a5defa6a8a062e37d00166d Mon Sep 17 00:00:00 2001 From: fliem Date: Fri, 27 Jan 2017 18:17:16 +0100 Subject: [PATCH 01/11] fixes behav in singl-session-subjects in long study --- run.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/run.py b/run.py index d85a215..fe718c8 100755 --- a/run.py +++ b/run.py @@ -104,8 +104,8 @@ def run(command, env={}, ignore_errors=False): run("cp -rf " + os.path.join(os.environ["SUBJECTS_DIR"], "rh.EC_average") + " " + os.path.join(output_dir, "rh.EC_average"), ignore_errors=True) + # check if study is truly longitudinal for subject_label in subjects_to_analyze: - # Check for multiple sessions to combine as a multiday session or as a longitudinal stream session_dirs = glob(os.path.join(args.bids_dir,"sub-%s"%subject_label,"ses-*")) sessions = [os.path.split(dr)[-1].split("-")[-1] for dr in session_dirs] @@ -117,9 +117,10 @@ def run(command, env={}, ignore_errors=False): "anat", "%s_T1w.nii*"%acq_tpl)): n_valid_sessions += 1 - if n_valid_sessions > 1 and args.multiple_sessions == "longitudinal": - longitudinal_study = True + if n_valid_sessions > 1 and args.multiple_sessions == "longitudinal": + longitudinal_study = True + for subject_label in subjects_to_analyze: timepoints = [] if len(sessions) > 0 and longitudinal_study == True: From 5df041159db47490a6988f378276db2089bf648a Mon Sep 17 00:00:00 2001 From: fliem Date: Sat, 28 Jan 2017 06:10:22 +0100 Subject: [PATCH 02/11] fixes session var in second subject loop --- run.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run.py b/run.py index fe718c8..dcb7241 100755 --- a/run.py +++ b/run.py @@ -123,6 +123,8 @@ def run(command, env={}, ignore_errors=False): for subject_label in subjects_to_analyze: timepoints = [] + session_dirs = glob(os.path.join(args.bids_dir,"sub-%s"%subject_label,"ses-*")) + sessions = [os.path.split(dr)[-1].split("-")[-1] for dr in session_dirs] if len(sessions) > 0 and longitudinal_study == True: # Running each session separately, prior to doing longitudinal pipeline for session_label in sessions: From 171a6c60d4228344621e60a6d928607cb5802498 Mon Sep 17 00:00:00 2001 From: fliem Date: Sat, 28 Jan 2017 06:19:08 +0100 Subject: [PATCH 03/11] added longitudinal tests. tests now check for recon-all.done file --- circle.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 2b2f8c9..ba3a565 100644 --- a/circle.yml +++ b/circle.yml @@ -10,6 +10,7 @@ dependencies: override: - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi - if [[ ! -d ~/data/ds114_test1 ]]; then wget -c -O ${HOME}/ds114_test1.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e54a326c613b01d7d3ed90" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1.tar -C ${HOME}/data; fi + - if [[ ! -d ~/data/ds114_test2 ]]; then wget -c -O ${HOME}/ds114_test2.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2.tar -C ${HOME}/data; fi - git describe --tags > version - docker build -t bids/${CIRCLE_PROJECT_REPONAME} . : timeout: 21600 @@ -19,7 +20,9 @@ test: override: # print version - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME,,} --version - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1: + - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && ${HOME}/outputs1/sub-01/scripts/recon-all.done : + timeout: 21600 + - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && ${HOME}/outputs2/sub-01_ses-retest.long.sub-01/scripts/recon-all.done && cat ${HOME}/outputs2/sub-01_ses-test.long.sub-01/scripts/recon-all.done : timeout: 21600 deployment: From 0f214492095c9fce0db3582c5ea28c08624ea8e7 Mon Sep 17 00:00:00 2001 From: fliem Date: Sat, 28 Jan 2017 06:34:21 +0100 Subject: [PATCH 04/11] missing cat --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index ba3a565..8b1055a 100644 --- a/circle.yml +++ b/circle.yml @@ -20,9 +20,9 @@ test: override: # print version - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME,,} --version - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && ${HOME}/outputs1/sub-01/scripts/recon-all.done : + - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && cat ${HOME}/outputs1/sub-01/scripts/recon-all.done : timeout: 21600 - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && ${HOME}/outputs2/sub-01_ses-retest.long.sub-01/scripts/recon-all.done && cat ${HOME}/outputs2/sub-01_ses-test.long.sub-01/scripts/recon-all.done : + - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && cat ${HOME}/outputs2/sub-01_ses-retest.long.sub-01/scripts/recon-all.done && cat ${HOME}/outputs2/sub-01_ses-test.long.sub-01/scripts/recon-all.done : timeout: 21600 deployment: From c972f4119e746afc88404f4c3fb6c19bc08658e1 Mon Sep 17 00:00:00 2001 From: fliem Date: Sat, 28 Jan 2017 09:11:24 +0100 Subject: [PATCH 05/11] removed longitudinal tests as they time-out (>120min) --- circle.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/circle.yml b/circle.yml index 8b1055a..289f951 100644 --- a/circle.yml +++ b/circle.yml @@ -10,7 +10,6 @@ dependencies: override: - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi - if [[ ! -d ~/data/ds114_test1 ]]; then wget -c -O ${HOME}/ds114_test1.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e54a326c613b01d7d3ed90" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1.tar -C ${HOME}/data; fi - - if [[ ! -d ~/data/ds114_test2 ]]; then wget -c -O ${HOME}/ds114_test2.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2.tar -C ${HOME}/data; fi - git describe --tags > version - docker build -t bids/${CIRCLE_PROJECT_REPONAME} . : timeout: 21600 @@ -22,8 +21,6 @@ test: - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME,,} --version - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && cat ${HOME}/outputs1/sub-01/scripts/recon-all.done : timeout: 21600 - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && cat ${HOME}/outputs2/sub-01_ses-retest.long.sub-01/scripts/recon-all.done && cat ${HOME}/outputs2/sub-01_ses-test.long.sub-01/scripts/recon-all.done : - timeout: 21600 deployment: hub: From c03164b3c1958c25293a7b4fe17893d9d7b7219c Mon Sep 17 00:00:00 2001 From: fliem Date: Mon, 30 Jan 2017 12:38:10 +0100 Subject: [PATCH 06/11] added longitudinal data (with 1 ses in sub-01) and long test --- circle.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/circle.yml b/circle.yml index 289f951..f6a00d8 100644 --- a/circle.yml +++ b/circle.yml @@ -10,6 +10,8 @@ dependencies: override: - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi - if [[ ! -d ~/data/ds114_test1 ]]; then wget -c -O ${HOME}/ds114_test1.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e54a326c613b01d7d3ed90" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1.tar -C ${HOME}/data; fi + # longitudinal data. s01 has only one session + - if [[ ! -d ~/data/ds114_test2_missing ]]; then wget -c -O ${HOME}/ds114_test2_missing.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && mkdir -p ${HOME}/data/ds114_test2_missing && tar xf ${HOME}/ds114_test2_missing.tar -C ${HOME}/data/ds114_test2_missing --exclude='ds114_test2/sub-01/ses-retest*' --strip-components=1; fi - git describe --tags > version - docker build -t bids/${CIRCLE_PROJECT_REPONAME} . : timeout: 21600 @@ -21,6 +23,8 @@ test: - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME,,} --version - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && cat ${HOME}/outputs1/sub-01/scripts/recon-all.done : timeout: 21600 + - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test2_missing:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done : + timeout: 21600 deployment: hub: From 361b74600c55b0ec24685ea823b6c8590e3ea186 Mon Sep 17 00:00:00 2001 From: fliem Date: Mon, 30 Jan 2017 12:39:29 +0100 Subject: [PATCH 07/11] moved longitudinal check out of loop --- run.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/run.py b/run.py index dcb7241..bac8ce4 100755 --- a/run.py +++ b/run.py @@ -80,6 +80,24 @@ def run(command, env={}, ignore_errors=False): else: acq_tpl = "*" +# check if study is truly longitudinal +subject_dirs = glob(os.path.join(args.bids_dir, "sub-*")) +subjects_to_analyze = [subject_dir.split("-")[-1] for subject_dir in subject_dirs] +for subject_label in subjects_to_analyze: + # Check for multiple sessions to combine as a multiday session or as a longitudinal stream + session_dirs = glob(os.path.join(args.bids_dir,"sub-%s"%subject_label,"ses-*")) + sessions = [os.path.split(dr)[-1].split("-")[-1] for dr in session_dirs] + longitudinal_study = False + n_valid_sessions = 0 + for session_label in sessions: + if glob(os.path.join(args.bids_dir, "sub-%s"%subject_label, + "ses-%s"%session_label, + "anat", + "%s_T1w.nii*"%acq_tpl)): + n_valid_sessions += 1 +if n_valid_sessions > 1 and args.multiple_sessions == "longitudinal": + longitudinal_study = True + subjects_to_analyze = [] # only for a subset of subjects if args.participant_label: @@ -104,22 +122,6 @@ def run(command, env={}, ignore_errors=False): run("cp -rf " + os.path.join(os.environ["SUBJECTS_DIR"], "rh.EC_average") + " " + os.path.join(output_dir, "rh.EC_average"), ignore_errors=True) - # check if study is truly longitudinal - for subject_label in subjects_to_analyze: - # Check for multiple sessions to combine as a multiday session or as a longitudinal stream - session_dirs = glob(os.path.join(args.bids_dir,"sub-%s"%subject_label,"ses-*")) - sessions = [os.path.split(dr)[-1].split("-")[-1] for dr in session_dirs] - longitudinal_study = False - n_valid_sessions = 0 - for session_label in sessions: - if glob(os.path.join(args.bids_dir, "sub-%s"%subject_label, - "ses-%s"%session_label, - "anat", - "%s_T1w.nii*"%acq_tpl)): - n_valid_sessions += 1 - if n_valid_sessions > 1 and args.multiple_sessions == "longitudinal": - longitudinal_study = True - for subject_label in subjects_to_analyze: timepoints = [] From b58c92009f1304394ace34e92caa8aae667f8432 Mon Sep 17 00:00:00 2001 From: fliem Date: Mon, 30 Jan 2017 12:53:13 +0100 Subject: [PATCH 08/11] renamed tar file --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index f6a00d8..fe56893 100644 --- a/circle.yml +++ b/circle.yml @@ -10,8 +10,8 @@ dependencies: override: - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi - if [[ ! -d ~/data/ds114_test1 ]]; then wget -c -O ${HOME}/ds114_test1.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e54a326c613b01d7d3ed90" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1.tar -C ${HOME}/data; fi - # longitudinal data. s01 has only one session - - if [[ ! -d ~/data/ds114_test2_missing ]]; then wget -c -O ${HOME}/ds114_test2_missing.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && mkdir -p ${HOME}/data/ds114_test2_missing && tar xf ${HOME}/ds114_test2_missing.tar -C ${HOME}/data/ds114_test2_missing --exclude='ds114_test2/sub-01/ses-retest*' --strip-components=1; fi + # longitudinal data. includes only one session for sub-01 + - if [[ ! -d ~/data/ds114_test2_missing ]]; then wget -c -O ${HOME}/ds114_test2.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && mkdir -p ${HOME}/data/ds114_test2_missing && tar xf ${HOME}/ds114_test2.tar -C ${HOME}/data/ds114_test2_missing --exclude='ds114_test2/sub-01/ses-retest*' --strip-components=1; fi - git describe --tags > version - docker build -t bids/${CIRCLE_PROJECT_REPONAME} . : timeout: 21600 From 5209ab4b2c3ac68a37bdcea88fd80837111529b3 Mon Sep 17 00:00:00 2001 From: fliem Date: Mon, 30 Jan 2017 12:54:52 +0100 Subject: [PATCH 09/11] moved timepoints --- run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run.py b/run.py index bac8ce4..9678b6d 100755 --- a/run.py +++ b/run.py @@ -123,10 +123,10 @@ def run(command, env={}, ignore_errors=False): ignore_errors=True) for subject_label in subjects_to_analyze: - timepoints = [] - session_dirs = glob(os.path.join(args.bids_dir,"sub-%s"%subject_label,"ses-*")) sessions = [os.path.split(dr)[-1].split("-")[-1] for dr in session_dirs] + + timepoints = [] if len(sessions) > 0 and longitudinal_study == True: # Running each session separately, prior to doing longitudinal pipeline for session_label in sessions: From 2ca45c40469bdf72d2751f3f239a9639a0195c03 Mon Sep 17 00:00:00 2001 From: fliem Date: Tue, 31 Jan 2017 09:13:14 +0100 Subject: [PATCH 10/11] removed long tests --- circle.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/circle.yml b/circle.yml index fe56893..289f951 100644 --- a/circle.yml +++ b/circle.yml @@ -10,8 +10,6 @@ dependencies: override: - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi - if [[ ! -d ~/data/ds114_test1 ]]; then wget -c -O ${HOME}/ds114_test1.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e54a326c613b01d7d3ed90" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1.tar -C ${HOME}/data; fi - # longitudinal data. includes only one session for sub-01 - - if [[ ! -d ~/data/ds114_test2_missing ]]; then wget -c -O ${HOME}/ds114_test2.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && mkdir -p ${HOME}/data/ds114_test2_missing && tar xf ${HOME}/ds114_test2.tar -C ${HOME}/data/ds114_test2_missing --exclude='ds114_test2/sub-01/ses-retest*' --strip-components=1; fi - git describe --tags > version - docker build -t bids/${CIRCLE_PROJECT_REPONAME} . : timeout: 21600 @@ -23,8 +21,6 @@ test: - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME,,} --version - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && cat ${HOME}/outputs1/sub-01/scripts/recon-all.done : timeout: 21600 - - docker run -ti --rm --read-only -v /tmp:/tmp -v /var/tmp:/var/tmp -v ${HOME}/data/ds114_test2_missing:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME,,} /bids_dataset /outputs participant --participant_label 01 --license_key="~/test.key" --stages autorecon1 && cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done : - timeout: 21600 deployment: hub: From 5e8aaa5efc1a2032011c473a86e27dab1fc9d097 Mon Sep 17 00:00:00 2001 From: fliem Date: Tue, 31 Jan 2017 18:38:35 +0100 Subject: [PATCH 11/11] added mulit_session_study var --- run.py | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/run.py b/run.py index 9678b6d..b8100e3 100755 --- a/run.py +++ b/run.py @@ -75,28 +75,36 @@ def run(command, env={}, ignore_errors=False): run("bids-validator " + args.bids_dir) subject_dirs = glob(os.path.join(args.bids_dir, "sub-*")) + if args.acquisition_label: acq_tpl = "*acq-%s*" % args.acquisition_label else: acq_tpl = "*" -# check if study is truly longitudinal -subject_dirs = glob(os.path.join(args.bids_dir, "sub-*")) -subjects_to_analyze = [subject_dir.split("-")[-1] for subject_dir in subject_dirs] -for subject_label in subjects_to_analyze: - # Check for multiple sessions to combine as a multiday session or as a longitudinal stream - session_dirs = glob(os.path.join(args.bids_dir,"sub-%s"%subject_label,"ses-*")) - sessions = [os.path.split(dr)[-1].split("-")[-1] for dr in session_dirs] - longitudinal_study = False - n_valid_sessions = 0 - for session_label in sessions: - if glob(os.path.join(args.bids_dir, "sub-%s"%subject_label, - "ses-%s"%session_label, - "anat", - "%s_T1w.nii*"%acq_tpl)): - n_valid_sessions += 1 -if n_valid_sessions > 1 and args.multiple_sessions == "longitudinal": +# if there are session folders, check if study is truly longitudinal by +# searching for the first subject with more than one valid sessions +multi_session_study = False +if glob(os.path.join(args.bids_dir, "sub-*", "ses-*")): + subjects = [subject_dir.split("-")[-1] for subject_dir in subject_dirs] + for subject_label in subjects: + session_dirs = glob(os.path.join(args.bids_dir,"sub-%s"%subject_label,"ses-*")) + sessions = [os.path.split(dr)[-1].split("-")[-1] for dr in session_dirs] + n_valid_sessions = 0 + for session_label in sessions: + if glob(os.path.join(args.bids_dir, "sub-%s"%subject_label, + "ses-%s"%session_label, + "anat", + "%s_T1w.nii*"%acq_tpl)): + n_valid_sessions += 1 + if n_valid_sessions > 1: + multi_session_study = True + break + +if multi_session_study and (args.multiple_sessions == "longitudinal"): longitudinal_study = True +else: + longitudinal_study = False + subjects_to_analyze = [] # only for a subset of subjects