Curry pom files

I noticed an issue when importing SEEG electrode positions in the code. the issue is in the following file
in_channel_curry_pom.m in the toolbox/io directory
the line with error is line 71:

ChannelMat.Channel(iChannel).Loc = [xyz(2); -xyz(1); xyz(3)];

it should be

ChannelMat.Channel(iChannel).Loc = [-xyz(1); -xyz(2); xyz(3)];

When pom files are generated in curry, the user can choose the coordinate system. Curry uses a subject coordinate system with LPS orientation as default based on definition of NAS, LPA, RPA. However, the POM file with locations of electrode contacts can be exported with multiple other coordinate systems. I found that the best one is to use the scanner LPS system as all other coordinate systems will need some other transformations if one wants to use them in brainstorm. Once the POM file is exported in scanner LPS then the above transformation will bring it back to the usual RAS coordinate system that is expected by Brainstorm.

The Curry user have to define the locations of electrodes using Curry tools then click coordinate and select scanner LPS in the native MRI world coordinate. The user can then export the POM file and import it to brainstorm. You have to make sure you select the same base MRI in the brainstorm and curry.

That is the only way I got the POM files to work in brainstorm. it works well now

Hope this helps

Hi @bigammar,

In a recent update we changed the expected coordinate system for Curry .pom files from LPS to RAS. This is now reverted in commit 27b162b. Since there is not way to infer the coordinate system that was used to export the POM files, we also made explicit that the Curry .pom (and .res and re3) files should be in LPS.

Update your Brainstorm instance to get this update

image


The coordinate system used in Brainstorm is the Subject Coordinate System (SCS), which is defined as ALS with its origin defined with the NAS, LPA and RPA fiducials. See this link.

With this said, the proposed change, is incorrect as it goes from LPS to RAS, but it must go to ALS, which is the expected in Brainstorm SCS

:x: [L, P, S] >> [-1, -2, 3] = [R, A, S]
:white_check_mark: [L, P, S] >> [-2, 1, 3] = [A, L, S]


FYI @chinmay.chinara

2 Likes

Hi Raymundo
You lost me in your first paragraph. Are you expecting Pom file to be in ras or lps? It sounds like you expect lps. If lps then what lps coordinate from curry (image, scanner, nas, etc..). The Pom file won’t give you enough information to translate the coordinate to the mri unless you adopt a full curry export of the head model which is not what I always need.

Since the only thing I need is the seeg contact location, I export in scanner lps and specify the mri as the reference scan and that does not localise correctly. The fix I suggested fixed the problem and localized electrodes correctly.

It really does not matter what coordinate system brainstorm uses here as the issue is translation from the curry coordinate system out. The Pom file import asks for Reference scan. The reference anatomy scan may have different fiducials than what was defined in curry. Unless you export the entire head model, you are stuck with the coordinates in the Pom file that don’t make much sense if you don’t know the location of the fiducials. Curry does not provide those in the Pom file. This is a source of issues in prior threads related to processing Pom files.
In curry the only coordinate system options that are well defined are the scanner coordinates in lps. All other coordinate system that you can export require knowing the transformation matrix from that coordinate system to the native mri space to allow you to use the seeg coordinates. I can’t find that information in any file except in the head model files which complicates the import situation.

In any case, I found the easiest way to import the electrode location that are localized in curry is to export in image scanner lps coordinate and transfer the locations to brainstorm using the Pom file after the edits I made to the import function. That might not work for importing the head model but I have not tried that. This solution works if you just want to import location of electrodes in scan world coordinates.

Hope that explains things.
Ammar

They are expected in LPS and 30-May-2024 version

ok but the code in the import file does not make use of the transformation information in the pom file that transform the coordinates of the contacts to the curry native coordinate system that correspond to the head model. I think that needs to be used if that is the intention of using the POM file. If that is not then intention then the whole import function will not work since there will be no correspondence between the curry coordinate system and brainstorm's system