Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

floodFill does not work for ND Arrays #57

Open
gdkrmr opened this issue Oct 22, 2021 · 2 comments
Open

floodFill does not work for ND Arrays #57

gdkrmr opened this issue Oct 22, 2021 · 2 comments

Comments

@gdkrmr
Copy link

gdkrmr commented Oct 22, 2021

Flood fill does not work on 3D arrays. I suggest to either implement it so that it works on ND Arrays or to throw an error.

> x <- array(0, c(4, 4, 4))
+ x[1:2, 1:2, 1:2] <- 1
+ x <- floodFill(x, c(2, 2, 2), 2)
+ 
Warning messages:
1: In matrix(pti, nrow = length(pti)/2, ncol = 2L, byrow = TRUE) :
  data length [3] is not a sub-multiple or multiple of the number of columns [2]
2: In matrix(pti, nrow = length(pti)/2, ncol = 2L, byrow = TRUE) :
  data length [3] is not a sub-multiple or multiple of the number of columns [2]
3: In matrix(pti, nrow = length(pti)/2, ncol = 2L, byrow = TRUE) :
  data length [3] is not a sub-multiple or multiple of the number of columns [2]
4: In matrix(pti, nrow = length(pti)/2, ncol = 2L, byrow = TRUE) :
  data length [3] is not a sub-multiple or multiple of the number of columns [2]
> x
, , 1

     [,1] [,2] [,3] [,4]
[1,]    2    2    0    0
[2,]    2    2    0    0
[3,]    0    0    0    0
[4,]    0    0    0    0

, , 2

     [,1] [,2] [,3] [,4]
[1,]    2    2    0    0
[2,]    2    2    0    0
[3,]    0    0    0    0
[4,]    0    0    0    0

, , 3

     [,1] [,2] [,3] [,4]
[1,]    2    2    2    2
[2,]    2    2    2    2
[3,]    2    2    2    2
[4,]    2    2    2    2

, , 4

     [,1] [,2] [,3] [,4]
[1,]    2    2    2    2
[2,]    2    2    2    2
[3,]    2    2    2    2
[4,]    2    2    2    2

@aoles
Copy link
Owner

aoles commented Apr 4, 2023

Thanks for your feedback! Did you by any chance start working on a solution addressing the issue? If this is the case please feel free to submit a PR. Cheers!

@gdkrmr
Copy link
Author

gdkrmr commented Apr 14, 2023

No solution from my side, this was from a project of a student.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants