jonescompneurolab / hnn-core

Simulation and optimization of neural circuits for MEG/EEG source estimates
https://jonescompneurolab.github.io/hnn-core/
BSD 3-Clause "New" or "Revised" License
51 stars 50 forks source link

[MRG] ENH: `plot_spikes_raster` to always include all cell types #754

Closed samadpls closed 1 week ago

samadpls commented 2 months ago

Closes #658

jasmainak commented 2 months ago

Can you share before/after for a situation where the cell wasn't spiking before?

You can try plotting the spike raster in the alpha example which is subthreshold activity

samadpls commented 2 months ago

Apologies for the delay. Here's the comparison,

Before After
image Figure_1
jasmainak commented 2 months ago

Here's the comparison,

something is off here ... you shouldn't be getting spiking in this example, no?

samadpls commented 2 months ago
You're correct that in the simulation of alpha and beta rhythms in subthreshold conditions, cells should not be spiking. here is the comparison, Before After
image Figure_1
jasmainak commented 2 months ago

Better! But does the y-axis go from 0 to 270? That is to say ... how do we make it obvious to the user that there is no spiking or that only some subsets of neurons are spiking?

jasmainak commented 2 months ago

perhaps @ntolley or @rythorpe can share examples of raster plots they have seen in publications / other software ...

samadpls commented 2 months ago

Better! But does the y-axis go from 0 to 270? That is to say ... how do we make it obvious to the user that there is no spiking or that only some subsets of neurons are spiking?

~Perhaps we can set the y-axis limit to this particular range [0,270].~

Edit: Perhaps we can set the y-axis limit to the range from -total_neurons to 0

ntolley commented 1 month ago

Edit: Perhaps we can set the y-axis limit to the range from -total_neurons to 0

This is really all we need to do!

jasmainak commented 1 month ago

Let's do that. Can you share how the other example plots look after doing so?

samadpls commented 1 month ago

Let's do that. Can you share how the other example plots look after doing so?

Sure, I just ran the Gamma Rhythms. However, I received a graph with a lot of empty space at the bottom, which I believe was due to setting the Y-limit for all conditions. Therefore, I just moved the position and got the same plot as in the example. Here are the before and after changes. Before After
output Figure_1
ntolley commented 1 month ago

Ah I see! Sorry I think the actual solution is to have the y-axis correspond to the gid of each cell. The tricky part is if we specify only a subset of cells to plot, then the gids used for plotting will need to be updated so that they stop at zero.

Ultimately the idea is that if you compare plots from two different simulations, you want the y-axis to mean the same thing. Right now the y-axis changes depending on the number of cells that spike.

ntolley commented 1 month ago

@samadpls when you're back from exams can you try deleting the text in gui/index.rst? Everything except "The brand-new lightweight web-based hnn GUI that works with hnn-core."

I think the GUI docs are still technically being built despite removing it from the navbar through conf.py

samadpls commented 1 month ago

Hey @ntolley , I made the changes and added gui/index.rst to exclude_patterns in conf.py to exclude it from the build. The GUI section is no longer being built.

samadpls commented 1 week ago

Hey @ntolley, this is all set for merging. Feel free to do it whenever it's convenient for you!

ntolley commented 1 week ago

Looks great @samadpls!! Can you update whats_new.rst?