Skip to content

Commit

Permalink
fix node selection issue in dense area with hidden neurons
Browse files Browse the repository at this point in the history
  • Loading branch information
olbris committed Mar 11, 2024
1 parent 801f3d2 commit 2c462d9
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -698,16 +698,20 @@ public void moveHoverCursor(Point screenPoint) {
if (bSearchMultipleAnchors) {
// Skip hidden neurons

List<TmGeoAnnotation> nearestVertexes = spatialManager.getAnchorClosestToMicronLocation(loc, 3);
List<TmGeoAnnotation> nearestVertexes = spatialManager.getAnchorClosestToMicronLocation(loc, 20);
float minDistSquared = Float.MAX_VALUE;
for (TmGeoAnnotation v : nearestVertexes) {
if (v == null)
continue;
TmNeuronMetadata neuron = NeuronManager.getInstance().getNeuronFromNeuronID(v.getNeuronId());
if (neuron == null)
continue;
if (!neuron.isVisible() || TmModelManager.getInstance().getCurrentView().isNonInteractable(neuron.getId())) {
// log.info("skipping invisible neuron");
if (TmModelManager.getInstance().getCurrentView().isHidden(neuron.getId())) {
// log.info("skipping hidden neuron");
continue;
}
if (TmModelManager.getInstance().getCurrentView().isNonInteractable(neuron.getId())) {
// log.info("skipping non-interactable neuron");
continue;
}
float[] location = TmModelManager.getInstance().getLocationInMicrometers(v.getX(),
Expand All @@ -729,12 +733,6 @@ public void moveHoverCursor(Point screenPoint) {
FrameworkAccess.handleException(e);
log.warn("Workspace does not support spatial queries. Falling back on old Horta spatial index.");
}
if (nearestVertex != null) {
neuronModel = NeuronManager.getInstance().getNeuronFromNeuronID(nearestVertex.getNeuronId());
if (TmModelManager.getInstance().getCurrentView().isHidden(neuronModel.getId())) {
nearestVertex = null;
}
}
}
else {
log.error("No default workspace found");
Expand All @@ -743,6 +741,7 @@ public void moveHoverCursor(Point screenPoint) {
if (nearestVertex == null) // no vertices to be found?
foundGoodHighlightVertex = false;
else {
neuronModel = NeuronManager.getInstance().getNeuronFromNeuronID(nearestVertex.getNeuronId());
if (neuronModel == null) {
// TODO: Should not happen
log.warn("Unexpected null neuron");
Expand Down

0 comments on commit 2c462d9

Please sign in to comment.