Dear Nest Team,
working with Python 3.8 and Nest 3.2 my goal is, after creating a spatial NodeCollection "neurons", to create a new NodeCollection containing a selection of the node from "neurons".
To achieve this I tried two different approaches:
1. Create a Mask object and use nest.SelectNodesByMask()
nodes_in_mask = nest.SelectNodesByMask(neurons, ctr_position, mask_obj)
2. Transform the NodeCollection into a list of node ids, pick 3 random ids, and create a new NodeCollection containing those 3 Nodes
neurons_list = neurons.tolist()
for x in range(0, 3):
center = random.choice(neurons_list)
node_ids.append(center)
node_ids.sort()
new_collection = nest.NodeCollection(node_ids)
But with both approaches I get the same problems that some Information (of the positions) seems to go missing. This shows in different ways.
First the new NodeCollections are no longer spatial (nodes_in_mask.spatial and new_collection.spatial return none).
Second trying to get the node Positions results in an Error:
nest.GetPosition(nodes_in_mask)
-> Error #1 nest.lib.hl_api_exceptions.LayerExpected: LayerExpected in SLI function GetPosition_g:
And last, trying to Plot the Layer also results in an Error:
fig = nest.PlotLayer(nodes_in_mask)
-> Error #2 TypeError: 'NoneType' object is not subscriptable
I attached a .txt file containing py code showing the problems.
Why do those Problems occur and what can I do to solve them?
Is there a way to create an empty NodeCollection s.t. I can add the wished nodes one by one?
What exactly does the metadata of a Nodecollection represent? Is there a way to set it manually for example to spatial?
Thank you in advance for your Answers,
Miriam