本文整理汇总了Python中pyhrf.FmriData.from_surf_ui方法的典型用法代码示例。如果您正苦于以下问题:Python FmriData.from_surf_ui方法的具体用法?Python FmriData.from_surf_ui怎么用?Python FmriData.from_surf_ui使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyhrf.FmriData
的用法示例。
在下文中一共展示了FmriData.from_surf_ui方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setDummyInputData
# 需要导入模块: from pyhrf import FmriData [as 别名]
# 或者: from pyhrf.FmriData import from_surf_ui [as 别名]
def setDummyInputData(self, xmlFile):
f = open(xmlFile, 'r')
xml = f.read()
t = xmlio.from_xml(xml)
if t.data.data_type == 'volume':
dataFn = pyhrf.get_data_file_name('dummySmallBOLD.nii.gz')
maskFn = pyhrf.get_data_file_name('dummySmallMask.nii.gz')
sd = FMRISessionVolumicData(bold_file=dataFn)
t.set_init_param('fmri_data',
FmriData.from_vol_ui(mask_file=maskFn,
sessions_data=[sd]))
elif t.data.data_type == 'surface':
fn = 'real_data_surf_tiny_bold.gii'
dataFn = pyhrf.get_data_file_name(fn)
fn = 'real_data_surf_tiny_parcellation.gii'
maskFn = pyhrf.get_data_file_name(fn)
fn = 'real_data_surf_tiny_mesh.gii'
meshFn = pyhrf.get_data_file_name(fn)
sd = FMRISessionSurfacicData(bold_file=dataFn)
t.set_init_param('fmri_data',
FmriData.from_surf_ui(mask_file=maskFn,
mesh_file=meshFn,
sessions_data=[sd]))
else:
raise Exception('Unsupported class ... todo')
f = open(xmlFile, 'w')
f.write(xmlio.to_xml(t))
f.close()
示例2: setDummyInputData
# 需要导入模块: from pyhrf import FmriData [as 别名]
# 或者: from pyhrf.FmriData import from_surf_ui [as 别名]
def setDummyInputData(self, xmlFile):
f = open(xmlFile, "r")
xml = f.read()
t = xmlio.fromXML(xml)
if t.data.data_type == "volume":
dataFn = pyhrf.get_data_file_name("dummySmallBOLD.nii.gz")
maskFn = pyhrf.get_data_file_name("dummySmallMask.nii.gz")
sd = FMRISessionVolumicData(bold_file=dataFn)
t.set_init_param("fmri_data", FmriData.from_vol_ui(mask_file=maskFn, sessions_data=[sd]))
elif t.data.data_type == "surface":
fn = "real_data_surf_tiny_bold.gii"
dataFn = pyhrf.get_data_file_name(fn)
fn = "real_data_surf_tiny_parcellation.gii"
maskFn = pyhrf.get_data_file_name(fn)
fn = "real_data_surf_tiny_mesh.gii"
meshFn = pyhrf.get_data_file_name(fn)
sd = FMRISessionSurfacicData(bold_file=dataFn)
t.set_init_param("fmri_data", FmriData.from_surf_ui(mask_file=maskFn, mesh_file=meshFn, sessions_data=[sd]))
else:
raise Exception("Unsupported class ... todo")
f = open(xmlFile, "w")
f.write(xmlio.toXML(t, handler=NumpyXMLHandler()))
f.close()