command line clip

Questions about Anatomist manipulation

Moderators: riviere, denghien

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

command line clip

Postby pdeman » Thu Jan 14, 2016 2:50 pm

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: 1358
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: command line clip

Postby riviere » Thu Jan 14, 2016 4:35 pm

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

Postby pdeman » Thu Jan 14, 2016 5:14 pm

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

Postby pdeman » Thu Jan 14, 2016 5:34 pm

sorry it works.
sorry it works.

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

thanks !


Return to “Anatomist”

Who is online

Users browsing this forum: No registered users and 1 guest