# How to convert FRM or CSV files to FCSV or JSON format

**URL:** <https://discourse.slicer.org/t/how-to-convert-frm-or-csv-files-to-fcsv-or-json-format/31067>\
**Category:** Support\
**Created:** [August 9, 2023, 2:59pm UTC](https://discourse.slicer.org/t/how-to-convert-frm-or-csv-files-to-fcsv-or-json-format/31067 "2023-08-09T14:59:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AriD](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@AriD](https://discourse.slicer.org/u/AriD)\
**Post date:** [August 9, 2023, 2:59pm UTC](https://discourse.slicer.org/t/how-to-convert-frm-or-csv-files-to-fcsv-or-json-format/31067/1 "2023-08-09T14:59:55Z")

</div>

Hello,  
I have a CSV file that includes numerous specimens, each with multiple landmark coordinates. Additionally, there are several FRM files for each specimen, also containing various landmark coordinates.

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

Is there a method to upload this CSV file to generate GPA and PCA? Alternatively, is there a way to convert these different files into the FCSV or JSON format for further analysis?

Thank you,  
Ariana

---

<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:** [August 9, 2023, 4:42pm UTC](https://discourse.slicer.org/t/how-to-convert-frm-or-csv-files-to-fcsv-or-json-format/31067/2 "2023-08-09T16:42:14Z")

</div>

There is nothing in Slicer that will convert this CSV format in a way that Slicer expects the coordinate data.

With a little scripting you can convert that into FCSV format, which expects each landmarks to be a row of data matrix (see the format here: [Markups — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/modules/markups.html))

If you are comfortable with R, read this csv file into your R session, convert it into the 2D array in which each coordinate is a row, then use the SlicerMorphR extension to write the FCSV file.  
you can use devtools to install SlicerMorphR  
'devtools::install\_github(“SlicerMorph/SlicerMorphR”)

Each of your samples (rows in your original data) should be written as a separate FCSV file. You can then use the GPA module in SlicerMorph to do the GPA alignment and PCA decomposition and visualize the results.
