#!/usr/bin/env python # -*- coding: latin-1 -*- # # long_mris_slopes # # script to fit within-subject slopes into longitudinal data # # Original Author: Martin Reuter # CVS Revision Info: # $Author: mreuter $ # $Date: 2012/05/30 22:57:25 $ # $Revision: 1.38 $ # # Copyright © 2011 The General Hospital Corporation (Boston, MA) "MGH" # # Terms and conditions for use, reproduction, distribution and contribution # are found in the 'FreeSurfer Software License Agreement' contained # in the file 'LICENSE' found in the FreeSurfer distribution, and here: # # https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSoftwareLicense # # Reporting: freesurfer@nmr.mgh.harvard.edu # # import warnings warnings.filterwarnings('ignore', '.*negative int.*') import os import sys import shlex import optparse import logging import subprocess import tempfile import shutil from subject_info import * from LongQdecTable import * # logging ch = logging.StreamHandler() #create logger slopelogger = logging.getLogger("long_mris_slopes") slopelogger.setLevel(logging.INFO) slopelogger.addHandler(ch) ARGTEXT = """ REQUIRED ARGUMENTS --qdec qdec.table.dat file with first columns: fsid fsid-base --meas Input curv file, e.g. thickness (except if only --do-label) --hemi ?h Hemisphere (lh or rh) One or more of the following: --do-avg Compute and output the temporal average (recommended) --do-rate Compute and output the rate (recommended) --do-pc1fit Compute and output the pct. change (w.r.t. tp1 computed from line fit) --do-pc1 Compute and output the pct. change (w.r.t. tp1) --do-spc Compute and output the sym. pct. change (w.r.t. temp. average) (recommended) --do-label Compute and output intersected cortex label (recommended) OPTIONAL ARGUMENTS --do-stack Save the stacked within subject file (time series) (recommended) --fwhm Smooth the data (recommended for percent change maps) --nosmooth Do not smooth (to overwrite smoothing requirement for pc1 or spc) --time Variable name of time variable (e.g. age) --in-label Use pre-existing label for smoothing (default: intersect cortex labels) --qcache Create cache for qdec (resample to subject , e.g. fsaverage, and smooth at differnt levels) To manually specify the subject specific output in