sccn / get_chanlocs

Electrode localization using 3D head image. EEGLAB plug-in using Fieldtrip toolbox
5 stars 2 forks source link

Erroneous Channel Locations #8

Closed mikemoynihan7 closed 9 months ago

mikemoynihan7 commented 9 months ago

Wrong Marker Size

I am working on a project to enhance the spatial resolution of EEG data collected for neuroscience research. In doing so, I am using the get_chanlocs plugin to localize scalp electrodes from 3D scans. I am following an online protocol, from the SCNN get_chanlocs user guide, and adequate 3D scans of participant's heads through the Structure Sensor Pro iPad attachment and ItSeez3D software.

I have successfully uploaded my 3D model to EEGLAB and get_chanlocs. I've had success locating fiducial points and manually mark the location of each electrode on my 3D model. I am using an MNI model template within the get_chanlocs program.

However, I am encountering an issue when attempting to take the next step: removing and reselecting erroneous electrode selections and pairings. I'm unable to remove the pairing of interest, through selecting the channel and pressing "r" from the Current Model Locations. However, when selecting a new location, through pressing "s," I encounter issues. A window pops-up with a large red mark, which makes selecting a new location impossible. This screenshot can be seen in the google drive link attached to this post.

I appreciate any help on resolving this issue. For step-by-step actions that I am taking, there is a screen recording of this entire process that is also accessible from the attached link.

Thank you.

https://drive.google.com/drive/folders/1BjJzvy3Z-VHxhX_v6o457VLGAE9iar5H?usp=sharing

neuromechanist commented 9 months ago

Hi Mike,

Thanks for reporting this issue. Based on the meeting we had together, it seems that the maker size is out of proportion for the scan:

image

We will investigate the issue and get back to you as soon as possible.

Thanks, Yahya

neuromechanist commented 9 months ago

The problem seems to be two folds:

  1. Scans are assigned a mm scale in https://github.com/sccn/get_chanlocs/blob/24c3df13725c2de6784304c2b630ed3f8964e6bc/get_chanlocs.m#L139, without confirming they are in mm scale or not. In this case, using the range function, it seems that the scale is in cm.
  2. The size of red spheres is also hardcoded in https://github.com/sccn/get_chanlocs/blob/24c3df13725c2de6784304c2b630ed3f8964e6bc/private/placeElectrodes.m#L41 and https://github.com/sccn/get_chanlocs/blob/24c3df13725c2de6784304c2b630ed3f8964e6bc/private/fixupNewTemplate.m#L64 So, the spheres can become huge or tiny w.r.t. the scan.

Possible Solution We can ensure the scale is correct; if not, adjust it to resolve the problem. This feature could also be a flag that can be turned off.

neuromechanist commented 9 months ago

Apologies for the wait.

It seems that an additional check for the scan range can help with the scaling. Particularly, the ft_convert_units is supposed to address this issue when the units are not explicitly mentioned, however, the implementation is unintuitive.

Therefore, I added a crude scale check in the main get_chanlocs function, and tested it against the provided scan.

I will pull and merge this branch to main and test it further.

neuromechanist commented 9 months ago

@mikemoynihan7,

Thanks again, Mike, for bringing up this issue. This is already resolved. You would need to download the master branch. It will download a zip file containing the updated functions. You then need to replace the EEGLAB/plugins/get_chanlocs directory with the content of the downloaded zip file.

Please reach out if you have any other issues here or via email.

Best, Yahya