I am trying to use the python interface to load a (float) scalar volume in the form of a signed distance field want to apply thresholdscalarvolume to generate a label map with everything below 0.0. It doesn’t seem to be working in terms of creating the label map and running the cli interface.
yes that is it exactly, I saw the another post where there are commands to import the the label map to a segmentation mode, but hadn’t gotten that far yet.
Yes, good point, you can easily create segments directly from a grayscale volume by choosing the volume as master volume and using Threshold effect. See full examples in the script repository.
Thanks,
what I am doing is a little more complicated. I am pre segmenting with vmtk and want to edit that segmentation with slicer.
I used the command segmentEditorWidget.setMasterVolumeNode(volumeNode) to set the master volume but it didn’t change the gui view like it did when changed the name of the segmentation.
also whats the command to do the alignment? I wish I had a better way to figure out how buttons are linked to the commands to be used in as script.
When I need to find how GUI actions mapped to code, the most direct way is to download Slicer source code and search in full text of all files. Most cases GUI strings are defined in Qt .ui files. In the .ui file you can find widget’s name that shows that string. Once you have the widget name, search full text of Slicer source code for widget name and you’ll find code that runs when the widget is manipulated.
These errors are logged because the widget attempts to update itself but segment editor parameter node is not set yet (using setMRMLSegmentEditorNode). You can ignore these errors and we’ll update the widget to not log these errors.