Page 1 of 1

command line clip

Posted: Thu Jan 14, 2016 2:50 pm
by pdeman
Hello,

I am trying to make a "checkbox button" to remove of the 3D view all object distant by more than 5 mm from the current plane.
I can do it "manually" when I have the 3D viewer by clicking on "Scene" -> "Tools" -> in the submenu "Clipping Plane" I select "Clip both Sides" and I set 5 in "Distance to current plane (mm)".

But many users "can't" do it ... so I made a checkbox button on the interface to do that, but what function should I use in python to do the clip ?

Regards,

Re: command line clip

Posted: Thu Jan 14, 2016 4:35 pm
by riviere
Hi,

You can do that this way:

import anatomist.api as ana
a = ana.Anatomist()
w = a.createWindow("3D")
a.execute("WindowConfig", windows=[w], clipping=2, clip_distance=5.)

There is the doc here:
http://brainvisa.info/doc/anatomist/htm ... onfig.html

Denis

Re: command line clip

Posted: Thu Jan 14, 2016 5:14 pm
by pdeman
Hi,
thanks a lot for the answer.

I tried it and I got this:

prop: clip_distance
prop: clipping
prop: window
Exception in command/history writer: missing semantic attribute windows in WindowConfig / command type: WindowConfig
<anatomist.cpp.RegularCommand object at 0x812a628>

Re: command line clip

Posted: Thu Jan 14, 2016 5:34 pm
by pdeman
sorry it works.
sorry it works.

I don't know what I changed, but it works now ...

thanks !