hiweller / recolorize_examples

8 stars 3 forks source link

Error when using Recolorize & Patternize #2

Closed Humminglipe closed 2 years ago

Humminglipe commented 2 years ago

Hi Hannah! I got an error when doing the alingnment of the images. I'm trying to follow the workflow. After running the alignLan function this error pops up:

[1] "sample 1 DSC_0065 added to array" [1] "sample 2 DSC_0067 added to array" Error in abind::abind(landmarksArray, landmarksArray1, along = 3) : can only supply one list-valued argument for ...

Don't know if its an error on the files,

IDlist <- tools::file_path_sans_ext(dir("D:/Proyecto de tesis/Imagenes/Recolorize/Ramphocelus/PNG", ".png")) imageList <- makeList(IDlist, type = "image", prepath = "D:/Proyecto de tesis/Imagenes/Recolorize/Ramphocelus/PNG", extension = ".png") listaLandmarks <- makeList(IDlist, type = "landmark", prepath = "D:/Proyecto de tesis/Imagenes/Recolorize/Ramphocelus/Landmarks", extension = ".txt") target <- listaLandmarks[['DSC_0067']] mask <- read.csv("D:/Proyecto de tesis/Imagenes/Recolorize/Ramphocelus/Mascaras/DSC_0067_mask.txt", header = FALSE)

imageList_aligned <- alignLan(imageList, listaLandmarks, transformRef = target, adjustCoords = TRUE, plotTransformed = 5, cartoonID = 'DSC_0067', maskOutline = mask, inverse = FALSE)

I'll appreciate you help

Thank you & best wishes,

Felipe

StuntsPT commented 2 years ago

I'd like to add my +1. The error is also triggered when using the tutorial data - in fact, running the script 05_wasps_a_alignment.R is enough to trigger it.

It also appears to be a multi platform error, since @Humminglipe path is MS Windows (D:/...) and I'm on Arch Linux (R 4.2.1).

If you need any further debugging, I'm available to help with whatever you need me to test.

Best,

Francisco

hiweller commented 2 years ago

Thanks both—I'll try to find time to look at this today. I know this is usually an error that crops up with patternize masking, so I'll see if I can recreate it on my machine.

On Tue, Sep 20, 2022 at 10:42 AM Francisco Pina-Martins < @.***> wrote:

I'd like to add my +1. The error is also triggered when using the tutorial data - in fact, running the script 05_wasps_a_alignment.R https://github.com/hiweller/recolorize_examples/blob/main/05_wasps/05_wasps_a_alignment.R is enough to trigger it.

It also appears to be a multi platform error, since @Humminglipe https://github.com/Humminglipe path is MS Windows (D:/...) and I'm on Arch Linux (R 4.2.1).

If you need any further debugging, I'm available to help with whatever you need me to test.

Best,

Francisco

— Reply to this email directly, view it on GitHub https://github.com/hiweller/recolorize_examples/issues/2#issuecomment-1252459528, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC4DUVVDU2DWUTNS44EHB4LV7HENTANCNFSM6AAAAAAQK4EWE4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Hannah Weller PhD Candidate | Dept. of Ecology & Evolutionary Biology | Brown University Phone: (617) 529 6837 Email: @.** Web: hiweller.rbind.io | https://github.com/hiweller | twitter.com/hannahiweller Pronouns*: she/her

StuntsPT commented 2 years ago

@hiweller Thank you for your quick feedback. In the meantime I have to report that I have tried the script 05_wasps_a_alignment.R in R 4.1.3 and I get the same error, so it is not something that was introduced in R 4.2.1.

Best,

Francisco

Humminglipe commented 2 years ago

Thanks Francisco and Hannah for your response. Similar to Francisco, I tried the code in R. 4.1.1 as Steven Van Belleghem (patternize developer) suggested.

hiweller commented 2 years ago

Good news is I can recreate the issue on my computer...bad (medium?) news is that this appears to be an issue with patternize, not recolorize. Running the example for the makeList function documentation generates the same error. This is new to me.

  1. Do you both get the Warning: [rast] unknown extent warnings when running the makeList call on line 9 of 05_wasps_a_alignment.R?

  2. For now, if you want to move on with the demo, you should be able to run the b and c scripts (recolorize and patPCA) fine, since the aligned image list is also saved as a .RDS file for pretty much exactly this reason.

Update—I think I remember Steven (the patternize dev) helping another user troubleshoot this problem, so I've emailed him to see what he did. Hopefully it's an easy fix!

StuntsPT commented 2 years ago

Hello again @hiweller , It was an "upstream" issue from the patternize library. The issue was tracked here, and was fixed by commit bcb0f02. Sorry to have wasted your time!

Best,

Francisco

hiweller commented 2 years ago

Thanks both! Curse these pesky updates :)