Back to the main page.

Bug 3286 - bioimage suite electrodes are displaced

Status CLOSED FIXED
Reported 2017-04-21 09:02:00 +0200
Modified 2019-08-10 12:41:00 +0200
Product: FieldTrip
Component: fileio
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P5 normal
Assigned to: Arjen Stolk
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2017-04-21 09:02:19 +0200

this was already discussed in https://github.com/fieldtrip/fieldtrip/pull/342, but has not been resolved yet. Please have a look at the figure produced by test_pull342 (which I will attach). Neither the electrodes are where I expect them, nor the MRI. I think that the post-processing of bioimage suite data needs documentation on the fieldtrip wiki.


Robert Oostenveld - 2017-04-21 09:02:56 +0200

Created attachment 835 screen capture of figure based on test data


Arjen Stolk - 2017-04-24 04:00:26 +0200

I remember there was a trivial explanation for it, in the likes of plotting the wrong electrode-scan combination. But let me double check with Sandon.


Sandon Griffin - 2017-04-25 22:23:09 +0200

Hi Robert, Arjen BioImage Suite electrode positions are stored in what they refer to in their manual as "X, Y, Z coordinates," which use mm as units and one of the corners of the volume as the origin; which corner that is depends on the orientation of the scan (e.g., LPS), which is set by the user in a separate window in BIS and is also not stored anywhere in the .mgrid file. The X,Y,Z coordinates are basically a voxel-size-corrected version of the voxel coordinates (i.e., if voxel size = 1x1x1mm, then voxel coordinates = X,Y,Z coordinates). It's important to note that these "X, Y, Z coordinates" are always positive and that BIS indexes points in the scan solely based on their voxel coordinates, so defining a standard coordinate system for a scan before you load it into BIS does not change anything. Therefore, scans that were used to place electrodes in BIS may not have a standard coordinate system, which would explain why the scan appears in some weird head space when you call ft_determine_coordsys. Since all the read_bioimagesuite_mgrid function does is spit out the X,Y,Z coordinates from the .mgrid file, it make sense that all of the electrodes in the image you attached are where they are. They are not aligned with the scan because the scan is in some undefined head coordinate space (which BIS ignores), and the electrode positions are in this "X,Y,Z" coordinate space, where only positive values can exist. In order to get the electrodes in the same space as the scan, they need to first be defined in voxel coordinates, which can be done by adjusting for their positions based on voxel-size. And then the same transformation matrix for the volume must be applied to these voxel positions. These additional steps are performed in the bis2fieldtrip wrapper function. Hopefully that explains why things are appearing so different from what you would expect. If so, I can write something like this up on the fieldtrip wiki. Best, Sandon


Arjen Stolk - 2017-04-26 02:36:11 +0200

We will indeed add this documentation to the wiki linking to the ms once its out.


Robert Oostenveld - 2017-04-26 10:00:16 +0200

(In reply to Sandon Griffin from comment #3) I propose to make http://www.fieldtriptoolbox.org/getting_started/bioimage_suite and to link to that page from http://www.fieldtriptoolbox.org/getting_started


Robert Oostenveld - 2019-08-10 12:34:50 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue on https://github.com/fieldtrip/fieldtrip/issues.


Robert Oostenveld - 2019-08-10 12:41:00 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue on https://github.com/fieldtrip/fieldtrip/issues.