Example #1
0
 def test_ver_tree(self):
     s = self.session
     t1 = pytreestb.sample_tree()
     assert isinstance(t1, pytreestb.Tree)
     assert pytreestb.IO.ver_tree(t1)
     t1.dA = scipy.sparse.csc_matrix((10,10))
     assert pytreestb.IO.ver_tree(t1)==False
Example #2
0
 def test_tree_to_matlab(self):
     s = self.session
     t1 = pytreestb.sample_tree()
     # put (to_matlab)
     s.s = t1
     # get (converter to Tree)
     t2 = s.s
     assert isinstance(t1, pytreestb.Tree)
     assert isinstance(t2, pytreestb.Tree)
     assert t1==t2
Example #3
0
 def test_resample(self):
     s = pytreestb.sample_tree()
Example #4
0
 def test_converters(self):
     s = self.session
     tree = pytreestb.sample_tree()
     assert isinstance(tree, pytreestb.Tree)
import pytreestb
from pytreestb.edit import resample_tree
from pytreestb.IO import ver_tree
from pytreestb.graphical import plot_tree
from pytreestb.graphtheory import BO_tree

# MATLAB session
M = pytreestb._session


t1 = pytreestb.sample_tree()
assert isinstance(t1,pytreestb.Tree)
assert ver_tree(t1)
t2 = resample_tree(t1,10)
assert isinstance(t2,pytreestb.Tree)
assert ver_tree(t2)

# Fig 1
M.figure()
plot_tree(t1, BO_tree(t1))
M.title('original')
M.shine()
M.colorbar()

# Fig 2 - resampled
M.figure()
plot_tree(t2, BO_tree(t2))
M.title('resampled - 10um')
M.shine()
M.colorbar()
Example #6
0
import pytreestb
from pytreestb.edit import resample_tree
from pytreestb.IO import ver_tree
from pytreestb.graphical import plot_tree
from pytreestb.graphtheory import BO_tree

# MATLAB session
M = pytreestb._session

t1 = pytreestb.sample_tree()
assert isinstance(t1, pytreestb.Tree)
assert ver_tree(t1)
t2 = resample_tree(t1, 10)
assert isinstance(t2, pytreestb.Tree)
assert ver_tree(t2)

# Fig 1
M.figure()
plot_tree(t1, BO_tree(t1))
M.title('original')
M.shine()
M.colorbar()

# Fig 2 - resampled
M.figure()
plot_tree(t2, BO_tree(t2))
M.title('resampled - 10um')
M.shine()
M.colorbar()