# SlicerMorph paper

**URL:** <https://discourse.slicer.org/t/slicermorph-paper/18751>\
**Category:** Announcements\
**Tags:** slicermorph\
**Created:** [July 15, 2021, 2:39pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751 "2021-07-15T14:39:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 15, 2021, 2:39pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/1 "2021-07-15T14:39:19Z")

</div>

Congrats to @smrolfe and @muratmaga for getting the [SlicerMorph](https://slicermorph.github.io/) paper published! 👍 👍 👍

Rolfe, S., Pieper, S., Porto, A., Diamond, K., Winchester, J., Shan, S., Kirveslahti, H., Boyer, D., Summers, A. and Maga, A.M. (2021), SlicerMorph: An open and extensible platform to retrieve, visualize and analyze 3D morphology. Methods in Ecology and Evolution. Accepted Author Manuscript. [https://doi.org/10.1111/2041-210X.13669](https://doi.org/10.1111/2041-210X.13669)

[https://besjournals.onlinelibrary.wiley.com/doi/abs/10.1111/2041-210X.13669](https://besjournals.onlinelibrary.wiley.com/doi/abs/10.1111/2041-210X.13669)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/7/c7ae5ab61a23055b64e9dab9289db97320e28e1d.jpeg)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 15, 2021, 4:22pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/2 "2021-07-15T16:22:51Z")

</div>

Very nice! I would recommend to explicitly designate this paper as the paper to cite when somebody uses SlicerMorph (add “How to cite” to SlicerMorph website). This makes it much easier to follow who uses SlicerMorph and for what, and it is also much more impressive to have one paper with 500 citations than 10 papers with 50 citations each. Users of course can cite additional papers, more specific to certain SlicerMorph features (e.g, if they use ALPACA then they should cite the SlicerMorph paper and the ALPACA paper).

---

<div class="post-metadata">

**Author:** ![DRYAHYA](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dryahya/32/3030_2.png) [@DRYAHYA](https://discourse.slicer.org/u/DRYAHYA)\
**Post date:** [July 15, 2021, 4:44pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/3 "2021-07-15T16:44:01Z")

</div>

Congratulations for the great work

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [July 15, 2021, 5:22pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/4 "2021-07-15T17:22:23Z")

</div>

Thank you all for our help. This wouldn’t be possible without the support of this wonderful group of people around the Slicer platform.

@lassoan We do have [how to cite SlicerMorph on the github repo](https://github.com/SlicerMorph/SlicerMorph/#citations). These were pointing out to the more detailed preprint versions of the paper, but will update with the new DOIs. ALLPACA paper is is also accepted to MEE and should appear shortly.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 15, 2021, 7:49pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/5 "2021-07-15T19:49:54Z")

</div>

> [@muratmaga](#):
>
> We do have [how to cite SlicerMorph on the github repo](https://github.com/SlicerMorph/SlicerMorph/#citations)

I’ve opened the [SlicerMorph website](https://slicermorph.github.io/) and searched for “cite” and nothing was found on the page. I have not thought about checking it in the repository’s readme file, and probably I’m not alone. It could be better to duplicate the “How to cite” instructions at both places. I would also recommend considering renaming “Citations” to “How to cite” (because citations may also mean a list of papers that cite SlicerMorph), highlight one single paper to be cited (to accumulate instead of disperse citations), and describe why it is important that they cite (makes it easier to demonstrate impact for securing further funding for development and maintenance).

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [July 15, 2021, 10:49pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/6 "2021-07-15T22:49:56Z")

</div>

Yeah, I think we will actually forward the [slicermorph.org](http://slicermorph.org) to the repo as oppose to the old [github.io](http://github.io) pages.

Good suggestion for the Citations, I will rename that to how to cite.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 16, 2021, 1:13pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/7 "2021-07-16T13:13:51Z")

</div>

When I searched for SlicerMorph then I got [https://slicermorph.github.io/](https://slicermorph.github.io/) as the first hit. If you don’t want people to use this landing page then it might be better to remove it.

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [October 11, 2021, 9:04pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/8 "2021-10-11T21:04:18Z")

</div>

Can SlicerMorph also use the PCA results with a continuous variable such as age for the samples to perform a regression analysis such as that which can be performed in MorphJ?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [October 11, 2021, 9:12pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/9 "2021-10-11T21:12:38Z")

</div>

SlicerMorph and MorphoJ serve different functions. SlicerMorph is a digitization and shape variance visualization tool, whereas MorphoJ is an analytical tool with some function specific to analysis of coordinate data.

At this point SlicerMorph does not feature any analysis features built on latent variables like PC scores. You have two options.

1. You can explore the available linear model tools in Python, and use them within Slicer/SlicerMorph. We can possibly work with you, if you want to go down that route. [These are some examples of packages that offer linear modeling and regression in Python.](https://pypi.org/project/linearmodels/)
2. You can take the PCA output from SlicerMorph and use R/geomorph package to do your analysis. [This tutorial shows the necessary steps](https://github.com/SlicerMorph/Tutorials/tree/main/GPA_3)

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [October 13, 2021, 3:01pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/10 "2021-10-13T15:01:39Z")

</div>

More general question then, as I would prefer to use the functionality of MorphoJ than reinventing the wheel myself with Python tools or with having to format the PCA outputs in R (which in and of itself is slow and cumbersome when doing GMM with landmarks). Does anyone know which files in 3D Slicer or SlicerMorph are responsible for defining the saving system for fiducial files? If so I can modify said file to save in the format necessary for MorphoJ for our purposes to be able to directly import them without all the rigmarole of altering each .fcsv file and then combining them for analysis.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [October 13, 2021, 3:15pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/11 "2021-10-13T15:15:39Z")

</div>

İ (and probably an order of more magnitude more publications that use R based gmm tools for shape analysis instead of morphoj) respectfully disagree with your assessment of functionality of R gmm ecosystem. But if course you are free to do what you want to do.

i don’t think you want to modify the fcsv write functions and rebuild Slicer from scratch, as those would be undoubtedly more work. Fcsvs are simple csv files that you can open in excel and append each other if that’s what you want.

İ do not know what format morphoj expects.

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [October 21, 2021, 4:48pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/12 "2021-10-21T16:48:21Z")

</div>

My apologies, I didn’t explain very well. My task is trying to teach medical school students and biologists the process of shape analysis, particularly through GMM. The majority of these students neither have programming experience, nor any interest in learning programming. That is why using R would be slow and cumbersome. I am also not interested in modifying the 3D Slicer process of saving fcsv files, only looking at the architecture, and the process that 3D Slicer uses to save said files so I can replicate it with my own function/script to generate something like a json file, text file, etc, with all of the landmark points listed one after the other, without uncertainty values and such.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [October 21, 2021, 4:59pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/13 "2021-10-21T16:59:15Z")

</div>

> [@stevenagl12](#):
>
> he majority of these students neither have programming experience, nor any interest in learning programming. That is why using R would be slow and cumbersome. I

Yes, learning GUI driven analysis programs like MorphoJ is somewhat easier to use initially. Particularly if all you ever need is the functionality offered in the package. The main catch is, the moment you need something else you are stuck. It is also much more challenging to export data from those kinds of tools, if you need to generate publication quality images. reformat tables etc… So there are drawbacks to both approach.

You don’t necessarily learn to program in R, if all you all you do is to use a package like geomorph. You replace teaching keyboard shortcuts and menu selections with function names and parameters to pass them, which the student can learn to program if they choose to so in future. But you dont necessarily need to learn to program anything in R. Just learn function names and be able to write things in a script. It is a bit more upfront investment, but in the long run it pays off, particularly for students.

Going back to your original inquiry, I see [morphoJ takes a text input (but they provide no description of what fields are necessary)](https://morphometrics.uk/MorphoJ_guide/frameset.htm?fundamentals/variables.htm). Probably that would be your simplest option. If you get an example of what that looks like, we can help you to reformat the fcsv into that.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [October 21, 2021, 7:38pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/14 "2021-10-21T19:38:51Z")

</div>

> [@stevenagl12](#):
>
> If so I can modify said file to save in the format necessary for MorphoJ for our purposes to be able to directly import them without all the rigmarole of altering each .fcsv file and then combining them for analysis.

This piece of R code seem to convert the fcsv to the basic text format MorphoJ expects as far as I can tell. You can test with the sample data in SlicerMorph. First download the gorilla skulls data, then run them via SlicerMorph’s GPA function (only to create the analysis.log file) that we use the pull the data. Then in R, run this script.

```auto
if (!require(devtools)) install.packages('devtools')
if (!require(SlicerMorphR)) devtools::install_github('SlicerMorph/SlicerMorphR')

#navigate to the analysis.log file saved into the output folder.
dat=parser(file.choose())

#function to convert 2D matrix of coordinates to a row of coordinate 
vectorize = function(X){
  return(as.vector(t(X)))
}

lms = NULL
for (i in 1:length(dat$files)) lms = rbind(lms, vectorize(dat$LM[,,i]))
#append the subject IDs
rownames(lms) = dat$ID
#write to disk
write.table(lms, file="c:/users/amaga/Desktop/test.txt", quote=FALSE, sep=",", row.names = TRUE, col.names = FALSE)

```

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [October 21, 2021, 7:52pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/15 "2021-10-21T19:52:53Z")

</div>

So the text document really just has the each line with the sample name, followed by each x, y, and z coordinate of those landmarks relating to said sample. I just want a way to automatically save this easily so that the students don’t have to save each file and pull that info out individually and save them. It also can be any forma of text document including csv, fcsv, text, or tsv. It just can’t contain the uncertainty values of the landmark and all the extra fields that are in fcsv files.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [October 21, 2021, 8:08pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/16 "2021-10-21T20:08:18Z")

</div>

This conversion needs to be done separately. I am not inclined to support any format that is not native to Slicer within SlicerMorph, as if people start using those formats to keep their data in, that will break our functionality (or formats don’t have things that we care or need, like units or coordinate systems).

Did you try the code example above? If you are more comfortable with excel, I am sure a short visualbasic script would do that too.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 21, 2021, 9:57pm UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/17 "2021-10-21T21:57:27Z")

</div>

> [@muratmaga](#):
>
> If you are more comfortable with excel, I am sure a short visualbasic script would do that too.

Since the markups json file is practically a database. You can use that as a data source in Excel, you can read the markups json file into a spreadsheet directly, just using the GUI. It is not a one-time import, but it is a live query, which allows refreshing of the spreadsheet from the json file.

[![](https://img.youtube.com/vi/vZb4v6vBXVo/maxresdefault.jpg "Import 3D Slicer markup json files into Excel") ](https://www.youtube.com/watch?v=vZb4v6vBXVo)

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [October 22, 2021, 3:49am UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/18 "2021-10-22T03:49:48Z")

</div>

So, I get the feeling that I am not communicating what I am looking for properly. I am not trying to get an official change to the slicerMorph software, only create a new module that I can then add to either slicer or slicerMorph that will enable me to save a single file with the said format. The R code would be useful if I wanted to have the students run the code, but I have dealt with students who want absolutely nothing to do with any type of programming in this course, even if it is a single instance of pulling up the program and just running the script. Plus the said script would convert the fcsv to a text file and not pull out just the intended data for the purpose of using morphoJ. The excel file system would also require saving individual fcsv files, and pulling them into Excel, then editing it which is just time consuming. That is why I would like to look at the code for slicer or slicerMorph on how it saves fcsv files and maybe even the markups module to be able to access the list of fiducials to print out the text, json, csv, etc file for access in morphoJ. I realize this is an irregular use case but people make new modules for slicer all the time and I am just trying to do that.

In addition, I also realize that it would be better to just work in R, but as said I have dealt with medical, dental, anthropology, and biology students who refuse to learn coding of any kind and who will not use coding softwares. They have left very negative reviews about courses instructing them on how to use said softwares, and/or been unable to produce results because they fail to understand the directions. Even adding too many softwares is a problem which is why I was originally looking at slicerMorph in the beginning because it calculates the PCs for future analysis.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [October 22, 2021, 4:00am UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/19 "2021-10-22T04:00:34Z")

</div>

> [@stevenagl12](#):
>
> only create a new module that I can then add to either slicer or slicerMorph that will enable me to save a single file with the said format.

You can develop a simple python module that will essentially replicate the R code I posted. There is nothing in SlicerMorph, that writes these landmarks files (neither for FCSV, nor in JSON). We are simply using the built-in functionality in Slicer to save them.

More important in Slice/SlicerMorph, we keep the landmarks per subject. Whereas the format you want to keep them essentially compiles all the subjects together in a single file. So after your students are done in Slicer/SlicerMorph landmarking their specimens, they can copy all fcsv/json files in a folder, and your module can read all of them, do the flattening and save a single text file out of them.

The closest piece of code I can show from SlicerMorph, is a module that does the reverse of what you ask, read an obscure format and import them as fcsv. [SlicerMorph/IDAVLMConverter/IDAVLMConverter.py at master · SlicerMorph/SlicerMorph · GitHub](https://github.com/SlicerMorph/SlicerMorph/blob/master/IDAVLMConverter/IDAVLMConverter.py).

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [October 22, 2021, 4:17am UTC](https://discourse.slicer.org/t/slicermorph-paper/18751/20 "2021-10-22T04:17:19Z")

</div>

I can provide some sample python code to do this if that would be helpful. If possible can you share an example file?

[Next page](https://discourse.slicer.org/t/slicermorph-paper/18751.md?page=2)
