I’ve got a function that produces a list of vtkPolygons (that I put together into a vtkPolyData) that I’d like to “draw” on a labelmap mask. It looks like
EditorLib.LabelEffect.slicer.SegmentEditorDrawEffect.scriptedEffect.appendPolyMask(label_map, polyData, sliceWidget )
will do the trick. The problem is that when I call that I get:
MemoryError: std::bad_alloc: bad allocation
It looks like the label map I get inside my effect on an empty segment has zero dimensions:
label_map = self.scriptedEffect.maskLabelmap()
I assume that would be the case even if there were something in the segment already and I was drawing outside of the bounds of that mask?
Is there a way to create a mask that isn’t zero length from an empty segment? Or how should I be going about the task of drawing these vtkPolygons into a segment? I’d like to be able to have the system draw these in and then let the user clean them up a bit in one workflow.