We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
apparently, ocontour returns 0-based index matrices while R requires 1-based indices.
As an example, consider the mask image:
msk = as.Image(matrix(0,nrow=5,ncol=5)) msk[,3] = msk[3,] = msk[2,2] = msk[2,4] = msk[4,2] = msk[4,4] = 1 msk
Image colorMode : Grayscale storage.mode : double dim : 5 5 frames.total : 1 frames.render: 1
imageData(object)[1:5,1:5] [,1] [,2] [,3] [,4] [,5] [1,] 0 0 1 0 0 [2,] 0 1 1 1 0 [3,] 1 1 1 1 1 [4,] 0 1 1 1 0 [5,] 0 0 1 0 0
Then ocontour of msk outputs:
con = ocontour(msk)[[1]] con
[,1] [,2]
[1,] 2 0 [2,] 1 1 [3,] 0 2 [4,] 1 3 [5,] 2 4 [6,] 3 3 [7,] 4 2 [8,] 3 1
while the 1-based output would be con+1
[1,] 3 1 [2,] 2 2 [3,] 1 3 [4,] 2 4 [5,] 3 5 [6,] 4 4 [7,] 5 3 [8,] 4 2
I am running R version 4.2.3 (2023-03-15) with EBImage_4.38.0 attached.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this! Indeed, looks like a bug to me. In case you have started looking into a fix, please feel free to submit a PR. Cheers!
Sorry, something went wrong.
No branches or pull requests
Hi,
apparently, ocontour returns 0-based index matrices
while R requires 1-based indices.
As an example, consider the mask image:
msk = as.Image(matrix(0,nrow=5,ncol=5))
msk[,3] = msk[3,] = msk[2,2] = msk[2,4] = msk[4,2] = msk[4,4] = 1
msk
Image
colorMode : Grayscale
storage.mode : double
dim : 5 5
frames.total : 1
frames.render: 1
imageData(object)[1:5,1:5]
[,1] [,2] [,3] [,4] [,5]
[1,] 0 0 1 0 0
[2,] 0 1 1 1 0
[3,] 1 1 1 1 1
[4,] 0 1 1 1 0
[5,] 0 0 1 0 0
Then ocontour of msk outputs:
con = ocontour(msk)[[1]]
con
[1,] 2 0
[2,] 1 1
[3,] 0 2
[4,] 1 3
[5,] 2 4
[6,] 3 3
[7,] 4 2
[8,] 3 1
while the 1-based output would be
con+1
[1,] 3 1
[2,] 2 2
[3,] 1 3
[4,] 2 4
[5,] 3 5
[6,] 4 4
[7,] 5 3
[8,] 4 2
I am running R version 4.2.3 (2023-03-15) with EBImage_4.38.0 attached.
The text was updated successfully, but these errors were encountered: