This pipeline is a step by step pipeline
%pylab inline
from matplotlib import pyplot as plt
from IPython.display import Image
Populating the interactive namespace from numpy and matplotlib
from rhizoscan import get_data_path
from rhizoscan.root.pipeline import load_image, detect_petri_plate, compute_graph, compute_tree
from rhizoscan.root.pipeline.arabidopsis import segment_image, detect_leaves
from rhizoscan.root.graph.mtg import tree_to_mtg
image_filename = get_data_path('pipeline/arabido.png')
Image(image_filename)
image = load_image(image_filename)
imshow(image)
<matplotlib.image.AxesImage at 0x7f7e6a29a150>
pmask, px_scale, hull = detect_petri_plate(image,border_width=25, plate_size=120, fg_smooth=1)
imshow(pmask)
<matplotlib.image.AxesImage at 0x7f7e68a0b590>
rmask, bbox = segment_image(image,pmask,root_max_radius=5)
imshow(rmask)
<matplotlib.image.AxesImage at 0x7f7e6816dcd0>
seed_map = detect_leaves(rmask, image, bbox, plant_number=2, leaf_bbox=[0,0,1,.4])
#imshow(seed_map)
imshow(seed_map+rmask)
<matplotlib.image.AxesImage at 0x7f7e5968cc90>
graph = compute_graph(rmask,seed_map,bbox)
graph.plot(linewidth=4)
tree = compute_tree(graph, px_scale=px_scale)
tree.plot(linewidth=4)
/home/artzet_s/PycharmProjects/Rhizo/rhizoscan/src/rhizoscan/root/graph/nsa.py:307: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison elif ids=='auto': self.setdefault('id',_np.arange(self.number())) /home/artzet_s/PycharmProjects/Rhizo/rhizoscan/src/rhizoscan/root/graph/__init__.py:196: RuntimeWarning: divide by zero encountered in divide shifty = _np.arange(len(axe_node))/ms % (2*ms+1) - ms
g = rsa = tree_to_mtg(tree)
g.display()
MTG : nb_vertices=54, nb_scales=4 /P (id=1) ^/A (id=3) ^/S (id=4) ^<S (id=5) ^<S (id=6) +A (id=38) ^/S (id=39) ^<S (id=40) ^<S (id=41) ^<S (id=7) ^<S (id=8) +A (id=42) ^/S (id=43) ^<S (id=44) ^<S (id=45) ^<S (id=9) ^<S (id=10) ^<S (id=11) ^<S (id=12) +A (id=50) ^/S (id=51) ^<S (id=52) ^<S (id=53) ^<S (id=13) ^<S (id=14) ^<S (id=15) /P (id=2) ^/A (id=16) ^/S (id=17) ^<S (id=18) ^<S (id=19) ^<S (id=20) ^<S (id=21) +A (id=31) ^/S (id=32) ^<S (id=33) ^<S (id=34) ^<S (id=35) ^<S (id=36) ^<S (id=37) ^<S (id=22) ^<S (id=23) ^<S (id=24) +A (id=46) ^/S (id=47) ^<S (id=48) ^<S (id=49) ^<S (id=25) ^<S (id=26) ^<S (id=27) ^<S (id=28) ^<S (id=29) ^<S (id=30)