# Load a demo landscape image
data('gimage', package = 'PathwaySpace')
# Scale down the image for a quicker demonstration
gimage <- gimage[200:300, 200:300]
# Check signal range
range(gimage, na.rm = TRUE)
# [1] 0 1
# Check image
# \donttest{
image(gimage)
# }
# Threshold the signal intensity, for example:
gimage[gimage < 0.5] <- 0
# Run summit segmentation
gmask <- summitWatershed(x = gimage)
# Check resulting image mask
# \donttest{
image(gimage)
# }
Run the code above in your browser using DataLab