I have some fiducial points which I have placed using the fiducial selector in a module. If I go to Data, I can see the Markups there. I am now creating an effect in Segment Editor. How can I import the markups present in scene in to an Effect in Segment Editor?
Some Segment Editor effects such as Surface Cut, Draw Tube and Engrave have option to place fiducial points, but these seem to be temporary as they are not visible outside of the Segment Editor.
So, please suggest a way to get markups in scene into Segment Editor, and save Markups from Segment Editor to scene.
You cannot use existing points in the Surface Cut and Draw Tube effects. It would not be hard to implement the possibility to import an existing markup, but this need has not come up often enough. You can submit a feature request to Issues · lassoan/SlicerSegmentEditorExtraEffects · GitHub and if it gets many votes (add thumbs-up reaction to the first post there) then someone will implement it.
Until then, you can use “MarkupsToModel” extension to generate models of tubes or closed surfaces that you can drag-and-drop into a segmentation. This extension uses the same underlying classes as the two segment editor effects.
If you give me a brief idea of how to implement it, I can get started. Do I have to make changes to qSlicerSegmentEditorAbstractEffect class?
Just as Volume is available inside Segment Editor to select Master Volume, I would like to import markups.
Thank you for your guidance.
So, from what I understand, I need to implement an Import Button which is able to get the markups that are stored in scene and make them available inside the Effect.
Then, I need to implement a markups points selector which is a dropdown consisting of all the markups available (which have been imported using the import button). Using this, I will be able to import any markups fiducials from the ones available in scene.
Please help in understanding how to import markups from scene into our effect. I am aware of sitkUtils.PullVolumeFromSlicer to get the volume from scene into our script. But, does such a thing exist for markups?
Also, I have implemented some extensions in python. I am wondering whether I should have some of that code as an Effect inside Segment Editor. Is this a good idea? What are the circumstances where one would look to create an Extension vs an Effect?
I understand that operations such as Thresholding or Smoothing might make good Effects but if I wanted to perform a series of operations such as thresholding, levelset segmentation, smoothing etc. one after the other, would it be better to implement it as a Module in an extension or as an Effect?
sitkUtils.PullVolumeFromSlicer is for copying a SimpleITK image into a Slicer volume node. Copying data between Slicer nodes is much simpler. For example, you can call:
If you want to make any module available for others then you need to put them into an extension. See more information here.
If you implement interactive segmentation tools then I would recommend to make them available as Segment Editor effects so that users can easily access it along with other interactive tools in the Segment Editor module. If you implement an automated segmentation workflow then it may make more sense to create a separate scripted module, with a simple GUI (input image and output segmentation node selectors and maybe a few more widgets to set some additional segmentation parameters).