brainrender-napari icon indicating copy to clipboard operation
brainrender-napari copied to clipboard

Have region name in surface layer metadata

Open alessandrofelder opened this issue 2 years ago • 6 comments

Naming convention for region meshes is and ending in abbreviation, e.g....CB_mesh. Maybe region name should be in metadata so it displays in the tooltip?

alessandrofelder avatar Sep 19 '23 10:09 alessandrofelder

@alessandrofelder

I don't know if I can, but can I work on this problem?

kira1228 avatar Mar 07 '25 12:03 kira1228

Hi @alessandrofelder

I have a rough idea of taking the name attribute from the following structure and adding it to the surface layer.

STRUCTURE_TEMPLATE = { "acronym": "VIS", # shortened name of the region "id": 3, # region id "name": "visual cortex", # full region name "structure_id_path": [1, 2, 3], # path to the structure in the structures hierarchy, up to current id "rgb_triplet": [255, 255, 255], # default color for visualizing the region, feel free to leave white or randomize it }

Do you think this is going to work out? 🤔

kira1228 avatar Mar 07 '25 13:03 kira1228

Yes, you are welcome to tackle this, but I am not sure this issue is even possible 😢 so tackle this at your own risk ⚠ it may require major surgery to the code!

Let me clarify (and modify) the issue a bit:

This is the current situation:

Image

You can see in the layer list on the lower left, that the layer name and the tooltip of the layer are the same. I don't think it is possible to change this. Maybe you can find out?

Alternatively, we might be able to change the tooltip when we hover over a surface layer in the 3D view, similarly to what we do for 2D view currently. Then we could incorporate some custom tooltip text in the layer metadata, and display it in the 3D view. This might work, but the only way to know for sure is to try :)

alessandrofelder avatar Mar 07 '25 14:03 alessandrofelder

In terms of what the tooltip text should be, we suggest (for now):

  • change the Surface layer name to be the name of the region
  • make the tooltip text a formatted string like f"{name} ({acronym}) ({atlas_name})" so for example "Diencephalon (Di) (Eurasian Blackcap)" in the screenshot above

alessandrofelder avatar Mar 07 '25 14:03 alessandrofelder

I was thinking almost the same thing! I'll see if I can do it as I have an idea of how to implement it. Thanks for the advice!

kira1228 avatar Mar 07 '25 15:03 kira1228

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/brainmapper-show-brain-regions-on-napari/110715/10

imagesc-bot avatar Apr 04 '25 17:04 imagesc-bot