Skip to content

Commit

Permalink
Merge branch 'master' into long
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgorgo authored Feb 9, 2017
2 parents 5e8aaa5 + 1b991ab commit 230da75
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ This App has the following command line arguments:
analyzed. Multiple participants can be specified with
a space separated list.
--n_cpus N_CPUS Number of CPUs/cores available to use. (Default is 1)
--stages {all,autorecon1,autorecon2,autorecon2-cp,autorecon2-wm,autorecon2-pial,autorecon3,autorecon-all}
--stages {all,autorecon1,autorecon2,autorecon2-cp,autorecon2-wm,autorecon-pial,autorecon3,autorecon-all}
Recon-all stages to run. (Default is autorecon-all)
--template_name TEMPLATE_NAME
Name for the custom group level template generated
Expand All @@ -82,10 +82,14 @@ This App has the following command line arguments:
(resolution <1.2mm isovolumetric). If you want to
ignore these, specify None or T1only to generate
surfaces on the T1 alone.
--hires_mode {auto,enable,disable}
Submilimiter (high resolution) processing. 'auto' -
use only if <1.0mm data detected, 'enable' - force on,
'disable' - force off
--refine_pial_acquisition_label ACQUISITION_LABEL
If the dataset contains multiple T2 or FLAIR weighted
images from different acquisitions which one should be
used? Corresponds to "acq-<acquisition_label>"
--hires_mode {auto,enable,disable}
Submilimiter (high resolution) processing. 'auto' -
use only if <1.0mm data detected, 'enable' - force on,
'disable' - force off

To run it in participant level mode (for one participant):

Expand Down
19 changes: 12 additions & 7 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ def run(command, env={}, ignore_errors=False):
parser.add_argument('--n_cpus', help='Number of CPUs/cores available to use.',
default=1, type=int)
parser.add_argument('--stages', help='Autorecon stages to run.',
choices=["autorecon1", "autorecon2", "autorecon2-cp", "autorecon2-wm", "autorecon2-pial", "autorecon3", "autorecon-all", "all"],
choices=["autorecon1", "autorecon2", "autorecon2-cp", "autorecon2-wm", "autorecon-pial", "autorecon3", "autorecon-all", "all"],
default=["autorecon-all"],
nargs="+")
parser.add_argument('--template_name', help='Name for the custom group level template generated for this dataset',
default="average")
parser.add_argument('--license_key', help='FreeSurfer license key - letters and numbers after "*" in the email you received after registration. To register (for free) visit https://surfer.nmr.mgh.harvard.edu/registration.html',
required=True)
parser.add_argument('--acquisition_label', help='If the dataset contains multiple T1 weighted images from different acquisitions which one should be used? Corresponds to "acq-<acquisition_label>"')
parser.add_argument('--refine_pial_acquisition_label', help='If the dataset contains multiple T2 or FLAIR weighted images from different acquisitions which one should be used? Corresponds to "acq-<acquisition_label>"')
parser.add_argument('--multiple_sessions', help='For datasets with multiday sessions where you do not want to '
'use the longitudinal pipeline, i.e., sessions were back-to-back, '
'set this to multiday, otherwise sessions with T1w data will be '
Expand Down Expand Up @@ -105,6 +106,10 @@ def run(command, env={}, ignore_errors=False):
else:
longitudinal_study = False

if args.refine_pial_acquisition_label:
acq_t2 = "*acq-%s*" % args.refine_pial_acquisition_label
else:
acq_t2 = "*"

subjects_to_analyze = []
# only for a subset of subjects
Expand Down Expand Up @@ -151,10 +156,10 @@ def run(command, env={}, ignore_errors=False):

T2s = glob(os.path.join(args.bids_dir, "sub-%s"%subject_label,
"ses-%s"%session_label, "anat",
"*_T2w.nii*"))
"*%s_T2w.nii*"%acq_t2))
FLAIRs = glob(os.path.join(args.bids_dir, "sub-%s"%subject_label,
"ses-%s"%session_label, "anat",
"*_FLAIR.nii*"))
"*%s_FLAIR.nii*"%acq_t2))
if args.refine_pial == "T2":
for T2 in T2s:
if max(nibabel.load(T2).header.get_zooms()) < 1.2:
Expand Down Expand Up @@ -249,12 +254,12 @@ def run(command, env={}, ignore_errors=False):
"sub-%s"%subject_label,
"ses-*",
"anat",
"*_T2w.nii*"))
"*%s_T2w.nii*"%acq_t2))
FLAIRs = glob(os.path.join(args.bids_dir,
"sub-%s"%subject_label,
"ses-*",
"anat",
"*_FLAIR.nii*"))
"*%s_FLAIR.nii*"%acq_t2))
if args.refine_pial == "T2":
for T2 in T2s:
if max(nibabel.load(T2).header.get_zooms()) < 1.2:
Expand Down Expand Up @@ -303,9 +308,9 @@ def run(command, env={}, ignore_errors=False):
input_args += " -hires"
input_args += " -i %s"%T1
T2s = glob(os.path.join(args.bids_dir, "sub-%s"%subject_label, "anat",
"*_T2w.nii*"))
"*%s_T2w.nii*"%acq_t2))
FLAIRs = glob(os.path.join(args.bids_dir, "sub-%s"%subject_label, "anat",
"*_FLAIR.nii*"))
"*%s_FLAIR.nii*"%acq_t2))
if args.refine_pial == "T2":
for T2 in T2s:
if max(nibabel.load(T2).header.get_zooms()) < 1.2:
Expand Down

0 comments on commit 230da75

Please sign in to comment.