stitch_neurons: Stitch multiple fragments into single neuron using nearest...

View source: R/neuron.R

stitch_neuronsR Documentation

Stitch multiple fragments into single neuron using nearest endpoints

Description

Stitch multiple fragments into single neuron using nearest endpoints

Usage

stitch_neurons(x, prefer_soma = TRUE, sort = TRUE, warndist = 1000)

Arguments

x

A neuronlist containing fragments of a single neuron

prefer_soma

When TRUE (the default) the fragment tagged as the soma will be used as the master neuron.

sort

When TRUE (the default) the fragments will be sorted by the number of nodes they contain before stitching.

warndist

If distance is greater than this value, create a warning.

Details

Neurons will be ordered by default such the largest (by node count) neuron with a soma tag is the master neuron - i.e. the one containing the root node. Fragments are joined recursively in this sort order each time simply picking the closest fragment to the current master. Closest is here defined by the distance between nearest endpoints.

Value

A single neuron object containing all input fragments.

Author(s)

Gregory Jefferis jefferis@gmail.com

See Also

stitch_neuron

Examples

## Not run: 
dl1_main=simplify_neuron(dl1neuron, n = 1, invert = FALSE)
dl1_branches=simplify_neuron(dl1neuron, n = 1, invert = TRUE)
dl1_branches1=simplify_neuron(dl1_branches, n = 1, invert = FALSE)
dl1_branches2=simplify_neuron(dl1_branches, n = 1, invert = TRUE)
dl1_fragment <- list(dl1_main,dl1_branches1,dl1_branches2)
dl1_fragment <- as.neuronlist(dl1_fragment)
dl1_whole = stitch_neurons(dl1_fragment)

## End(Not run)

jefferis/nat documentation built on Feb. 22, 2024, 12:45 p.m.