One can read a CSV file into R. Depending on how the data are formatted in the CSV, one could use ‘arrayspecs’ in geomorph to put it in the proper format for downstream analyses.
NOTE: If you have any semilandmarks in your data the GPA-alignment from SlicerMorph is not correct. Their approach does not perform any sliding. Thus it is advised to repeat the GPA in geomorph using the appropriate sliding of semilandmarks. Otherwise, one is explicitly determining that these are not curve or surface points, but actual, repeatable 3D fixed landmarks.
Dean
Dr. Dean C. Adams
Distinguished Professor of Evolutionary Biology
Director of Graduate Education, EEB Program
Department of Ecology, Evolution, and Organismal Biology
Iowa State University
https://faculty.sites.iastate.edu/dcadams/
phone: 515-294-3834
--
You received this message because you are subscribed to the Google Groups "geomorph R package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
geomorph-r-pack...@googlegroups.com.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/geomorph-r-package/1b89771b-5f87-431b-903e-92367290648cn%40googlegroups.com.
On Sep 24, 2021, at 12:34 PM, mura...@gmail.com <mura...@gmail.com> wrote:
There are a few ways you can do this. First off, if you are doing landmarking in SlicerMorph, I would discourage you using csv files to keep your coordinates. Instead use the fcsv, supported by Slicer which is csv plus some extra headers that is important for coordinate system definition, and other relevant things for your data. You can read this fcsv directly into Slicer, whereas you have to do import in csv.If you would like to read fcsv into R, it is a one-liner in straight R.lm = read.csv(file='path.to.fcsv', header=T, skip=2) and you have your lm coordinates along with their labels. You want to iterate over your samples.We did develop a very simple R package called SlicerMorphR to do these kinds of operations more streamlined. You can install via devtools::install_github("SlicerMorph/SlicerMorphR").From that you can find functions like read.markups.fcsv, read.markups.json or write.markups.fcsv (if you want to convert data to Slicer). But more importantly if you already ran your GPA in SlicerMorph, you can simply point out to the analysis.log file in the output folder, and import all everything with a commandresults=log_parses("path.to.analysis.log")Please see the tutorial here: https://github.com/SlicerMorph/Tutorials/blob/main/GPA_3/README.md
There are a few benefits using the parser, particularly if you are working pseudo/semiLM, which in the current GM methodological paradigm are expected to be slid for better optimization. SlicerMorph will tag points generated via PseudoLMGenerator or SemiLMPatches with a different tag than anatomical LMs that are manually annotated. You will need the indices of these semi/pseudoLMs and 'fixed' LMs to pass the gpagen function of geomorph, if you are going to slide them. Relevant objects in the output of log_parser are $semi(boolean, are there any LMs tagged as semi/pseudoLMs?) and if it is true then there will be object called $semiLM that will contain the indices of LMs in the array that are tagged. The raw coordinates of data are saved in $LM. If this sounds complex, you can of course bypass all these and use your own method of tracking LMs and files.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/d5ef8c10-1dc7-4685-9bb4-1b71a3853252n%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/CH2PR04MB6617269A4E8BAED0E7753E9DA2A49%40CH2PR04MB6617.namprd04.prod.outlook.com.
For the group comparison component of your question, see the help page for ‘procD.lm’. This has explanation and a worked example.
For the JSON portion, this is something outside of geomorph, so the slicer folks need to provide guidance on how to get this input file into R, and then into a workable geomorph format.
Dean
Dr. Dean C. Adams (he/him)
Distinguished Professor of Evolutionary Biology
Department of Ecology, Evolution, and Organismal Biology
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/b61c8401-b303-48a4-a395-31a4c73ad32en%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/7a875ef1-83ef-48e4-a5b7-2d23ce44d461n%40googlegroups.com.