find_merged_segments: Find all merged segment ids for a given starting google...

View source: R/merge-groups.R

find_merged_segmentsR Documentation

Find all merged segment ids for a given starting google segment id

Description

Find all merged segment ids for a given starting google segment id

Usage

find_merged_segments(
  x,
  return.groups = FALSE,
  return.segmentids.for.groups = TRUE
)

Arguments

x

a segment id or any other input that can be interpreted by ngl_segments

return.groups

Whether to return the merge groups as well as the segment ids

return.segmentids.for.groups

Whether to return the canonical segment id for each group rather than the 1-index of the merge group (see details).

Details

segment ids in ffn16reseg-ms1000_md0.02_c0.6_iou0.7 always match one raw segment id in fafb_v14_16nm_v00c_split3xfill2 but may map to a large agglomerated merge group.

We provide two ways to define an identifier for each of these merge groups. One uses a canonical segment id: this is the first (i.e. lowest) segment id in the merge group and appears to be how the brainmaps API identifies the merge group. This will be the case even when there are no known merges for a given segment. In R this field will be a numeric (double) column since R does not have native support for 64 bit integers.

The second approach to group identifiers uses an integer from 1 to the number of known merge groups. When there are no known merges for a segment, an NA value will be returned.

Note that this function depends on the segment_merge_groups.dt object from the fafbsegdata package.

Value

vector of segment ids (in ascending order) or when return.groups=TRUE a data.frame with columns

  • segment the integer segment id, as a numeric (double) column

  • group an arbitrary group id starting from 1 OR the canonical segment id (see details), an integer or numeric (double), respectively

Examples


if(requireNamespace('fafbsegdata', quietly = TRUE)) {
find_merged_segments(7186840767)
# these all belong to one merge group by definition
find_merged_segments(7186840767, return.groups=TRUE)
}


natverse/fafbseg documentation built on Nov. 11, 2024, 9:50 p.m.