Hi Pablo, 

A small change should fix it. Remove the “prefix” argument. Whatever you set 
“prefix” to is pasted in front of each specimen name. Notice how the error says 
there is no such file "E:/Documents/hominoid/A860ho, USNM083262hy, 
USNM084655pan, USNM143590po, USNM143593po, USNM174699pan, USNM174701pan, 
USNM174702pan, USNM239883go, USNM260582goA860ho.landmarkAscii.ply”. 

This is your path ("E:/Documents/hominoid/“), then your “prefix”, then the name 
of the first specimen in “data”, which is “A860ho.landmarkAscii”, then the file 
extension, “.ply".
Try it like this:

dimnames(data)[[3]]=str_remove(dimnames(data)[[3]],".landmarkAscii”)

patched.specimens <- 
placePatch(atlas=atlas,dat.array=data,path="E:/Documents/hominoid",prefix ='', 
fileext=".ply"))

If the dimnames(data)[[3]] perfectly match the filenames of your ply files 
(without the “.ply”), it should work.

Best
Ryan


Ryan N. Felice, Ph.D
Lecturer in Human Anatomy
University College London
Department of Cell and Developmental Biology
Anatomy Building Room G23
rnfelice.com
ryanfel...@gmail.com

> On Jun 17, 2019, at 8:38 PM, Pablo Fisichella <fisichellapa...@gmail.com> 
> wrote:
> 
> Dear All,
> 
> I’m using the function placePatch in Morpho to transfer semilandmarks from a 
> template to all specimens in my sample (n=10). Unfortunately I have failed to 
> run successfully such function. I have read some discussions here in the past 
> but some solutions that apparently functioned for other persons do not seem 
> to work in my case. Thus maybe somebody can help me with an idea or advice.
> 
> I obtained my landmarks and semilandmarks using Amira
> 
> I created an atlas (see attached pictures) which looks fine. I obtained 19 
> landmarks and 60 semilandmarks for the template.
> 
> I created a k x 3 x n array using the function read.amira.dir from the 
> Arothron package (data=read.amira.dir("E:/Documents/landmarks","auto") my 
> array is 19*3*10
> 
> Finally I used the placePatch function as follows:
> 
> placePatch(atlas=atlas,dat.array=data,path="E:/Documents/hominoid",prefix = 
> c(("A860ho, USNM083262hy, USNM084655pan, USNM143590po, USNM143593po, 
> USNM174699pan, USNM174701pan, USNM174702pan, USNM239883go, USNM260582go"), 
> fileext=".ply"))
> 
> I obtained a pxkxn array with only missing values -NAs- and I got 10 errors 
> like this for each one of my .ply models:
> 
> In place.patch(dat.array, path, atlas.mesh = atlas$mesh,  ... :matching for 
> specimen 1 failed with: Error in vcgImport(tmp.name <http://tmp.name/>): file 
> E:/Documents/hominoid/A860ho, USNM083262hy, USNM084655pan, USNM143590po, 
> USNM143593po, USNM174699pan, USNM174701pan, USNM174702pan, USNM239883go, 
> USNM260582goA860ho.landmarkAscii.ply does not exist
> 
> Evidently the function can’t find my .ply models. As I supposed this issue is 
> related to the dimnames of my array (dimnames(data)[[3]]).
> 
> I followed a suggestion that Antonio Profico did to another researcher in the 
> past by using the function str_sub from the package stringr to try to delete 
> the extension .landmarkAscii from my array dimnames but this time does not 
> work and I continue obtaining the same errors
> 
> I realized that the dimnames of my array changed. For instance the original 
> .ply model name is USNM260582go but the name of the same model in the array 
> with NAs is USNM260582go.landmarkAscii. This is the problem (i.e., the 
> extension .landmarkAscii) but since the str_sub does not work I used several 
> more functions from the package stringr including:
> 
> dimnames(data)[[3]]=str_remove(dimnames(data)[[3]],".landmarkAscii")
> 
> dimnames(data)[[3]]=str_replace(dimnames(data)[[3]],".landmarkAscii",".ply")
> 
> But I got the same errors
> 
> I have tried additional tricks like changing the dimnames (including only 
> numbers) by using this function data2=array(data, dim=c(19,3,10)) and 
> changing the names of my .ply models but I got always the same error
> 
> Obviously the error is related with my array dimnames but I don’t know how I 
> can solve this, thus I´m looking for advice
> 
> Thanks in advance for any help, advice or suggestion
> 
> best wishes
> 
> Pablo
> 
>  
> 
>  
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>         Libre de virus. www.avast.com 
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>  <x-msg://7/#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> 
> -- 
> MORPHMET may be accessed via its webpage at http://www.morphometrics.org 
> <http://www.morphometrics.org/>
> --- 
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to morphmet+unsubscr...@morphometrics.org 
> <mailto:morphmet+unsubscr...@morphometrics.org>.
> <NAs.jpg><Atlas.jpg>

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
To unsubscribe from this group and stop receiving emails from it, send an email 
to morphmet+unsubscr...@morphometrics.org.

Reply via email to