How can I prepare an EEG digitizing file to be imported to BS?

Hi Francois,

I have some .csv files generated by an EEG digitizer from Localite. Would you please how I can transform the location data into any format such as .mat file that BS can automatically recognize and import? One of the csv file is attached.

Thank you!
-Kai

Pre-digitize_RAS.csv (2.7 KB)

If you remove the first line and change the file extension into .pos, you can import these positions with the file format "EEG: Polhemus".

Is this a standard file format generated by a commercial software?
In this case, I could add it to the Brainstorm distribution.
Could you give me precise specification for the device and the acquisition software?

Thanks

Thanks Francois for the prompt reply. It works!

Yes,it is generated by a commercialsoftware called Localite.It is a TMS Navigator. The company is Localite GmbH, www.localite.de (http://www.localite.de/)

Hi Francois,

In addition to the EEG digitizing file, we have another file containing three fiducials' coordinates also measured with Localite navigator. Would you please advise on how I can import to BS for increased accuracy? Thank you!

BaseMarker20190621131751004.xml (912 Bytes)

For information, at the end of February, we will test differents 3D devices (not initially dedicated to the localization of electrodes). I'm thinking of taking inspiration from the Brainstorm method....

@Kai_Yu Can you describe how these files are generated with your system?
When you digitize the electrodes positions, do you always get two output files: a .csv and a .xml file?
Are the file names automatically set? Have you renamed one or the other?

Hi Francois,

This .xml file was generated by the Localite system automatically when we did the head registration. We used the letter "N" for nasion, "L" for LPA and "R" for RPA. The .csv file is for electrodes' locations, and the .xml file is for head's landmarks. They are not generated at the same time. But in our later experiment, we now put the landmarks' coordinates into the .csv file as well. The file name for the .xml file is automatically set. We customized the .csv file when we exported the electrodes' locations.

Thank you!
-Kai

I added a shortcut to allow reading easily the Localite .csv files: https://github.com/brainstorm-tools/brainstorm3/commit/819486e432c59d399f1a13049ba0a054d81377fa

When importing the electrodes locations, select the file format "EEG: Localite (.csv)".
I didn't add any support for the .xml files, as it is more confusing to read coordinates from multiple files.
If you are now including the NAS/LPA/RPA points in the .csv file, this would not be a problem.

For older acquisitions, you can simply copy-paste the coordinates of the fiducial points from the .xml to the .csv file, with any number at the beginning of the line.
For example, in the files you sent me you would need to add 3 lines at the end of the .csv file:

...
63,O2,22.90066424,-98.37024849,-21.00042277
0,NAS,0.36467236467234976,89.84472934472933,-4.97008547008548
0,LPA,-79.86324786324788,-0.9586894586894589,-52.377492877492884
0,RPA,79.13390313390312,-0.9586894586894589,-52.377492877492884

If the fiducial points are read correctly, the electrode cap should be aligned correctly with the head surface (example of your file on the MNI152 template):
image

Update Brainstorm to get this modification.

Wonderful!

Thank you so much Francois.

Hi Francois,

I recently noticed that when I import the head points, such NAS, LPA, RPA, the head point NAS usually cannot be imported automatically. The LPA and RPA can be recognized and imported well. How can I fix such an issue?

Thank you!
-Kai

Can you send me an example file, with the detailed sequence of operations you do with it, so I can reproduce this issue on my end?
Thanks

Hi Francois,

Here attached is the digitized file: RAS.csv (2.9 KB)

After loading the .eeg file, I then use the above file to import EEG position file. After this step, I "add points" in digitized head points. The BST will say "2 points are updated". When I "view head points", it seems only the NAS is not imported. But overall the electrodes alignment with the MR head model looks quite good. I want to let you know about this just in case that my procedure is not right.

Thank you!

The file you shared is correctly read by Brainstorm. There are 66 positions that are read.
The three fiducials NAS/LPA/RPA are identified correctly, used to compute the transformation to the SCS coordinate system (https://neuroimage.usc.edu/brainstorm/CoordinateSystems#Subject_Coordinate_System_.28SCS_.2F_CTF.29) and then removed from the list of channels.
This is done by the function channel_detect_type.m, put a breakpoint at the beginning of this function if you want to follow what happens in it: https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/sensors/channel_detect_type.m

The problem seems to be that the labels of the electrodes in this file (FP1, FPZ, ...) do not match the labels of the data channels in your recordings. The message "2 points are updated" means that only to electrodes where identified based on their names, all the others are not found in the .csv files and ignored.

Hi Francois,

Thanks for sharing your insights. I checked the labels, and all channels were matched. 63 channels were updated when I "import from file" in "Add EEG positions". The "2 points are updated" but rather "3 points are updated" took place only when I "Add points" in "Digitized head points". So I guess it should be something related to the three fiducials.

Can I understand your answer in this way that when I import the EEG digitization file, the 3 fiducials points NAS/LPA/RPA have already been imported? Is it still necessary to add points for "Digitized head points"?

Thank you!

Can I understand your answer in this way that when I import the EEG digitization file, the 3 fiducials points NAS/LPA/RPA have already been imported?

Yes, they are used to register the other 3D locations in the SCS coordinate system (to register the electrodes with anatomy).

Is it still necessary to add points for "Digitized head points"?

No.

Thank you!