patternize
patternize copied to clipboard
errors using patLanW
Hi Steve!
As the subject says, I am getting errors when using patLanW. This happens with my own photos as well as when reproducing your salamanders example, so I am wondering now if it is me selecting wrong points in the images? In the salamanders example, I am first choosing a point of the yellow area, then a point of the black area. After choosing the black point, I am always getting the following message:
> # extract the patterns using watershed
> rasterList_SalW <- patLanW(imageListSal, landmarkListSal, transformRef = REF, resampleFactor = 5, plotTransformed = TRUE,
+ correct = TRUE, plotCorrect = FALSE, blur = FALSE, sigma = 2, bucketfill = FALSE, cleanP = 3, adjustCoords = TRUE,
+ splitC = 10, plotPriority = TRUE, plotWS = TRUE, plotBF = TRUE, plotFinal = TRUE, maskOutline = REF)
[1] "sample 1 4031 added to array"
[1] "sample 2 3864 added to array"
[1] "sample 3 3875 added to array"
[1] "sample 4 3959 added to array"
[1] "sample 5 4118 added to array"
[1] "sample 6 4706 added to array"
[1] "sample 7 4758 added to array"
[1] "sample 8 5574 added to array"
[1] "sample 9 5580 added to array"
[1] "sample 10 5596 added to array"
[1] "Choose points to identify patterns. Click outside image area to stop."
[1] "Choose at leat one point to identify background. Click outside image area to stop."
Error in imager::split_connected(ws) : Pixset is empty, can't split
Also: When [1] "Choose points to identify patterns. Click outside image area to stop."
pops up, I am choosing one point of the yellow area, then the next message automatically pops up [1] "Choose at leat one point to identify background. Click outside image area to stop."
so that I next choose the black area. Instead of 'choosing points' I only get the chance to choose a single point.
I have downloaded the latest version of patternize from github and downloaded the salamander example a couple of days ago.
Can you help?
Thank you & best wishes,
Janis
Hi Janis,
I just ran the salamander example with the latest code and it’s working fine for me.
Your output should be looking like this:
[1] "Choose points to identify patterns. Click outside image area to stop." [1] "x: 11.7501067919692 y: 9.25288338316956" [1] "x: 14.7402819307988 y: 20.3165313968389" [1] "Choose at leat one point to identify background. Click outside image area to stop." [1] "x: 15.3383169585647 y: 44.2379325074754" [1] "x: 11.7501067919692 y: 78.6249466040153"
Seeing that when you click on your pattern, you are not getting x and y coordinates, I’m wondering if this could be an R or Rstudio related thing of the plotting window.
When you run this code and click on your pattern in the image, do you get any sensible output:
xy <- locator(n=1)
Best,
Steven From: janisuser @.> Sent: Friday, February 4, 2022 8:20 AM To: StevenVB12/patternize @.> Cc: Subscribed @.***> Subject: [StevenVB12/patternize] errors using patLanW (Issue #29)
Hi Steve!
As the subject says, I am getting errors when using patLanW. This happens with my own photos as well as when reproducing your salamanders example, so I am wondering now if it is me selecting wrong points in the images? In the salamanders example, I am first choosing a point of the yellow area, then a point of the black area. After choosing the black point, I am always getting the following message:
extract the patterns using watershed
rasterList_SalW <- patLanW(imageListSal, landmarkListSal, transformRef = REF, resampleFactor = 5, plotTransformed = TRUE,
-
correct = TRUE, plotCorrect = FALSE, blur = FALSE, sigma = 2, bucketfill = FALSE, cleanP = 3, adjustCoords = TRUE,
-
splitC = 10, plotPriority = TRUE, plotWS = TRUE, plotBF = TRUE, plotFinal = TRUE, maskOutline = REF)
[1] "sample 1 4031 added to array"
[1] "sample 2 3864 added to array"
[1] "sample 3 3875 added to array"
[1] "sample 4 3959 added to array"
[1] "sample 5 4118 added to array"
[1] "sample 6 4706 added to array"
[1] "sample 7 4758 added to array"
[1] "sample 8 5574 added to array"
[1] "sample 9 5580 added to array"
[1] "sample 10 5596 added to array"
[1] "Choose points to identify patterns. Click outside image area to stop."
[1] "Choose at leat one point to identify background. Click outside image area to stop."
Error in imager::split_connected(ws) : Pixset is empty, can't split
Also: When [1] "Choose points to identify patterns. Click outside image area to stop." pops up, I am choosing one point of the yellow area, then the next message automatically pops up [1] "Choose at leat one point to identify background. Click outside image area to stop." so that I next choose the black area. Instead of 'choosing points' I only get the chance to choose a single point.
I have downloaded the latest version of patternize from github and downloaded the salamander example a couple of days ago.
Can you help?
Thank you & best wishes,
Janis
— Reply to this email directly, view it on GitHubhttps://github.com/StevenVB12/patternize/issues/29, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABQOC42C3KMYTBISHUPZCDDUZO763ANCNFSM5NRUEJ3Q. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.Message ID: @.@.>>
Hi Steven,
Thanks for your quick reply! I have tried it on three different laptops, reinstalled R, RStudio, Rtools and patternize, but I keep getting the same error message. I also redownloaded your example folder but this does not help either.
Are there any other issues that could play a role?
Edit: No, I am not getting x and y coordinates when I click on the image.
Thank you and best regards,
Janis
Hi Janis,
After your code failing, is an image plotted?
Can you then try locator(n=1) and tell me what the output looks like?
Steven
From: janisuser @.> Sent: Friday, February 4, 2022 7:02 PM To: StevenVB12/patternize @.> Cc: Steven M. Van Belleghem @.>; Comment @.> Subject: Re: [StevenVB12/patternize] errors using patLanW (Issue #29)
Hi Steven,
Thanks for your quick reply! I have tried it on three different laptops, reinstalled R, RStudio, Rtools and patternize, but I keep getting the same error message. I also redownloaded your example folder but this does not help either.
Are there any other issues that could play a role?
Thank you and best regards,
Janis
— Reply to this email directly, view it on GitHubhttps://github.com/StevenVB12/patternize/issues/29#issuecomment-1030416116, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABQOC45HFQM4UK3UNAJJ5U3UZRLGXANCNFSM5NRUEJ3Q. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.Message ID: @.@.>>
Hi Steven,
The plot remains the same, exept that the area where the salamander pattern was turns black.
locator(n=1) works as it should; prints a set of coordinates when I choose a point of the image.
> locator(n=1)
$x
[1] -17.4926
$y
[1] 52.92488
Don't know if this info is of help, but I just found that in very few cases, the patLanW function prints one or two sets of coordinates, but then crashes with the same error message as before. I have been running the code many times now and would say I am getting one or two coordinates in 10 % of trials.
Best wishes,
Janis
I'm scratching my head. Are you working on a Mac? I'm wondering if it's a X11 device problem. The error where it says there's no pixels sound like it's not getting good x y coordinates.
Have you installed the Morpho depency through github? That one may fail at times otherwise.
Steven
-------- Original message -------- From: janisuser @.> Date: 2/6/22 11:56 AM (GMT-04:00) To: StevenVB12/patternize @.> Cc: "Steven M. Van Belleghem" @.>, Comment @.> Subject: Re: [StevenVB12/patternize] errors using patLanW (Issue #29)
Hi Steven,
The plot remains the same, exept that the area where the salamander pattern was turns black.
locator(n=1) works as it should; prints a set of coordinates when I choose a point of the image.
Don't know if this info is of help, but I just found that in very few cases, the patLanW function prints one or two sets of coordinates, but then crashes with the same error message as before. I have been running the code many times now and would say I am getting one or two coordinates in 10 % of trials.
Best wishes,
Janis
— Reply to this email directly, view it on GitHubhttps://github.com/StevenVB12/patternize/issues/29#issuecomment-1030860644, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABQOC45MKXUSSSROEHQXXI3UZ2K3VANCNFSM5NRUEJ3Q. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.Message ID: @.***>
No I have only tried it with Windows10, and yes, I have installed both patternize and Morpho through github.
Thanks for your help, I know this is a weird problem. I will try it with patLanRGB now, this could also work for my photos and has not led to any error messages so far :-)
Thanks again and best wishes!
Janis
I am having this same issue. I resolved the previous issues I posted before by rolling back to R 4.1.1. but now that the function is "working" it is doing exactly what is explained here. I choose points within the image, it creates some coordinates, then fails.
[1] "Choose points to identify patterns. Click outside image area to stop." [1] "Choose at leat one point to identify background. Click outside image area to stop." [1] "x: 651.695722793719 y: 607.343259339469" [1] "x: 606.8229561451 y: 582.102328099621" [1] "x: 550.731997834326 y: 618.561451001624" [1] "x: 612.432051976177 y: 727.938819707634" [1] "x: 570.363833243097 y: 683.066053059015" [1] "x: 511.468327016784 y: 660.629669734705" Error in imager::split_connected(ws) : Pixset is empty, can't split
This occurs both with the example data and my own. I still havent successfully ran the entire sample data and R code yet. Every new version of R and update of packages leads to more errors. Any way to fix this function at least so I can continue with the analysis?
Hi,
Sorry about your errors. I believe it might be an error with R studio itself, failing to give the correct coordinates. Can you try running it in regular R?
Best regards,
Steven
-------- Original message -------- From: RJGrayEcology @.> Date: 5/28/23 12:46 PM (GMT+01:00) To: StevenVB12/patternize @.> Cc: "Steven M. Van Belleghem" @.>, Comment @.> Subject: Re: [StevenVB12/patternize] errors using patLanW (Issue #29)
I am having this same issue. I resolved the previous issues I posted before by rolling back to R 4.1.1. but now that the function is "working" it is doing exactly what is explained here. I choose points within the image, it creates some coordinates, then fails.
[1] "Choose points to identify patterns. Click outside image area to stop." [1] "Choose at leat one point to identify background. Click outside image area to stop." [1] "x: 651.695722793719 y: 607.343259339469" [1] "x: 606.8229561451 y: 582.102328099621" [1] "x: 550.731997834326 y: 618.561451001624" [1] "x: 612.432051976177 y: 727.938819707634" [1] "x: 570.363833243097 y: 683.066053059015" [1] "x: 511.468327016784 y: 660.629669734705" Error in imager::split_connected(ws) : Pixset is empty, can't split
This occurs both with the example data and my own. I still havent successfully ran the entire sample data and R code yet. Every new version of R and update of packages leads to more errors. Any way to fix this function at least so I can continue with the analysis?
— Reply to this email directly, view it on GitHubhttps://github.com/StevenVB12/patternize/issues/29#issuecomment-1566081882, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABQOC46CXKMLK7DU542ZSSDXIMUH7ANCNFSM5NRUEJ3Q. You are receiving this because you commented.Message ID: @.***>
Tried it on R rather than R studios, still didn't work. On Monday, May 29, 2023 at 11:00:53 p.m. ICT, Steven M. Van Belleghem @.***> wrote:
Hi,
Sorry about your errors. I believe it might be an error with R studio itself, failing to give the correct coordinates. Can you try running it in regular R?
Best regards,
Steven
-------- Original message -------- From: RJGrayEcology @.> Date: 5/28/23 12:46 PM (GMT+01:00) To: StevenVB12/patternize @.> Cc: "Steven M. Van Belleghem" @.>, Comment @.> Subject: Re: [StevenVB12/patternize] errors using patLanW (Issue #29)
I am having this same issue. I resolved the previous issues I posted before by rolling back to R 4.1.1. but now that the function is "working" it is doing exactly what is explained here. I choose points within the image, it creates some coordinates, then fails.
[1] "Choose points to identify patterns. Click outside image area to stop." [1] "Choose at leat one point to identify background. Click outside image area to stop." [1] "x: 651.695722793719 y: 607.343259339469" [1] "x: 606.8229561451 y: 582.102328099621" [1] "x: 550.731997834326 y: 618.561451001624" [1] "x: 612.432051976177 y: 727.938819707634" [1] "x: 570.363833243097 y: 683.066053059015" [1] "x: 511.468327016784 y: 660.629669734705" Error in imager::split_connected(ws) : Pixset is empty, can't split
This occurs both with the example data and my own. I still havent successfully ran the entire sample data and R code yet. Every new version of R and update of packages leads to more errors. Any way to fix this function at least so I can continue with the analysis?
— Reply to this email directly, view it on GitHubhttps://github.com/StevenVB12/patternize/issues/29#issuecomment-1566081882, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABQOC46CXKMLK7DU542ZSSDXIMUH7ANCNFSM5NRUEJ3Q. You are receiving this because you commented.Message ID: @.***>
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>