kymata-atlas / kymata-core

Core Kymata codebase, including statistical analysis and plotting tools
https://kymata.org
MIT License
5 stars 0 forks source link

Split EEG sensors left/right when doing sensor-space expression plots #190

Closed caiw closed 8 months ago

caiw commented 8 months ago

Currently EEG sensors are assigned to both hemispheres: we aren't using any positional information to assign them.

Note to the person who looks at this issue next

I have a memory that there was a reason we couldn't easily access the positional info from the EEG sensors, or that we decided not to spend the time properly parsing it, so this may not be a super straightforward fix.

Removed #todo

Removed comment # TODO: these EEGs aren't split appropriately in _left_right_sensors = ... in plot.py as part of #173/#184

neukym commented 8 months ago

Figure_1

@caiw - can you give more info of what this issue refers to? In the above plot, I can see that at least 28 sensors are attributed to the centre line (i.e. are outlined dots) - which I think is too many, is this what this issue refers to?

caiw commented 8 months ago

I'm not 100% sure to be honest :) I was removing the #todo as part of #184.

The current code looks like this:

_left_right_sensors: tuple[AxisAssignment, AxisAssignment] = (
    AxisAssignment(axis_name="left",
                   axis_channels=[
                       sensor
                       for sensor, (x, y) in get_meg_sensor_xy().items()
                       if x <= 0
                   ] + eeg_sensors()),
    AxisAssignment(axis_name="right",
                   axis_channels=[
                       sensor
                       for sensor, (x, y) in get_meg_sensor_xy().items()
                       if x >= 0
                   ] + eeg_sensors()),
)

So it looks as if the EEG sensors are all getting assigned to both hemis, which is how we are defining medial sensors at the moment:

# Symmetric difference
both_chans = top_chans & bottom_chans
top_chans -= both_chans
bottom_chans -= both_chans

So I assume the comment relates the fact that we aren't actually using the location of EEG sensors to assign them to left and right.

I'll amend the issue description accordingly.

caiw commented 8 months ago

@neukym Please add a file which maps from the sensor names in EEG1015.lay to the sensor names we use.

neukym commented 8 months ago

Done. Reassigning to @caiw.

caiw commented 8 months ago

Should be ready now