SelectByHierarchy

Questions about Anatomist manipulation

Moderators: denghien, riviere

Post Reply
Manik
Posts: 99
Joined: Fri Mar 05, 2004 1:00 pm
Location: INSERM U836, Grenoble

SelectByHierarchy

Post by Manik »

Hi,

I need to display a graph composed of a few meshes, according to a hierarchy describing the colors I would like to use for each node of the graph.

This is done through a BrainVisa process using Anatomist.py

How can I selectByHierarchy all nodes which names are described in the hierarchy, without knowing the names contained in the hierarchy ?

For example :

Code: Select all

hierarchy.selectByHierarchy("type1 type2 type3") 
works all right, but I would like to do something like:

Code: Select all

hierarchy.selectByHierarchy(hierarchy.allNames())
or

Code: Select all

hierarchy.selectByHierarchy("all")
Is there a way to do this ?
I tried hierarchy.objectInfo() to see if I could find the names, but I didn't find them.

Thanks a lot for your help !
Manik Bhattacharjee
INSERM U836
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

Hi Manik,
The simplest is to make a... hierarchical hierarchy, with one root node (called "all" for instance) containing all other nodes.
Then you can simply select "all".
But the "select all" option would be useful as well. Or maybe allowing wildcards or regular expressions in the selection names of SelectByHierarchy. And we can think about extending ObjectInfo to list the structure of a hierarchy (or graph) too. Well, it just has to be done...
Denis
Manik
Posts: 99
Joined: Fri Mar 05, 2004 1:00 pm
Location: INSERM U836, Grenoble

Post by Manik »

Ok, I had forgotten the fact that selecting the root node selects also all the subnodes...

I guess I must dive deeply in the anatomist libraries to add a new functionnality like what you proposed.
Maybe after a course on Anatomist structure and libraries, I would be able to do so !
Manik Bhattacharjee
INSERM U836
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

Wow, you foud a course on Anatomist ? How lucky you are ! :wink:
Seriously, adding a wildcard or regex system in SelectByHierarchy would be easy I guess.
Denis
Post Reply