Page 1 of 1

Anatomist shows cortical folds graph differently after using aims.write

Posted: Mon May 16, 2016 6:57 pm
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.

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

Posted: Tue May 17, 2016 10:47 am
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