segmentTulipLeafChoice: Segment Tulip Leaf Choice

View source: R/segmentTulipLeafChoice.R

segmentTulipLeafChoiceR Documentation

Segment Tulip Leaf Choice

Description

This is the legacy calculation of choice where backwards traversal was only started from "leaf" nodes i.e. nodes where the forwards traversal originally found a dead end (from actual dead ends, to dead ends because the next line has been covered through a different path)

Usage

segmentTulipLeafChoice(
  map,
  radii,
  radiusTraversalType,
  weightByAttribute = NULL,
  quantizationWidth = NA,
  selectedOriginRefs = NULL,
  recordSelLeafs = FALSE,
  copyMap = TRUE,
  verbose = FALSE,
  progress = FALSE
)

Arguments

map

A Segment ShapeGraph

radii

A list of radii

radiusTraversalType

The traversal type to keep track of whether the analysis is within the each radius limit. See TraversalType

weightByAttribute

The attribute to weigh the analysis with

quantizationWidth

Set this to use chunks of this width instead of continuous values for the cost of traversal. This is equivalent to the "tulip bins" for depthmapX's tulip analysis (1024 tulip bins = pi/1024 quantizationWidth). Only works for Segment ShapeGraphs

selectedOriginRefs

Optional. Limit the analysis to specific refs

recordSelLeafs

Record the leaf column of the selected refs

copyMap

Optional. Copy the internal sala map

verbose

Optional. Show more information of the process.

progress

Optional. Enable progress display

Value

A new map with the results included

Examples

# LatticeMap analysis (VGA)
mifFile <- system.file(
    "extdata", "testdata", "simple",
    "simple_interior.mif",
    package = "alcyon"
  )
  sfMap <- st_read(mifFile,
    geometry_column = 1L, quiet = TRUE
  )
  latticeMap <- makeVGALatticeMap(
    sfMap,
    gridSize = 0.5,
    fillX = 3.0,
    fillY = 6.0,
    maxVisibility = NA,
    boundaryGraph = FALSE,
    verbose = FALSE
  )
allToAllTraverse(latticeMap,
  traversalType = TraversalType$Angular,
  radii = -1L,
  radiusTraversalType = TraversalType$None
)

# Axial analysis
mifFile <- system.file(
    "extdata", "testdata", "barnsbury",
    "barnsbury_small_axial_original.mif",
    package = "alcyon"
  )
  sfMap <- st_read(mifFile,
    geometry_column = 1L, quiet = TRUE
  )
  shapeGraph <- as(sfMap, "AxialShapeGraph")
allToAllTraverse(
  shapeGraph,
  traversalType = TraversalType$Topological,
  radii = c("n", "3"),
  includeBetweenness = TRUE
)

# Segment analysis
mifFile <- system.file(
    "extdata", "testdata", "barnsbury",
    "barnsbury_small_segment_original.mif",
    package = "alcyon"
  )
  sfMap <- st_read(mifFile,
    geometry_column = 1L, quiet = TRUE
  )
  shapeGraph <- as(sfMap, "SegmentShapeGraph")
segmentTulipLeafChoice(
  shapeGraph,
  radii = c("n", "100"),
  radiusTraversalType = TraversalType$Metric,
  weightByAttribute = "Segment Length",
  quantizationWidth = pi / 1024L,
  verbose = FALSE,
  progress = FALSE
)

alcyon documentation built on Aug. 30, 2026, 1:07 a.m.