Could someone please explain the difference between the export options for fixed landmarks (fiducials) and semiLM patches in 3D Slicer? I’m not familiar with the .mrk.json, .json, .fcsv, and *.fcsv formats or the advantage of using one over the other. I’m planning to import these files into R for GM analysis using the geomorph package for analysis.
Additionally, I’m currently exporting these as .fcsv files, but I’m not able to make excel recognize and separate the file contents correctly. I’ve tried opening the app and using the open option and selecting the file, but it just opens without separating the contents into cells by commas. Any advice on this topic would be appreciated as well.
Another option is to use the log_parser.R script. Recent versions of GPA module in SlicerMorph writes a simple log file that contains important information such as the number of landmark, input file locations etc (see the readme.MD in the link above for details).
Finally, geomorph_regression.R provides an example of how to use procrustes aligned coordinates from SlicerMorph in R. It also shows an example of directly reading the original coordinates into R (to show that results are identical either way).
You might find it easier to process them in R with the scripts I provided above. But if you want to see the contents in Excel, just use the Text to Columns option under Data (and choose comma as separator).
If you are only doing landmarks (whether semi or anatomical LMs) and your goal is shape analysis in R, then the difference between fcsv and json is not much. However, if you are using other Markup types such as lines, closed curves, planes, etc., and particularly if you are making measurements from them, fcsv cannot store these measurements, while JSON can. For example, if you create a line with two Fiducal markups that is 10 mm long, if you save this file as fcsv and load it back into Slicer, all you will get will be the coordinates of the two control points that used in making the line. There won’t be a length measurement, there won’t be a visualization of that line segment. If you save it as json, they will be restored next time you load that into Slicer.
New problem: I accidentally saved the file after I applied the text to columns function, and now when I try and reload the file into 3D Slicer it won’t read the fiducial coordinates. I tried using the TEXTJOIN function to rejoin the text into a single column with the comma delimiter in Excel, but that isn’t making any difference. I realize this is more of an Excel help kind of question, but I’m hoping you might have some ideas for how I can make the file readable for 3D Slicer again.
I certainly have discovered a lot in the last 12 hours, including the sheer panic. I will not be saving those edited files again. Thank you, thank you, thank you! Maybe it’s time to lose the incessant need to meticulously check my data at every step.
You should do that, particularly when you are learning the software and creating a workflow.
The thing is you really shouldn’t be editing those fcsv, but just looking at the contents to make yourself familiar with the format, and what you are exporting. For that a notepad editor would suffice. Better use something like R where you can programmatically read them and don’t worry about overwriting the files…
If you are editing them to make some changes, that’s pretty much something you shouldn’t do.
I would discourage this, because there is already enough confusion about LPS/RAS and how the format is changed thru times and how control points displayed in Markups module versus saved in file. Without those headers saved in the file, it would be a big headache.
By the way, Excel can import json files very nicely as a data source, the same way as it can generate live table views from various other databases (see step-by-step instructions below). So, Excel’s limitation is not that it cannot load JSON files, but in what analysis it can do on them and that you need to use the GUI or VBA (or maybe C#), which are not that well suited for data analysis.
Step-by-step instructions for importing a markups json file (*.mrk.json) into Excel as a live data source:
In the ribbon, choose Data / Get data / From file / From JSON, and select the *.mrk.json file
You only need to do this once, from this point the markups json file acts as a database (you can update table content from the json file with a single click or enable auto-refresh, etc.), you can change the input json file, etc.