本文整理匯總了Python中nipype.interfaces.matlab.MatlabCommand.set_default_paths方法的典型用法代碼示例。如果您正苦於以下問題:Python MatlabCommand.set_default_paths方法的具體用法?Python MatlabCommand.set_default_paths怎麽用?Python MatlabCommand.set_default_paths使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nipype.interfaces.matlab.MatlabCommand
的用法示例。
在下文中一共展示了MatlabCommand.set_default_paths方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: import
# 需要導入模塊: from nipype.interfaces.matlab import MatlabCommand [as 別名]
# 或者: from nipype.interfaces.matlab.MatlabCommand import set_default_paths [as 別名]
from os.path import join as opj
from nipype.interfaces.afni import Despike
from nipype.interfaces.freesurfer import (BBRegister, ApplyVolTransform,
Binarize, MRIConvert, FSCommand)
from nipype.interfaces.spm import (SliceTiming, Realign, Smooth, Level1Design,
EstimateModel, EstimateContrast)
from nipype.interfaces.utility import Function, IdentityInterface
from nipype.interfaces.io import FreeSurferSource, SelectFiles, DataSink
from nipype.algorithms.rapidart import ArtifactDetect
from nipype.algorithms.misc import TSNR, Gunzip
from nipype.algorithms.modelgen import SpecifySPMModel
from nipype.pipeline.engine import Workflow, Node, MapNode
# MATLAB - Specify path to current SPM and the MATLAB's default mode
from nipype.interfaces.matlab import MatlabCommand
MatlabCommand.set_default_paths('/usr/local/MATLAB/R2014a/toolbox/spm12')
MatlabCommand.set_default_matlab_cmd("matlab -nodesktop -nosplash")
# FreeSurfer - Specify the location of the freesurfer folder
fs_dir = '~/nipype_tutorial/freesurfer'
FSCommand.set_default_subjects_dir(fs_dir)
###
# Specify variables
experiment_dir = '~/nipype_tutorial' # location of experiment folder
subject_list = ['sub001', 'sub002', 'sub003',
'sub004', 'sub005', 'sub006',
'sub007', 'sub008', 'sub009',
'sub010'] # list of subject identifiers
output_dir = 'output_fMRI_example_1st' # name of 1st-level output folder
示例2:
# 需要導入模塊: from nipype.interfaces.matlab import MatlabCommand [as 別名]
# 或者: from nipype.interfaces.matlab.MatlabCommand import set_default_paths [as 別名]
from nipype.interfaces.fsl.epi import ApplyTOPUP, TOPUP
from nipype.interfaces.freesurfer import Resample, Binarize, MRIConvert
from nipype.algorithms.confounds import CompCor
from nipype.interfaces.afni.preprocess import Bandpass
from nipype.interfaces.afni.utils import AFNItoNIFTI
from nipype.interfaces.ants import ApplyTransforms, Registration
from nipype.algorithms.misc import Gunzip
from pandas import DataFrame, Series
#set output file type for FSL to NIFTI
from nipype.interfaces.fsl.preprocess import FSLCommand
FSLCommand.set_default_output_type('NIFTI')
# MATLAB setup - Specify path to current SPM and the MATLAB's default mode
from nipype.interfaces.matlab import MatlabCommand
MatlabCommand.set_default_paths('~/spm12')
MatlabCommand.set_default_matlab_cmd("matlab -nodesktop -nosplash")
# Set study variables
setup='sherlock'
sample='6mo' #6mo or newborn
sequence='spiral'#spiral or mux6
if setup=='sherlock':
studyhome = '/oak/stanford/groups/iang/BABIES_data/BABIES_rest'
raw_data = studyhome + '/subjDir/all'
output_dir = studyhome + '/processed/preproc'
workflow_dir = studyhome + '/workflows'
elif setup=='Cat':
studyhome = '/Users/catcamacho/Box/SNAP/BABIES/BABIES_rest'
raw_data = studyhome + '/rest_raw'
示例3: display_crash_files
# 需要導入模塊: from nipype.interfaces.matlab import MatlabCommand [as 別名]
# 或者: from nipype.interfaces.matlab.MatlabCommand import set_default_paths [as 別名]
import os
import socket
from nipype.interfaces.matlab import MatlabCommand
if socket.gethostname() == 'malin':
os.environ['MATLABCMD'] = "/opt/matlab/R2015b/bin/matlab -nodesktop -nosplash"
MatlabCommand.set_default_paths('/opt/matlab/R2015b/toolbox/spm12')
MatlabCommand.set_default_matlab_cmd("/opt/matlab/R2015b/bin/matlab -nodesktop -nosplash")
TPM = '/opt/matlab/R2015b/toolbox/spm12/tpm/TPM.nii'
# os.environ['MATLABCMD'] = "/opt/matlab/R2012a/bin/matlab -nodesktop -nosplash"
# MatlabCommand.set_default_paths('/opt/matlab/R2012a/toolbox/spm12')
# MatlabCommand.set_default_matlab_cmd("/opt/matlab/R2012a/bin/matlab -nodesktop -nosplash")
elif socket.gethostname() == 'cala':
os.environ['MATLABCMD'] = "/opt/matlab/64bit/R2015a/bin/matlab -nodesktop -nosplash"
MatlabCommand.set_default_paths('/opt/matlab/64bit/R2015a/toolbox/spm12')
MatlabCommand.set_default_matlab_cmd("/opt/matlab/64bit/R2015a/bin/matlab -nodesktop -nosplash")
TPM = '/opt/matlab/64bit/R2015a/toolbox/spm12/tpm/TPM.nii'
def display_crash_files(crashfile, rerun=False):
from nipype.utils.filemanip import loadcrash
crash_data = loadcrash(crashfile)
node = crash_data['node']
tb = crash_data['traceback']
print("\n")
print("File: %s"%crashfile)
print("Node: %s"%node)
if node.base_dir:
print("Working directory: %s" % node.output_dir())
else:
print("Node crashed before execution")
print("\n")