ggseg / python-ggseg

Python module for ggseg-like visualizations
MIT License
97 stars 14 forks source link

Erroneus labels in ggseg.plot_aseg() #7

Open davidrs06 opened 1 year ago

davidrs06 commented 1 year ago

Good evening,

Thanks again for the great plotting tool ! I think I also found some bugs in ggseg.plot_aseg().

Shouldn't the brain stem, cerebellum white matter and cerebellum gray matter appear in light gray when not specified in the dictionary ? In the example plot for instance, the 3 structures appear in some very dark gray. Might be related to the fact that they are also labeled with this same dark color when specifying a value for them in the dictionary ? Here is the plot I get when I set them to 1, 2, and 3 respectively:

image

Otherwise, labelling the Left-Caudate creates a figure with the Right-Caudate:

image

and labelling the Right-Caudate creates a figure with the Left-Caudate:

image

It's a small detail, but you probably want the input regions to map to the correct structures in the plot ;)

Cheers ! David

PS: here's some code in case you want to replicate the plots:

import ggseg
ggseg.plot_aseg({'Brain-Stem': 1, 'Cerebellum-Cortex': 2, 'Cerebellum-White-Matter': 3.0}, cmap='Spectral', background='k', edgecolor='w', bordercolor='gray', ylabel='Volume (mm3)', title='Title of the figure')
ggseg.plot_aseg({'Left-Caudate': 1.0}, cmap='Spectral', background='k', edgecolor='w', bordercolor='gray', ylabel='Volume (mm3)', title='Title of the figure')
ggseg.plot_aseg({'Right-Caudate': 1.0}, cmap='Spectral', background='k', edgecolor='w', bordercolor='gray', ylabel='Volume (mm3)', title='Title of the figure')
davidrs06 commented 1 year ago

Actually, nevermind for the cerebellum and brain stem, just saw this is made on purpose https://github.com/ggseg/python-ggseg/blob/c0558be23fa815d698d6a610cffa0e0950ce5429/ggseg/__init__.py#L299

You can probably fix the Caudate issue by renaming the files right ?

shima-jalalian commented 7 months ago

I had the same issue with the Caudate that my results didn't make sense and I realized the problem was with the visualization tool. I love this tool but that problem might cause me not to use this tool anymore!