StevenVB12 / patternize

An R package for quantifying color pattern variation
31 stars 8 forks source link

"Sample List is not of the same length as lanArray" #19

Open jevohna opened 3 years ago

jevohna commented 3 years ago

library(patternize) library(viridis) IDlist <- c('Fish1', 'Fish2', 'Fish3', 'Fish4', 'Fish5', 'Fish6', 'Fish7', 'Fish8', 'Fish9', 'Fish10')

prepath <- 'LANDMARKS' extension <- '_landmarks_LFW.txt' andmarkList <- makeList(IDlist, 'landmarks', prepath, extension)

make list with images

prepath <- 'IMAGES' extension <- '-D.jpg' imageList <- makeList(IDlist, 'image', prepath, extension) target <- imageList[[1]] RGB <- c(51, 52, 70) # patch colour picked using imagecolorpicker.com and testfish1

rasterList_lanRGB <- patLanRGB(imageList, landmarkList, RGB, transformRef = target, resampleFactor = 2, colOffset = 0.15, crop = TRUE, res = 300, adjustCoords = TRUE, plot = 'stack', cropOffset = c(15,15,15,15))

When running the last line i get this error despite not using the lanArray function "Error in patLanRGB(imageList, landmarkList, RGB, transformRef = target, : sampleList is not of the same length as lanArray"

StevenVB12 commented 3 years ago

Hi Jevohna,

might it just be a typo? You have the 'landmarkList' as 'andmarkList' when you call the function makeList().

Hope this is it. Otherwise I'll keep troubleshooting! (Also, please feel free to ask me as many questions as want to make it work)

Best,

Steven

efegidri commented 2 years ago

Lists with samples

setwd('C:/Users/fedeg/OneDrive/fedeO/wO/apubliO/94 w sapoFractal (facu)/patternizeEX/salamandras (van belleghem etal 2017)') IDListSal <- c('4031','3864','3875','3959','4118','4706','4758','5574','5580','5596') #salamandras (van belleghem etal 2017)\imagenes

make list with landmarks

prepath <- 'landmarks/Salamanders'

reemplazar por la ubicacion de los archivos en mi computer

prepath <- 'C:/Users/fedeg/OneDrive/fedeO/wO/apubliO/94 w sapoFractal (facu)/patternizeEX/salamandras (van belleghem etal 2017)/landmarks' extension <- '_landmarks.txt' landmarkListSal <- makeList(IDListSal, 'landmarks', prepath, extension)

landmarkArray <- lanArray(landmarkListSal)

make lists with images

prepath <- 'images/Salamanders'

reemplazar por la ubicacion de los archivos en mi computer

prepath <- 'C:/Users/fedeg/OneDrive/fedeO/wO/apubliO/94 w sapoFractal (facu)/patternizeEX/salamandras (van belleghem etal 2017)/imagenes' extension <- '.JPG' imageListSal <- makeList(IDListSal, 'image', prepath, extension)

make square reference to transform images to

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)

When running the above script and when running the last line, the patLanW function, we get the following error.

Error in patLanW(imageListSal, landmarkListSal, transformRef = REF, resampleFactor = 5, : sampleList is not of the same length as lanArray

The "mystery" is that we used the same script many times, but surprisingly it started giving us different errors. we really appreciate any help you can provide. thank you,

FEDE

StevenVB12 commented 2 years ago

Hi Fede,

Please check the content of the landmarkList and imageList object and verify that they are the correct and same length.

Steven

-------- Original message -------- From: efegidri @.> Date: 8/3/22 7:35 PM (GMT-04:00) To: StevenVB12/patternize @.> Cc: "Steven M. Van Belleghem" @.>, Comment @.> Subject: Re: [StevenVB12/patternize] "Sample List is not of the same length as lanArray" (#19)

Lists with samples

setwd('C:/Users/fedeg/OneDrive/fedeO/wO/apubliO/94 w sapoFractal (facu)/patternizeEX/salamandras (van belleghem etal 2017)') IDListSal <- c('4031','3864','3875','3959','4118','4706','4758','5574','5580','5596') #salamandras (van belleghem etal 2017)\imagenes

make list with landmarks

prepath <- 'landmarks/Salamanders'

reemplazar por la ubicacion de los archivos en mi computer

prepath <- 'C:/Users/fedeg/OneDrive/fedeO/wO/apubliO/94 w sapoFractal (facu)/patternizeEX/salamandras (van belleghem etal 2017)/landmarks' extension <- '_landmarks.txt' landmarkListSal <- makeList(IDListSal, 'landmarks', prepath, extension)

landmarkArray <- lanArray(landmarkListSal)

make lists with images

prepath <- 'images/Salamanders'

reemplazar por la ubicacion de los archivos en mi computer

prepath <- 'C:/Users/fedeg/OneDrive/fedeO/wO/apubliO/94 w sapoFractal (facu)/patternizeEX/salamandras (van belleghem etal 2017)/imagenes' extension <- '.JPG' imageListSal <- makeList(IDListSal, 'image', prepath, extension)

make square reference to transform images to

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)

When running the above script and when running the last line, the patLanW function, we get the following error.

Error in patLanW(imageListSal, landmarkListSal, transformRef = REF, resampleFactor = 5, : sampleList is not of the same length as lanArray

The "mystery" is that we used the same script many times, but surprisingly it started giving us different errors. we really appreciate any help you can provide. thank you,

FEDE

— Reply to this email directly, view it on GitHubhttps://github.com/StevenVB12/patternize/issues/19#issuecomment-1204583775, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABQOC43RIAPY2NLQA5UOXWTVXL65RANCNFSM4Z7JHZAA. You are receiving this because you commented.Message ID: @.***>