Display two neurons with segments in the query coloured by similarity
Source:R/similarity.r
show_similarity.Rd
By default, the query neuron will be drawn with its segments shaded from red to blue, with red indicating a poor match to the target segments, and blue a good match.
Usage
show_similarity(
query,
target,
smat = NULL,
cols = colorRampPalette(c("red", "yellow", "cyan", "navy")),
col = "black",
AbsoluteScale = FALSE,
PlotVectors = TRUE,
...
)
Arguments
- query
a neuron to compare and colour.
- target
the neuron to compare against.
- smat
a score matrix (if
NULL
, defaults tosmat.fcwb
).- cols
the function to use to colour the segments (e.g.
heat.colors
).- col
the colour with which to draw the target neuron.
- AbsoluteScale
logical indicating whether the colours should be calculated based on the minimum and maximum similarities for the neuron (
AbsoluteScale = FALSE
) or on the minimum and maximum possible for all neurons.- PlotVectors
logical indicating whether the vectors of the
dotprops
representation should be plotted. IfFALSE
, only the points are plotted.- ...
extra arguments to pass to
plot3d
.
Value
show_similarity
is called for the side effect of drawing the
plot; a vector of object IDs is returned.
See also
The low level function WeightedNNBasedLinesetMatching
is used to retrieve the scores.
Examples
if (FALSE) { # \dontrun{
library(nat)
# Pull out gamma and alpha-beta neurons
gamma_neurons <- subset(kcs20, type=='gamma')
ab_neurons <- subset(kcs20, type=='ab')
# Compare two alpha-beta neurons with similar branching, but dissimilar arborisation
clear3d()
show_similarity(ab_neurons[[1]], ab_neurons[[2]])
# Compare an alpha-beta and a gamma neuron with some similarities and differences
clear3d()
show_similarity(ab_neurons[[1]], gamma_neurons[[3]])
} # }