zarquon42b / Morpho

R-package providing a toolset for (3D-based) Geometric Morphometrics
51 stars 16 forks source link

erratic error from equidistantCurve #26

Closed jjacobs228 closed 3 years ago

jjacobs228 commented 3 years ago

I am running into an issue with running equidistantCurve over the 20 curves of 3/100 meshes. The remaining 97 were processed successfully. I get the error for different curves for each of the three but the error is the same:

Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'as.matrix': Lapack routine dsytrf returned error code 14 Error in .fx(trafo$refmat, x, trafo$coeff, threads = threads) : Not compatible with requested type: [type=character; target=double].

Since the error occurs for some but not all curves on the same mesh I am at a loss to the cause.

I am prepared to send the offending three mesh/pts pairs, one working pair, and streamlined code that can replicate the issue bit was unable to upload it here.

zarquon42b commented 3 years ago

Hi, can you send the offending data and your code to my email address (you find it in the DESCRIPTION of the package)? I am on holidays so it can take some time until I have a look at it.

jjacobs228 commented 3 years ago

will do!

zarquon42b commented 3 years ago

Actually, I would like you to test the much cooler function resampleCurve from the latest development version ;)

jjacobs228 commented 3 years ago

I believe I got latest development version installed properly. resampleCurve looks to be nice and sleek. the good news is that it ran properly but subsequent checkLM lead to the attached image and as one would expect, a failure to patch. resampleCurve result

zarquon42b commented 3 years ago

This looks rather that the naming of the files is fishy, because the landmarks do not look distorted but rather thtat this is not the correct mesh. Can you please send me the code?

jjacobs228 commented 3 years ago

Ah OK that should be an easy fix if that is the case. I sent the code to zarquon42 on 8/13 from a Uta.edu email address.

zarquon42b commented 3 years ago

But the matching part is commented out. Is the code correct and I can simply uncomment it?

jjacobs228 commented 3 years ago

The code sent was the minimum to recreate the error, where as the complete code has a more lines inserted at line 21 to create the atlas which would make lines 79 on functional. The error has been occurring multiple times within lines 58-77 and varies per problematic mesh. I can send you the complete code if that would help.

zarquon42b commented 3 years ago

Didn't resolve resampleCurve the issue? I thought we are with a new problem (the mismatch between landmarks and meshes).

jjacobs228 commented 3 years ago

In that case I was unsure how to get the mismatches resolved and don't have code for that. Let me get you the resampleCurve code.

zarquon42b commented 3 years ago

You are providing the wrong name to the array in the code file you sent me. Also, in your loop you are doing what placePatch should do: Iterate over an entire sample.
You could do that using the following workflow:

  1. load all curves and fix landmarks into an array and name dim(array)[[3]] using the names also used in the ply files (without the suffix).
  2. run placePatch on this array by simply specifying the folder where the meshes are stored.
jjacobs228 commented 3 years ago

I made a go of implementing your suggestions and have emailed you with a more detailed update.