def _make_graph_edges_3d(n_x, n_y, n_z):
 vertices = np.arange(((n_x * n_y) * n_z)).reshape((n_x, n_y, n_z))
 edges_deep = np.vstack((vertices[:, :, :(-1)].ravel(), vertices[:, :, 1:].ravel()))
 edges_right = np.vstack((vertices[:, :(-1)].ravel(), vertices[:, 1:].ravel()))
 edges_down = np.vstack((vertices[:(-1)].ravel(), vertices[1:].ravel()))
 edges = np.hstack((edges_deep, edges_right, edges_down))
 return edges

def _make_graph_edges_3d ( n_x , n_y , n_z ) : vertices = np . arange ( ( ( n_x * n_y ) * n_z ) ) . reshape ( ( n_x , n_y , n_z ) ) edges_deep = np . vstack ( ( vertices [ : , : , : ( - 1 ) ] . ravel ( ) , vertices [ : , : , 1 : ] . ravel ( ) ) ) edges_right = np . vstack ( ( vertices [ : , : ( - 1 ) ] . ravel ( ) , vertices [ : , 1 : ] . ravel ( ) ) ) edges_down = np . vstack ( ( vertices [ : ( - 1 ) ] . ravel ( ) , vertices [ 1 : ] . ravel ( ) ) ) edges = np . hstack ( ( edges_deep , edges_right , edges_down ) ) return edges
returns a list of edges for a 3d image .