How to Enable "Editin3DViews" via python module code

segment-editor

(Amanda Hope) #1

Hi I’m new to slicer development and I wanted to update my code to the 4.10 version. I just had a question of how to enable the “edit in 3D view” section using the qMRMLSegmentEditorWidget?

I got to this point:
self.segmentEditorWidget.setActiveEffectByName(“Erase”)
effect = self.segmentEditorWidget.activeEffect()
effect.setParameter(“Editin3DViews”,“1”)
effect.self().onApply()
But whenever I attempt to erase, it will only rotate/displace the volume.

Thanks


(James Butler) #2

Hi Amanda,

I see you have posted this twice in less than an hour. Please, keep it contained to one post and someone on the forum will respond to you likely within the day.


(Andras Lasso) #3

Parameter names are case sensitive (EditIn3DViews is correct, Editin3DViews is incorrect). Also, this parameter is shared between paint and erase effects, therefore you need to set it using setCommonParameter.

So, you need to change

effect.setParameter("Editin3DViews","1")

to

effect.setCommonParameter("EditIn3DViews","1")

(Amanda Hope) #4

Sorry about that, will keep that in mind for next time