Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/profoundSegim.R
Takes two segmentation maps and merges them in a sensible manner, making sure segments representing the same object are not overlaid on each other.
1 2 |
image |
Numeric matrix; required, the image we want to analyse. Note, image NAs are treated as masked pixels. |
segim_base |
Integer matrix; required, the base segmentation map of the image. This matrix *must* be the same dimensions as image. |
segim_add |
Integer matrix; required, the new segmentation map of the image that is to be added. This matrix *must* be the same dimensions as image. |
mask |
Boolean matrix; optional, parts of the image to mask out (i.e. ignore), where 1 means mask out and 0 means use for analysis. If provided, this matrix *must* be the same dimensions as image. |
sky |
User provided estimate of the absolute sky level. Can be a scalar or a matrix matching the dimensions of image (allows values to vary per pixel). This will be subtracted off the image internally, so only provide this if the sky does need to be subtracted! |
The merger strategy is quite simple. Matching object segments are identified by the 'uniqueID' ID from an internal run of profoundSegimStats
. Whichever segment contains more flux is determined to be the best map to use as the base segment. Unmatched segments in the segim_add map are added back in after this initial merging process, so will end up on top and potentially appear as segment islands within larger segments (which is not possible using the standard segmentation process in profoundMakeSegim
).
An obvious reason to use this function is in situations where bright stars are embedded deep within an extended source. The standard watershed segmentation used in profoundMakeSegim
will tend to break a large portion of the extended source off to form the segmented region. By running profoundProFound
in different modes it is possible to identify the bright peaks (see Examples below), and then use profoundSegimMerge
to piece the segments back together appropriately.
Integer matrix; the merged segmentation map matched pixel by pixel to image.
Aaron Robotham
profoundMakeSegim
, profoundSegimKeep
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
image=readFITS(system.file("extdata", 'VIKING/mystery_VIKING_Z.fits',
package="ProFound"))$imDat
profound=profoundProFound(image, plot=TRUE)
profound_diff=profoundProFound(profoundImDiff(image, sigma=2), plot=TRUE)
tempmerge=profoundSegimMerge(image, profound$segim, profound_diff$segim)
#Notice the new embedded blue segment near the centre:
profoundSegimPlot(image, segim=tempmerge)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.