Spatial transformation from LPS coordinate system to SCS/CTF

Hi !


I'm learning to manipulate SEEG data and Brainstorm software. For each electrode I used 3D Slicer to obtain the coordinates of each contact. I obtained a .mark.json or .json file for each electrode.

I then worked on Brainstorm, imported my T1 file, CT coregistered and followed the tutorials. After linking my raw data file (Review raw file) I can see my 173 channels. I now want to import the positions of my contacts calculated with 3D Slicer into Brainstorm.

Unable to import the .json files, I created a .txt file from the result describing the position of each electrode, taking care to put the exact name of the contact as it appears in my channel file, and in the same order.

I managed to import my text file and associate it with each electrode in the channel file. I can now display my electrodes on the MRI scan, but I realize that the coordinate systems are not the same. From what I understand, my positions retrieved via 3D Slicer are in the LPS (Left, Posterior, Superior) coordinate system, while Brainstorm uses the SCS/CTF format.

I see on Brainstorm that the electrodes are implanted from the back to the front of the skull, whereas it should be from the right to the left.

Is there a way to perform a spatial transformation once my data has been imported into Brainstorm? Do I need to perform the transformation elsewhere, and if so, do you have any software to recommend? More generally, is there a way of importing positions directly from 3D Slicer without converting them to a text file?

Thank you in advance for your answers.

Hi @fl4276,

Currently there is no way to directly import .json files from 3D Slicer and it is in the pipeline but not at priority right now.

Transformations can be very tricky so what I would suggest maybe you can play around with the coordinate system transformations using the Brainstorm function cs_convert as in the tutorial: More details for the function can be found in the comments of the respective code.

Also there is some similar discussion that happened in the past Maybe you can get some ideas from this.

Let us know how it goes for you.

As @chinmay.chinara mentioned, in Brainstorm it is possible to convert between different coordinate systems with the function cs_convert(). While LPS is not one of the supported systems, RAS is supported. Convert the LPS to RAS, then you can check if the coordinates point to the desired location by using the RAS coordinates as XYZ MRI coordinates in the MRI viewer figure. Click on the button iconViewScoutInMri to introduce the coordinates.

Hello @Raymundo.Cassani ans @chinmay.chinara, many thanks for your help and sorry for the delay in my replay, I was asked to work on another project for few weeks, back into my brainstorm analysis since few days.

I finally succeed (i believe) to convert my LPS coordinates system from 3D slicer into MNI Brainstorm system. I follow your procedure :

  • Extract LPS coordinates from 3D Slicer
  • Convert LPS into RAS coordinate (2 axes shifting)
  • Convert from millimeter to meter my coordinates
  • Use the matlab brainstorm fonction cs_convert(sMRI, ‘MNI’, ‘SCS’, MatrixCoordinates)

Electrodes seems to be on the right side and right place so i'am happy! Thanks it was not trivial.

I'm back with another challenge for my analysis... I just post it here : Mark epochs of interest from a list of timestamps extracted from matlab

if you still have energy to help!

Many thanks,