示例#1
0
文件: spm.py 项目: ahebrank/pna-utils
def run_jobdef(jobdef):
    script = """
load pyjobs;
spm_jobman('run', jobs);
"""
    # Need initcfg for SPM8
    if spm_info.spm_ver != 'SPM5':
        script = "spm_jobman('initcfg');\n" + script
    with InTemporaryDirectory():
        savemat('pyjobs.mat', jobdef, oned_as='row')
        run_matlab_script(script)
示例#2
0
文件: spm.py 项目: ahebrank/pna-utils
    def _set_properties(self):
        with InTemporaryDirectory():
            run_matlab_script(r"""
spm_path = spm('dir');
spm_ver = spm('ver');
fid = fopen('spm_stuff.txt', 'wt');
fprintf(fid, '%s\n', spm_path);
fprintf(fid, '%s\n', spm_ver);
fclose(fid);
""")
            with open('spm_stuff.txt', 'rt') as fobj:
                lines = fobj.readlines()
        self._spm_path = lines[0].strip()
        self._spm_ver = lines[1].strip()