Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added optional argument 'subjects_dir' to project_volume_data #304

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion surfer/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def read_stc(filepath):
def project_volume_data(filepath, hemi, reg_file=None, subject_id=None,
projmeth="frac", projsum="avg", projarg=[0, 1, .1],
surf="white", smooth_fwhm=3, mask_label=None,
target_subject=None, verbose=None):
target_subject=None, subjects_dir=None, verbose=None):
"""Sample MRI volume onto cortical manifold.

Note: this requires Freesurfer to be installed with correct
Expand Down Expand Up @@ -168,6 +168,10 @@ def project_volume_data(filepath, hemi, reg_file=None, subject_id=None,
Path to label file to constrain projection; otherwise uses cortex
target_subject : string
Subject to warp data to in surface space after projection
subjects_dir : string | None
If not None, this directory will be used as the subjects directory
instead of the value set using the SUBJECTS_DIR environment
variable.
verbose : bool, str, int, or None
If not None, override default verbose level (see surfer.verbose).
"""
Expand Down Expand Up @@ -225,6 +229,8 @@ def project_volume_data(filepath, hemi, reg_file=None, subject_id=None,
cmd_list.extend(["--mask", mask_label])
if target_subject is not None:
cmd_list.extend(["--trgsubject", target_subject])
if subjects_dir is not None:
cmd_list.extend(["--sd", subjects_dir])

# Execute the command
out_file = mktemp(prefix="pysurfer-v2s", suffix='.mgz')
Expand Down