本文整理汇总了Python中nipype.interfaces.fsl.Info.output_type方法的典型用法代码示例。如果您正苦于以下问题:Python Info.output_type方法的具体用法?Python Info.output_type怎么用?Python Info.output_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nipype.interfaces.fsl.Info
的用法示例。
在下文中一共展示了Info.output_type方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_flirt
# 需要导入模块: from nipype.interfaces.fsl import Info [as 别名]
# 或者: from nipype.interfaces.fsl.Info import output_type [as 别名]
def setup_flirt(tmpdir):
ext = Info.output_type_to_ext(Info.output_type())
infile = tmpdir.join("infile"+ext)
infile.open("w")
reffile = tmpdir.join("reffile"+ext)
reffile.open("w")
return (tmpdir, infile.strpath, reffile.strpath)
示例2: setup_infile
# 需要导入模块: from nipype.interfaces.fsl import Info [as 别名]
# 或者: from nipype.interfaces.fsl.Info import output_type [as 别名]
def setup_infile():
global tmp_infile, tmp_dir
ext = Info.output_type_to_ext(Info.output_type())
tmp_dir = tempfile.mkdtemp()
tmp_infile = os.path.join(tmp_dir, 'foo' + ext)
file(tmp_infile, 'w')
return tmp_infile, tmp_dir
示例3: setup_infile
# 需要导入模块: from nipype.interfaces.fsl import Info [as 别名]
# 或者: from nipype.interfaces.fsl.Info import output_type [as 别名]
def setup_infile():
global tmp_infile, tmp_dir
ext = Info.output_type_to_ext(Info.output_type())
tmp_dir = tempfile.mkdtemp()
tmp_infile = os.path.join(tmp_dir, "foo" + ext)
open(tmp_infile, "w")
return tmp_infile, tmp_dir
示例4: setup_infile
# 需要导入模块: from nipype.interfaces.fsl import Info [as 别名]
# 或者: from nipype.interfaces.fsl.Info import output_type [as 别名]
def setup_infile(tmpdir):
ext = Info.output_type_to_ext(Info.output_type())
tmp_dir = str(tmpdir)
tmp_infile = os.path.join(tmp_dir, 'foo' + ext)
open(tmp_infile, 'w')
return (tmp_infile, tmp_dir)
示例5: setup_flirt
# 需要导入模块: from nipype.interfaces.fsl import Info [as 别名]
# 或者: from nipype.interfaces.fsl.Info import output_type [as 别名]
def setup_flirt(tmpdir):
ext = Info.output_type_to_ext(Info.output_type())
tmp_dir = str(tmpdir)
_, infile = tempfile.mkstemp(suffix=ext, dir=tmp_dir)
_, reffile = tempfile.mkstemp(suffix=ext, dir=tmp_dir)
return (tmp_dir, infile, reffile)
示例6: setup_infile
# 需要导入模块: from nipype.interfaces.fsl import Info [as 别名]
# 或者: from nipype.interfaces.fsl.Info import output_type [as 别名]
def setup_infile():
global tmp_infile, tmp_dir, cwd
cwd = os.getcwd()
ext = Info.output_type_to_ext(Info.output_type())
tmp_dir = tempfile.mkdtemp()
tmp_infile = os.path.join(tmp_dir, 'foo' + ext)
open(tmp_infile, 'w')
os.chdir(tmp_dir)
return tmp_infile, tmp_dir
示例7: set_output_type
# 需要导入模块: from nipype.interfaces.fsl import Info [as 别名]
# 或者: from nipype.interfaces.fsl.Info import output_type [as 别名]
def set_output_type(fsl_output_type):
prev_output_type = os.environ.get('FSLOUTPUTTYPE', None)
if fsl_output_type is not None:
os.environ['FSLOUTPUTTYPE'] = fsl_output_type
elif 'FSLOUTPUTTYPE' in os.environ:
del os.environ['FSLOUTPUTTYPE']
FSLCommand.set_default_output_type(Info.output_type())
return prev_output_type
示例8: create_files_in_directory_plus_output_type
# 需要导入模块: from nipype.interfaces.fsl import Info [as 别名]
# 或者: from nipype.interfaces.fsl.Info import output_type [as 别名]
def create_files_in_directory_plus_output_type(request, tmpdir):
func_prev_type = set_output_type(request.param)
origdir = tmpdir.chdir()
filelist = ['a.nii', 'b.nii']
nifti_image_files(tmpdir.strpath, filelist, shape=(3,3,3,4))
out_ext = Info.output_type_to_ext(Info.output_type())
def fin():
set_output_type(func_prev_type)
origdir.chdir()
request.addfinalizer(fin)
return (filelist, tmpdir.strpath, out_ext)
示例9: create_files_in_directory
# 需要导入模块: from nipype.interfaces.fsl import Info [as 别名]
# 或者: from nipype.interfaces.fsl.Info import output_type [as 别名]
def create_files_in_directory():
testdir = os.path.realpath(mkdtemp())
origdir = os.getcwd()
os.chdir(testdir)
filelist = ['a.nii', 'b.nii']
for f in filelist:
hdr = nb.Nifti1Header()
shape = (3, 3, 3, 4)
hdr.set_data_shape(shape)
img = np.random.random(shape)
nb.save(nb.Nifti1Image(img, np.eye(4), hdr),
os.path.join(testdir, f))
out_ext = Info.output_type_to_ext(Info.output_type())
return filelist, testdir, origdir, out_ext
示例10: setup_infile
# 需要导入模块: from nipype.interfaces.fsl import Info [as 别名]
# 或者: from nipype.interfaces.fsl.Info import output_type [as 别名]
def setup_infile(tmpdir):
ext = Info.output_type_to_ext(Info.output_type())
tmp_infile = tmpdir.join('foo' + ext)
tmp_infile.open("w")
return (tmp_infile.strpath, tmpdir.strpath)