A view of a ConnectomeDataset
specifying subsets of cells (or lists of cells) as NodeSet
s, e.g. can be used to just show the connections between the pharyngeal neurons in a whole connectome dataset, or to group the sensory neurons, interneuron, etc. together.
Source code in cect/ConnectomeView.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127 | class View:
"""A view of a ``ConnectomeDataset`` specifying subsets of cells (or lists of cells) as ``NodeSet``s, e.g. can be used to just show the connections between the pharyngeal neurons in a whole connectome dataset, or to group the sensory neurons, interneuron, etc. together."""
def __init__(
self,
id,
name,
description,
node_sets,
synclass_sets={},
colormap=DEFAULT_COLORMAP,
only_show_existing_nodes=False,
):
self.id = id
self.name = name
self.description = description
self.node_sets = node_sets
self.synclass_sets = synclass_sets
self.colormap = colormap
self.only_show_existing_nodes = only_show_existing_nodes
def __repr__(self):
info = "ConnectomeView: %s (%s)" % (
self.name,
self.id,
)
if self.description is not None:
info += "\n %s" % self.description
for n in self.node_sets:
info += "\n %s" % n
return info
def has_color(self):
for ns in self.node_sets:
if ns.color is not None:
return True
return False
def has_multicell_nodes(self):
for ns in self.node_sets:
if not ns.is_one_cell():
return True
return False
def get_node_set(self, node_set_name):
for ns in self.node_sets:
if ns.name == node_set_name:
return ns
return None
def get_index_of_cell(self, cell):
for i in range(len(self.node_sets)):
if cell in self.node_sets[i].cells:
return i
return -1
|