Adding fiducial marks and determining RAS coordinates

Hello everyone,
Is there anyway to add fiducial markers to a stl data without the markups module? I want to add fiducial markers manually to the module I am working on. I’d like to display the RAS coordinates to the module GUI.

Hi,
You can take advantage of the markups module in your own module, without using the markups module in a visible way. There are examples in the script repository how to use module functions (including markups) from your module: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Switching_to_markup_fiducial_placement_mode
I hope this helps,
Tamas

Hello Tamas,
Thank you for your reply! This is written in python but I am extending a cxx file. Can the same thing be done in C++ along with the QT framework? If it can be done, I am really counting on your suggestions.

Best regards,
Anish

Yes, the Markups module is written in C++, so you should be able to use the same functions in a C++ loadable module too.
I think it is very rare that people use C++ to write Slicer modules nowadays. If an application-specific workflow needs to be supported by a custom Slicer module, Python seems to be a more efficient choice.

Thank you for your reply. Is there any example to do that? Cause I researched on the internet but I did not find a solution.

If you are looking for an example C++ module that uses fiducials for registration, this one comes to mind:


This is a convenience module that keeps track of two fiducial lists and computes registration between them. The result is stored in a transform node that can be used by other modules.

Thank you very much for your reply! I really had a hard time understanding the module. As I said earlier, I’d only want to display the fiducial point with RAS coordinates. I am new to VTK and 3D slicer. Therefore, I’d really appreciate your help.

Why don’t you use the Markups module? If you expand the “Control Points” section of the Markups module widget, you can see the RAS coordinates there.

I think what you are wanting is exactly what the qSlicerSimpleMarkupsWidget provides.

simple_markups = slicer.qSlicerSimpleMarkupsWidget()
simple_markups.setMRMLScene(slicer.mrmlScene)

image

Or the Markups module

In this case I would strongly recommend to use Python while you are getting to know the libraries (VTK, ITK, Qt, CTK, Slicer, etc.). Once you know how things work and what exactly you need, you can easily switch back to C++. We often use Python, even for prototyping new Slicer core features that are in the end ported to C++.

Thank you very much for your reply! I wanted to deliver the same functionality as control points section of the markups module widget.

Thank you very much for your reply! I will try it and let you know.

Thank you very much for your suggestions. I have basic knowledge of C++ programming and the project that I am working on right now demands the use of C++. Therefore, I’d like to have a good grasp of development of a module with c++. It’d be nice if you could recommend me some resources that I can rely on.

Majority of Slicer core is implemented in C++ and there are a number of extensions that use C++ (SlicerRT, SlicerIGT, SlicerOpenIGTLink, SlicerIGSIO, SlicerDMRI, SlicerAstro, SlicerFreeSurfer, GelDosimetry, PerkTutor, etc.) that you can use as examples.