Learn R Programming

ProFound (version 1.14.1)

profoundSegimKeep: Merge Segmentation Map with Grouped Segmentation map

Description

Allows users to safely merge a standard segim with a groupim, where you can specify segments to be newly merged together, or groups to be merged.

Usage

profoundSegimKeep(segim = NULL, groupim = NULL, groupID_merge = NULL, segID_merge = NULL,
clean = FALSE)

Arguments

segim

Integer matrix; required, the segmentation map.

groupim

Integer matrix; the grouped segmentation map. This matrix *must* be the same dimensions as segim (if supplied).

groupID_merge

Integer vector; the group IDs that the user wants to persist into the final segmentation map (removing all segim segments that overlap with any of the specified group IDs).

segID_merge

Integer list; each list element should specify collections of segments to be merged.

clean

Logical; should segments partially overlapping with chosen groups be aggressively removed?

Value

Integer matrix; the merged segmentation map, where specified groups and segments have been merged.

Details

The merged segments inherit the lowest segment value, e.g. list(c(1,2,4),c(5,6)) would merge together segments 1,2,4 and to be a new segment 1, and then 5,6 to be a new segment 5.

If the package fastmatch is loaded then matching should be faster when multiple groups are being merged together.

See Also

profoundSegimMerge

Examples

Run this code
# NOT RUN {
image=readFITS(system.file("extdata", 'VIKING/mystery_VIKING_Z.fits', package="ProFound"))

profound=profoundProFound(image, magzero=30, groupstats=TRUE, verbose=TRUE, plot=TRUE)

segim_new=profoundSegimKeep(profound$segim, profound$group$groupim, groupID_merge=1,
segID_merge=list(c(12, 26, 62), c(13, 24)))

profoundSegimPlot(image, segim=segim_new)
# }

Run the code above in your browser using DataLab