Exemplo n.º 1
0
 def test_assign_name_to_nodes(self):
     G1 = simple_weighted_graph()
     mkg.assign_node_names(G1, ['a', 'b', 'c'])
     assert nx.is_isomorphic(
         G1,
         self.Gname,
         edge_match=em(),
         node_match=nm(exclude=['centroids', 'y', 'x', 'z']))
Exemplo n.º 2
0
    def set_parcellation(self, parcellation):
        '''
        Modify nodal attribute "name" for nodes of `G` inplace.

        Parameters
        ----------
        G : :class:`networkx.Graph`
        parcellation : list
            ``parcellation[i]`` is the name of node ``i`` in ``G``

        See Also
        --------
        :func:`assign_node_names`
        :func:`BrainNetwork.set_centroids`
        '''
        assign_node_names(self, parcellation)
Exemplo n.º 3
0
def simple_anatomical_graph():
    G = simple_weighted_graph()
    mkg.assign_node_centroids(G, [(1, 0, 0), (0, 1, 0), (0, 0, 1)])
    mkg.assign_node_names(G, ['a', 'b', 'c'])
    return G