Automatic Head Model including 1010-System / Electrode Placement
-
The latest release 8.2 includes a new function to predict the landmarks needed to place the 10-10-system on the skin:
Predict1010SystemLandmarks
The landmarks are the nasion, inion, and left/right pre-auricular points. Sim4Life now can predict these directly from a T1w MRI.The following script demonstrates the whole process:
from ImageML import Predict1010SystemLandmarks from s4l_v1.model import Vec3, Import, Create1010System, PlaceElectrodes, CreateSolidCylinder from s4l_v1.model.image import HeadModelGeneration, ExtractSurface img = Import(r"D:\datasets\IXI-T1\IXI021-Guys-0703-T1.nii.gz")[0] # segment head, skip adding dura, labelfield = HeadModelGeneration([img], output_spacing=0.6, add_dura=False) # extract surfaces from segmentation surfaces = ExtractSurface(labelfield) surfaces_dict = {e.Name: e for e in surfaces} skin = surfaces_dict["Skin"] # predict landmarks, the function returns a list of Vertex entities verts = Predict1010SystemLandmarks(img) pts = {e.Name: e.Position for e in verts} eeg1010_group = Create1010System(skin, Nz=pts["Nz"], Iz=pts["Iz"], RPA=pts["RPA"], LPA=pts["LPA"]) eeg1010_dict = {e.Name: e for e in eeg1010_group.Entities} # create template electrode and place it at C3 position electrode_template = CreateSolidCylinder(Vec3(0), Vec3(0,0,5), radius=10) electrodes = PlaceElectrodes([electrode_template], [eeg1010_dict["C3"]])
For the image used in this example, the result looks like this:
-
I tried to repeat what the script is doing here:
Youtube VideoTo predict the 4 landmarks:
- Select the MRI (T1-weighted image)
- Select the Head-Modeling -> Auto-Label tool
- Under Inference Task choose the 10-10-system landmarks, press Run button
You then
- segment the head (choose the Head40 "Inference Task" in the Auto-Label tool)
- extract surfaces from the labelfield,
- select the skin and the landmarks
- run the Head Modeling -> 10-10 System tool: this creates the local coordinate system points for each 10-10 system point
- select your template electrode and the 10-10 system points
- run the Head Modeling -> Electrode Placement tool
-
@bryn Thank you very much for your help. I successfully completed the TI simulation, but I found that the simulation results for the two single-electrode pairs are not completely symmetrical. The maximum electric fields they generate in the GM are 0.0933 V/m and 0.0882 V/m, respectively. My method was to clone the two LF-Electro Ohmic Quasi-Stat simulations, modifying the frequency and boundary conditions for each. The electrode pairs I chose are F5-P5 and F6-P6. Is my approach correct, or should I consider using a multi-port simulation instead?
-
Hi @lucky_lin Did you update the grid before running the first simulation? And did you make any changes to the model after setting the grid for the first simulation?
If possible, please share your project with us at s4l-support@zmt.swiss, and we will take a look. -
Did you check the segmentation? Is the head symmetric? Are there differences between left/right, e.g. thinner skull, holes in the CSF or Dura, etc.
If there are holes, and these seem to be the cause of the asymmetry, maybe reduce the
output_spacing
to the default 0.3mm. The valueoutput_spacing=0.6
set above in the script could be too coarse to resolve certain thin tissues.Do the the electrodes seem symmetrically placed wrt the anatomy?
Did you check the simulation voxels? Is there something "asymmetric" about the voxels?
-
@lucky_lin "Other tissues" is basically fat. I don't think this is an issue.
Note, that the head is not perfectly aligned with the axis, i.e. your XY plane may not be perpendicular to the "up" direction. You can also change the slice by using the interactive slice instead of axis-aligned.
Finally. Yes, it is normal that real subjects/people have asymmetrical features. If you are interested in the research question, you could test the impact of individual tissues (conductivity) by
- assigning the same tissue property to all tissues (except for Air?). Is this nearly/more symmetrical?
- assigning the same tissue property to all tissues, except for one tissue (and Air). Candidates are the thin layers around the brain, e.g. Dura, CSF, Brain grey matter, Skull cortical/cancellous, [Galea, Muscle, ...].
-
@bryn I tried to set both the rotation and translation of T1W to 0 and then generate the reference point, but it reported an error: Modeler : [Error] Exception during import: Expecting 'Version 1.0' on first line Modeler : [Error] operation unsuccessful.
-
The T1w image is placed in world (scanner) coordinates. This is useful, e.g. to align different acquisitions (e.g. T1, T2 with different resolutions or field of view).
You could remove the rotation and translation, e.g., by setting an identity transform. However, in my experience, it is often useful to preserve the position in world coordinates.
img = XCoreModeling.Import("some_t1w_mri.nii.gz") img.Transform = XCoreModeling.Transform()
-
I don't understand what you are doing. The error looks like Sim4Life cannot parse the .pts file produced by the landmark predictor.
- did you edit the .pts file manually?
- where/how did you set the rotation/translation to "0"?
- did you try to set the transform [to zero] (before running the prediction) as suggested in my last post?
-