command line clip

Questions about Anatomist manipulation

Moderators: denghien, riviere

Post Reply
pdeman
Posts: 39
Joined: Thu Sep 17, 2015 4:09 pm
Location: moving sometimes

command line clip

Post 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,
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: command line clip

Post 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
pdeman
Posts: 39
Joined: Thu Sep 17, 2015 4:09 pm
Location: moving sometimes

Re: command line clip

Post 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>
pdeman
Posts: 39
Joined: Thu Sep 17, 2015 4:09 pm
Location: moving sometimes

Re: command line clip

Post by pdeman »

sorry it works.
sorry it works.

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

thanks !
Post Reply