-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/simplify-applyhsv-col-func' into dev
- Loading branch information
Showing
10 changed files
with
111 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#' wrapper around `change_pixel_color_HVS()` for the intention of clarity. | ||
#' | ||
#' @inheritParams change_pixel_color_HSV | ||
#' | ||
#' @return `pixel.array` with hsv-values of pixels at positions `pixel.idx` modified. | ||
#' @export | ||
#' | ||
get_indicator_image <- function(pixel.array, pixel.idx, target.color, mask_extreme = F) { | ||
return(change_pixel_color_HSV( | ||
pixel.array = pixel.array, | ||
pixel.idx = pixel.idx, | ||
target.color = target.color, | ||
mask_extreme = mask_extreme | ||
)) | ||
} | ||
#' wrapper around `change_pixel_color_HVS()` for the intention of clarity. | ||
#' | ||
#' @inheritParams apply_HSV_color_by_mask | ||
#' | ||
#' @return `pixel.array` with hsv-values of pixels at positions `pixel.idx` modified. | ||
#' @export | ||
#' | ||
get_indicator_image <- function(pixel.array, pixel.idx, target.color, mask_extreme = F) { | ||
return(apply_HSV_color_by_mask( | ||
pixel.array = pixel.array, | ||
pixel.idx = pixel.idx, | ||
target.color = target.color, | ||
mask_extreme = mask_extreme | ||
)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
#' return coordinates by cluster_id from `pixel.idx` | ||
#' | ||
#' @inheritParams .main_args | ||
#' @param cluster_id index of the to-be-retrieved cluster | ||
#' | ||
#' @return `pixel.idx` with added 3rd column `clus` mapping to a cluster | ||
#' @export | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' pixels <- extract_pixels_HSV(...) # extract pixels of a certain color-range | ||
#' adjacency <- adjacency(pixels$identifier$pixel.idx) # assign clusters | ||
#' coords <- retrieve_adjacency_coords(adjacency,1) # retrieve coordinates of first cluster | ||
#' | ||
#' plot_array_as_image_sRGB( # display result | ||
#' HSVtoRGB( | ||
#' change_pixel_color_HSV( | ||
#' pixel.array, | ||
#' coords, | ||
#' target.color = "white", | ||
#' mask_extreme = T | ||
#' ) | ||
#' ) | ||
#' ) | ||
#' } | ||
retrieve_adjacency_coords <- function(pixel.idx,cluster_id) { | ||
pixel.idx[pixel.idx[,"clus"]==cluster_id,] | ||
} | ||
#' return coordinates by cluster_id from `pixel.idx` | ||
#' | ||
#' @inheritParams .main_args | ||
#' @param cluster_id index of the to-be-retrieved cluster | ||
#' | ||
#' @return `pixel.idx` with added 3rd column `clus` mapping to a cluster | ||
#' @export | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' pixels <- extract_pixels_HSV(...) # extract pixels of a certain color-range | ||
#' adjacency <- adjacency(pixels$identifier$pixel.idx) # assign clusters | ||
#' coords <- retrieve_adjacency_coords(adjacency,1) # retrieve coordinates of first cluster | ||
#' | ||
#' plot_array_as_image_sRGB( # display result | ||
#' HSVtoRGB( | ||
#' apply_HSV_color_by_mask( | ||
#' pixel.array, | ||
#' coords, | ||
#' target.color = "white", | ||
#' mask_extreme = T | ||
#' ) | ||
#' ) | ||
#' ) | ||
#' } | ||
retrieve_adjacency_coords <- function(pixel.idx,cluster_id) { | ||
pixel.idx[pixel.idx[,"clus"]==cluster_id,] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 13 additions & 5 deletions
18
man/change_pixel_color_HSV.Rd → man/apply_HSV_color_by_mask.Rd
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters