def project_active_cells_distal(tsframe, T03):
    points = np.empty([0, 3])
    for y in range(13):
        for x in range(6):
            if (tsframe[y, x] > 0.0):
                vertex = DH.get_xyz_distal(x, y, T03)
                points = np.vstack((points, vertex))
    return points
def project_active_cells_distal(tsframe, T03):
    points = np.empty([0,3])
    for y in range(13):
        for x in range(6):
            if(tsframe[y,x] > 0.0):
                vertex = DH.get_xyz_distal(x, y, T03)
                points = np.vstack((points, vertex))
    return points   
def plot_cells_distal(ax, tsframe, T03, scalarMap):
    span = 0.5
    for y in range(13):
        for x in range(6):
            vertex = np.empty([4,3])
            vertex[0,:] = DH.get_xyz_distal(x-span, y+span, T03)
            vertex[1,:] = DH.get_xyz_distal(x+span, y+span, T03)
            vertex[2,:] = DH.get_xyz_distal(x+span, y-span, T03)
            vertex[3,:] = DH.get_xyz_distal(x-span, y-span, T03)
            quad = Axes3d.art3d.Poly3DCollection([vertex])

            color = scalarMap.to_rgba(tsframe[y,x])              
            
            if(tsframe[y,x] > 0.0):
                quad.set_color([color[0], color[1], color[2], 1.0]) # Active cell
            else:
                quad.set_color([0.0, 0.0, 0.0, 1.0])
                
            quad.set_edgecolor([0.3, 0.3, 0.3, 1.0])
            ax.add_collection3d(quad)
def plot_cells_distal(ax, tsframe, T03, scalarMap):
    span = 0.5
    for y in range(13):
        for x in range(6):
            vertex = np.empty([4, 3])
            vertex[0, :] = DH.get_xyz_distal(x - span, y + span, T03)
            vertex[1, :] = DH.get_xyz_distal(x + span, y + span, T03)
            vertex[2, :] = DH.get_xyz_distal(x + span, y - span, T03)
            vertex[3, :] = DH.get_xyz_distal(x - span, y - span, T03)
            quad = Axes3d.art3d.Poly3DCollection([vertex])

            color = scalarMap.to_rgba(tsframe[y, x])

            if (tsframe[y, x] > 0.0):
                quad.set_color([color[0], color[1], color[2],
                                1.0])  # Active cell
            else:
                quad.set_color([0.0, 0.0, 0.0, 1.0])

            quad.set_edgecolor([0.3, 0.3, 0.3, 1.0])
            ax.add_collection3d(quad)