Anatomist shows cortical folds graph differently after using aims.write

AIMS library and commands usage

Moderators: denghien, riviere

Post Reply
ruslana
Posts: 14
Joined: Thu Mar 31, 2016 9:19 pm

Anatomist shows cortical folds graph differently after using aims.write

Post by ruslana »

Hello,

I have a question regarding saving cortical fold graph with pyAims. I tried to read and then save the graph running the following simple code:

Code: Select all

graph = aims.read(input_graph_file)
aims.write(graph, output_graph_file)
Created arg file is identical to the original one (I compared them using a software), and the new graph automatically appears in the data browser.
However, when I try to view it with Anatomist, the representation is very different - head and MRI slices are added to the view, and also label colours disappear.
Should I change the write parameters, or should I somehow change Anatomist settings to get the original representation back after saving the graph with aims?

Thanks a lot,
Ruslana.
Attachments
Original
Original
before_write.jpg (93.47 KiB) Viewed 11533 times
Saved with pyAims write function
Saved with pyAims write function
after_write.jpg (105.37 KiB) Viewed 11533 times
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: Anatomist shows cortical folds graph differently after using aims.write

Post by riviere »

Hi,

When you say "view it in Anatomist", you are indeed using a viewer from BrainVisa, right ? Otherwise it would not load automatically white meshes or head meshes. If I understant there is no problem with saving using pyaims, it's just that you are saving the new graph at a different location, and the new file is not indexed/recognized in the database managed by BrainVisa, thus the viewer behaves differently because it does not have the same data attributes from the database: links with other meshes, and type of labeling.
  • You can specify the "type of labeling" in the graph attributes: for historical reasons we are actually using 2 different attributes for sulci labels: "name" for manual lablings (vertex["name"]) and "label" for automatic labelings (vertex["label"]). In the graph global properties, it is possible to set a "label_property" attribute which specifies which one should be used preferably for the graph, by Anatomist (and other software):

    Code: Select all

    graph["label_property"] = "name" # or "label"
    (then re-save the graph). It can also be done interactively in anatomist.
  • You can manually view a graph with labels colors in Anatomist, but it requires an additional object to be loaded: the sulci nomenclature (the object "sulcal_root_colors.hie" which is in the shared data of BrainVisa and which gets loaded by the viewer. This nomenclature actually provides colors corresponding to the sulci names. When it is loaded before the sulcal graphs, it applies automatically, otherwise it may be activated by forcing the type of labeling for the graph in anatomist (see in the right-click popup menu on the graph).
Denis
Post Reply