Skip to content

Commit

Permalink
Merge branch 'hotfix/mixed-pixel.idx-orders' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudius-Appel committed Mar 28, 2024
2 parents e2e9609 + 08811ab commit 5f0a450
Show file tree
Hide file tree
Showing 43 changed files with 52 additions and 51 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: duflor
Title: Plant Image Analysis For Determination of Leaf- and Root-Area
Version: 0.0.1.9016
Version: 0.0.1.9017
Author: Claudius Appel
Authors@R: c(
person("Claudius", "Appel", email = "claudius.appel@freenet.de" , role = c("aut", "cre"))
Expand Down
6 changes: 3 additions & 3 deletions R/apply_hsv_color_to_image_subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
apply_hsv_color_to_image_subset <- function(pixel.array,pixel.idx,target.color.hsv, mask_extreme = FALSE) {
pa_t <- as.array(pixel.array)
for (i in 1:nrow(pixel.idx)) {
pa_t[pixel.idx[i, 1], pixel.idx[i, 2],1,1] <- target.color.hsv[1]
pa_t[pixel.idx[i, 1], pixel.idx[i, 2],1,2] <- target.color.hsv[2]
pa_t[pixel.idx[i, "x"], pixel.idx[i, "y"],1,1] <- target.color.hsv[1]
pa_t[pixel.idx[i, "x"], pixel.idx[i, "y"],1,2] <- target.color.hsv[2]
}
if (isTRUE(as.logical(mask_extreme))) {
for (i in 1:nrow(pixel.idx)) {
pa_t[pixel.idx[i, 1], pixel.idx[i, 2],1,3] <- target.color.hsv[3]
pa_t[pixel.idx[i, "x"], pixel.idx[i, "y"],1,3] <- target.color.hsv[3]
}
}
pixel.array <- imager::as.cimg(pa_t)
Expand Down
2 changes: 1 addition & 1 deletion R/helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ diagonal_adjacency <- function(pixel.idx) {
#' )
#' }
retrieve_adjacency_coords <- function(pixel.idx,cluster_id) {
pixel.idx[pixel.idx[,3]==cluster_id,]
pixel.idx[pixel.idx[,"clus"]==cluster_id,]
}

#' wrapper around `object.size()`
Expand Down
1 change: 1 addition & 0 deletions R/rectangularRange_HSV.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ rectangularRange_HSV <- function(pixel.array, upper_bound, lower_bound) {
# & (lower_bound[3] <= pixel.array[, , 1, 3] & pixel.array[, , 1, 3] <= upper_bound[3])
,arr.ind = TRUE
)
dimnames(idx)[[2]] <- c("x","y")
if (length(idx) == 0) { # no pixels match the requirements.
return(idx)
} else {
Expand Down
8 changes: 4 additions & 4 deletions R/validate_mask_edges.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ validate_mask_edges <- function(mask.idx,mask_name,array_dim,image.path) {
# get the matched pixels that are as close to the edges as possible
# array_dim[1]: width of pixel.array
# array_dim[2]: height of pixel.array
y_bottom <- max(mask.idx[,2])
y_top <- min(mask.idx[,2])
x_right<- max(mask.idx[,1])
x_left <- min(mask.idx[,1])
y_bottom <- max(mask.idx[,"y"])
y_top <- min(mask.idx[,"y"])
x_right<- max(mask.idx[,"x"])
x_left <- min(mask.idx[,"x"])
ret <- list(left = FALSE,
right = FALSE,
top = FALSE,
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/duflor.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkgdown: 2.0.7
pkgdown_sha: ~
articles:
duflor: duflor.html
last_built: 2024-03-22T10:58Z
last_built: 2024-03-28T14:01Z
urls:
reference: https://Claudius-Appel.github.io/duflor/reference
article: https://Claudius-Appel.github.io/duflor/articles
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/HSVtoRGB.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/RGBtoHSV.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/adjacency.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/apply_hsv_color_to_image_subset.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/change_pixel_color_HSV.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/convert_pixels_to_area.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/diagonal_adjacency.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dot-main_args.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dot-onAttach.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dot-onLoad.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dot-onUnLoad.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/duflor-package.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/extract_pixels_HSV.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/get_indicator_image.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/get_javaVM_exceptions.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/get_unique_list_elements.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/load_image.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/norm_to_range_01.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/objs.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/plot_array_as_image_sRGB.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/plot_indicator_image.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5f0a450

Please sign in to comment.