GateNLP / gate-core

The GATE Embedded core API and GATE Developer application
GNU Lesser General Public License v3.0
78 stars 29 forks source link

Set label colors #170

Open gdivita opened 2 weeks ago

gdivita commented 2 weeks ago

Greetings,
Our organization has been using Gate to do manual annotations on clinical records for years now. One of the main complaints from the annotators is the shifting colors from annotations from open process or if the tool used was done on a different machine.

I'm fairly familiar with the last official gate release source code (9.0.1) and have used various gate api's programmatically. I've been looking for a way to invoke the annotation editor with a gate annotated xml file with the colors of the labels set, but have not figured out a way to do either invoking the editor with a file loaded, nor have the colors set.

Are either possible?

Thanks in advance,

ianroberts commented 2 weeks ago

The mapping from annotation type to colour is actually saved in the .gate.xml config file, so it is persistent on a given machine provided "save options on exit" is enabled in the advanced settings (this is the default, so it should be unless the user has disabled it). If you want the users to see the same colours then you somehow need to arrange for them all to load a configuration with the same colour settings in it.

The most basic "no code" way to do this is simply to send them a copy of your config file (~/.gate.xml on Linux or Mac, typically C:\Users\<you>\gate.xml on Windows) and tell them to save it at the same place. But you would be well advised to trim down your config file before you send it to just include the critical attribute gate.gui.docview.AnnotationSetsView.colours, which specifies the colour mapping, without including the other attributes that control things like which plugins you have loaded automatically at startup.