open-discussion > error localizing electrodes
Showing 1-14 of 14 posts
Nov 19, 2012 02:11 AM | hannah kyllo
error localizing electrodes
I've attached a screenshot of an error I am having while localizing
electrode grids. The grids are localized properly, but are not
aligned with the surface of the brain after I strip the skull (in
image processing).
thanks for any ideas!
thanks for any ideas!
Nov 19, 2012 04:11 PM | Xenophon Papademetris
error localizing
electrodes
Can't see the attachment. You may want to upload the picture
somewhere and send a link to it. Having said this, it would be more
helpful if you could outline the procedure you use. My hunch is
that the electrodes are still in CT-space and need to be
transformed.
Nov 19, 2012 09:11 PM | hannah kyllo
RE: error localizing electrodes
I'll try re-sending the screenshot. It's as if the grid is hovering
above the surface of the brain, rather than on it. How do I
transform out of CT space?
Nov 20, 2012 02:11 PM | hannah kyllo
RE: error localizing electrodes
the most accurate placement I've been able to obtain is by
transforming the grid with the inverted matrix produced from
linearly registering MRI to CT, however it is far from exact (see
attached). any other ideas would be much appreciated.
Nov 20, 2012 03:11 PM | Magno Guillen
RE: error localizing electrodes
Hi Hanna,
I have been using the electrode editor for a while and it works pretty good. Eventually I got offset but it is due I was co registering the CT with a pre-op MR. If you co-register the CT with a post-op MR the result is very accurate.
In your case, did you use a pre or post- op MR? Did you double check the coregistered MR? Once I use the MR co-registered, the electrodes fall in position. Eventually I do a manual adjustment. But in general it works pretty well.
Based on your image it looks the MR space is different from the CT space where the electrode objects were generated.
Cheers
Magno
I have been using the electrode editor for a while and it works pretty good. Eventually I got offset but it is due I was co registering the CT with a pre-op MR. If you co-register the CT with a post-op MR the result is very accurate.
In your case, did you use a pre or post- op MR? Did you double check the coregistered MR? Once I use the MR co-registered, the electrodes fall in position. Eventually I do a manual adjustment. But in general it works pretty well.
Based on your image it looks the MR space is different from the CT space where the electrode objects were generated.
Cheers
Magno
Nov 20, 2012 04:11 PM | hannah kyllo
RE: error localizing electrodes
The MR I'm using is pre-op, but I've co-registered to CT. I'll try
using post-op, and double-checking the registration. thanks!
Nov 21, 2012 02:11 AM | Xenophon Papademetris
RE: error
localizing electrodes
You are probably looking at the effect of brain deformation as a
result of putting stuff in the brain.
The best procedure is:
Nonrigid mapping between preop MRI and postop MRI (we do this using stripped MRIs)
Rigid mapping between postop MRI and postop CT (use unstripped images for this one)
Then invert both transformation (the nonrigid one .grd will take a while) and concatenate them in the ElectrodeEditor transform Grid tool to move the electrodes back.
Xenios
The best procedure is:
Nonrigid mapping between preop MRI and postop MRI (we do this using stripped MRIs)
Rigid mapping between postop MRI and postop CT (use unstripped images for this one)
Then invert both transformation (the nonrigid one .grd will take a while) and concatenate them in the ElectrodeEditor transform Grid tool to move the electrodes back.
Xenios
Nov 21, 2012 06:11 AM | Markus Mertens
RE: error localizing electrodes
I am using the electrode editor for several months without problems
now. But I remember similar problems in the beginning. Usually I
did localize the electrodes in the original CT, not the
coregistered one. My recipe to visualize electrode grids is the
following:
1. Make sure you coregister the low resolution image (CT) with the high resolution image (MR). The high resolution image should not be changed.
2. Make sure the original CT has a different name than the coregistered CT. I do append "_coreg" to the name of the coregistered CT.
3. Localize the electrodes in the coregistered CT (i.e. *_coreg). This is the most important step!
4. Extract the brain from the original MR.
5. Load the extracted brain from the original MR into the electrode editor.
Now the position of the electrodes should match the correct positions very well if (!) the original MR was a post-OP image. Because in this case the effect of a subdural hematoma (a locally "squeezed" brain) will already be taken into account. In a pre-OP MR image the electrodes would appear a bit below the surface.
Just a last remark: I use FSL/flirt for step 1 and FSL/bet for step 4.
I hope this helps,
Markus
1. Make sure you coregister the low resolution image (CT) with the high resolution image (MR). The high resolution image should not be changed.
2. Make sure the original CT has a different name than the coregistered CT. I do append "_coreg" to the name of the coregistered CT.
3. Localize the electrodes in the coregistered CT (i.e. *_coreg). This is the most important step!
4. Extract the brain from the original MR.
5. Load the extracted brain from the original MR into the electrode editor.
Now the position of the electrodes should match the correct positions very well if (!) the original MR was a post-OP image. Because in this case the effect of a subdural hematoma (a locally "squeezed" brain) will already be taken into account. In a pre-OP MR image the electrodes would appear a bit below the surface.
Just a last remark: I use FSL/flirt for step 1 and FSL/bet for step 4.
I hope this helps,
Markus
Nov 26, 2012 04:11 PM | hannah kyllo
RE: error localizing electrodes
this is the process I have used as well, although with pre-op MRI
and post-op CT. Would post-op MRI reduce the difference in
localization enough?
Nov 26, 2012 04:11 PM | Xenophon Papademetris
RE: error
localizing electrodes
Yes. Doing a nonlinear registration between the preop MRI to the
post of MRI and then a linear mapping from post op MRI to post op
CT will improve things as it will account for the deformation of
the brain caused by the implantation.
Jul 8, 2013 01:07 PM | Joshua Ehrenberg
RE: error localizing electrodes
Do you have any guidance on modifying the ElectrodeExportAsText
module to customize the output to be
[Electrodename][electrodenumber] delimiter [xcoor] delimterer
[ycoor] delimeter [zcoor] so it can be used in other matlab
programs (ie EEGLAB or brainstorm)?
Andrew
Andrew
Jul 13, 2013 12:07 PM | Xenophon Papademetris
RE: error
localizing electrodes
Andrew - sorry for the delay - I am on the road. This is doable. If
you sent an example text file we should be able to modify the
output (once I get back to the office). [ Or more likely write a
quick script to reformat the existing output].
Xenios
Xenios
Jul 18, 2013 07:07 PM | Joshua Ehrenberg
RE: error localizing electrodes
Thank you Sir. Just tell me when and where to email it and I
will. I really appreciate it.
I attached the matlab version of an electrode file, but it will be fine if it is in text format like above.
I attached the matlab version of an electrode file, but it will be fine if it is in text format like above.
Jul 18, 2013 07:07 PM | Xenophon Papademetris
RE: error
localizing electrodes
Xenophon dot Papademetris at yale dot edu