本文整理汇总了Python中dipy.io.dpy.Dpy.version方法的典型用法代码示例。如果您正苦于以下问题:Python Dpy.version方法的具体用法?Python Dpy.version怎么用?Python Dpy.version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dipy.io.dpy.Dpy
的用法示例。
在下文中一共展示了Dpy.version方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_dpy
# 需要导入模块: from dipy.io.dpy import Dpy [as 别名]
# 或者: from dipy.io.dpy.Dpy import version [as 别名]
def test_dpy():
fd,fname = mkstemp()
dpw = Dpy(fname,'w')
A=np.ones((5,3))
B=2*A.copy()
C=3*A.copy()
dpw.write_track(A)
dpw.write_track(B)
dpw.write_track(C)
dpw.write_tracks([C,B,A])
dpw.close()
dpr = Dpy(fname,'r')
assert_equal(dpr.version()=='0.0.1',True)
T=dpr.read_tracksi([0,1,2,0,0,2])
print(T)
T2=dpr.read_tracks()
assert_equal(len(T2),6)
dpr.close()
assert_array_equal(A,T[0])
assert_array_equal(C,T[5])
os.remove(fname)
示例2: test_dpy
# 需要导入模块: from dipy.io.dpy import Dpy [as 别名]
# 或者: from dipy.io.dpy.Dpy import version [as 别名]
def test_dpy():
fname = 'test.bin'
with InTemporaryDirectory():
dpw = Dpy(fname, 'w')
A = np.ones((5, 3))
B = 2 * A.copy()
C = 3 * A.copy()
dpw.write_track(A)
dpw.write_track(B)
dpw.write_track(C)
dpw.write_tracks([C, B, A])
dpw.close()
dpr = Dpy(fname, 'r')
assert_equal(dpr.version() == '0.0.1', True)
T = dpr.read_tracksi([0, 1, 2, 0, 0, 2])
T2 = dpr.read_tracks()
assert_equal(len(T2), 6)
dpr.close()
assert_array_equal(A, T[0])
assert_array_equal(C, T[5])
示例3: test_dpy
# 需要导入模块: from dipy.io.dpy import Dpy [as 别名]
# 或者: from dipy.io.dpy.Dpy import version [as 别名]
def test_dpy():
fname = 'test.bin'
with InTemporaryDirectory():
dpw = Dpy(fname, 'w')
A = np.ones((5, 3))
B = 2 * A.copy()
C = 3 * A.copy()
dpw.write_track(A)
dpw.write_track(B)
dpw.write_track(C)
dpw.write_tracks(Streamlines([C, B, A]))
all_tracks = np.ascontiguousarray(np.vstack([A, B, C, C, B, A]))
npt.assert_array_equal(all_tracks, dpw.tracks[:])
dpw.close()
dpr = Dpy(fname, 'r')
npt.assert_equal(dpr.version() == u'0.0.1', True)
T = dpr.read_tracksi([0, 1, 2, 0, 0, 2])
T2 = dpr.read_tracks()
npt.assert_equal(len(T2), 6)
dpr.close()
npt.assert_array_equal(A, T[0])
npt.assert_array_equal(C, T[5])