Saving landmark files for ALPACA - details requested

Still a newbie here … I created a landmark template for a fifth cervical vertebra and want to transfer the landmarks to more C5 vertebrae via ALPACA.

I see in the ALPACA tutorial that the source mesh is a .ply and the source landmark file is .fcsv, but I have several landmarks saved as .json.

Could you be more specific as to how to save the landmark template files to use in ALPACA?

Thank you SO much!
Pamela
Equus Soma Osteology & Anatomy Learning Center

The final outcome is called Final ALPACA landmark estimate and that’s what’s displayed in the screen when the ALPACA execution is completed.

Are you following this tutorial: Tutorials/ALPACA at main · SlicerMorph/Tutorials · GitHub

There appears to be confusion that the tutorial uses sample data that includes a .fcsv file however the original poster is doing their own work and only has .mrk.json files.

1 Like

from ALPACA’s operability perspective fcsv and json (or .mrk.json) are the same. To encourage its usage, we have the default option to save the files in .json format (when ALPACA is run in batch mode).

This can be set back to FCSV if the user chooses to do so.

It may be clearer for new users if the sample data for the ALPACA tutorial was also in the latest file formats. In this case updating the ALPACA tutorial to use .mrk.json files may be more helpful to match how things look when using latest Slicer today.

1 Like

Yes, I started following that tutorial.

I first watched this video which describes exactly what I want to do. https://youtu.be/ZRikzsUBeAE?si=GASvFcEDnk9ymzL9.

I realize it is 3 years old, but nevertheless the gentleman is demonstrating how to transfer the landmarks between 2 bones and he uses the single alignment which “requires” .fcsv format for the landmarks.

My specimens (equine cervical vertebrae) have a combination of point landmarks (17), closed and open lines (10). I created a template on C5 (fifth cervical). Now I want to duplicate the template on the other 40+ C5 bones.

I understand that .fcsv format is used for the Single Alignment Source Landmark Set. Do I need to put all of the landmarks in a single folder? Or is there a way to save the all the landmarks in the template as one .fcvs file?

Thank you for your patience!

Please follow this section of the tutorial on batch processing: Tutorials/ALPACA at main · SlicerMorph/Tutorials · GitHub

Yes, just specify the output folder for landmarks to be saved. In batch mode you will enter the location of the source model and landmark pair you used. If you are using the single-template, there will be only one pair. If you are using multi-template (MALPACA), there should be as many pairs as your models. Make sure the file prefixes before the extension (.ply, .fcsv, ,json) are identical, as we use that to match the landmarks to the models.

Your landmarks for the new models will be saved into the output landmark folder you specify.

Thank you!

I just generated my first target with the LMs from the source, yaay!!

These LMs are the points I placed on the source, but I also used open and closed lines.

How can I add these so they are also transferred to the targets?

Screenshot of my source template:

Just load a new vertebra (one that you want to transfer LMs too), then choose this model as target and just run alpaca.

Note that if you transfer equidistant curve semi LM with ALPACA, transferred semiLMs may not be equidistant anymore.

I must be missing an important file saving option in Slicer…

When I save this model, which I created as a template, the point list is all one file, but the curves are saved as individual files.

When I try to load this model in ALPACA/Batch, I can select only the point list or just one of the curve nodes, not the complete template.

In other words, how do I save both the points and curves as a “set”? That I can then enter for the Source landmarks?

Thank you … again!

Replying to myself with an update on my question … I did a search and found reference in some 2021 posts to using the “MergeMarkups” so I’ll study the tutorial and hopefully that will be my solution!

Yes, ALPACA will transfer only one set of LMs. So if you have landmarks into two different files, you will need to merge them, and then run ALPACA.

However, as I said above I do not suggest using ALPACA to transfer equidistant semiLMs that you generate using the curve resampling option.

Can you suggest another/better method?

If am not aware of a method that will reliably transfer semiLMs from a manually drawn curve to the targets, while preserving the equal distance criteria.

What you can possibly do, is to draw the curves on all your samples, and then use python script to load the associated model, run the resample curve method, and save the output as a new curve object. However, unless you are planning to do hundreds of them, the time investment of development of script is probably not worthwhile. Resample is so fast, the script is only going to save you a few seconds and a few clicks per specimen.

Since I know nothing about python or any other scripts, I’ll think of a work around.

Meanwhile, one more question. When I import 2 or more meshes into Slicer, they appear as such:

A lovely “hug”, but is there an option for the models to remain separate as shown in the ALPACA tutorial?

3D Slicer will display models based on the image dimensions provided by the model. You can turn on/off the visibility of each model so see one at a time, or you can use dual 3D viewer, and assign each model to different vewiers. I suggest making yourself more familiar with these types of operations in Slicer. A good place to start is the Slicer user tutorial. User Interface — 3D Slicer documentation

If you want to translate move one of them to elsewhere in the scene, you can use the Transforms module (see the same link on how to use the transforms module). However, I suggest only moving the target model. If you translate the source model, you should also translate the corresponding landmarks.

Once again thank you for your quick reply and suggestions.

I am trying to learn as much of the basics of Slicer/SlicerMorph as I can. However, I know you will appreciate the urgency involved when one is on a time-line to publish, LOL.

Your help and time providing it is greatly appreciated.

Pamela
Equus Soma Osteology & Anatomy Learning Center.

Is there a way to save /export these 2 models together as a .ply or .stl so I can share them with colleagues as one 3D model?

Thanks!


Dual C6

You can merge them, but then your colleagues will loose the ability to turn one on/off. They will be blocking each other.

Your safest option is to export them individually, and share that way. Or better yet, if they are using Slicer package your scene as MRB and share that with them.

I don’t want them to turn on/off, just be able to roll them around and inspect them from all sides to relate the relative morphological characteristics.