Fieldtrip  includes a template headmodel based on the “Colin27” anatomical MRI. While this model is fine the way it is, there are some reasons why i do not like to use it.
Colin27 is not symetric and also only based on a single individual. This can cause problems when you visualize your sources on the MRI. Second, it is not a common template and this causes problems when you want to use a specific atlas, maybe more in tune with your research question. For example, FSL comes with a larg set of atlases, but they are all geared towards the ICBM152! It would make life easier if one could use a template headmodel which can easily use these atlases. So i made one, and i want to share it with you.
I used the „MNI152_T1_0.5mm.nii“ template included in FSL. Using Fieldtrips functions, i performed a segmentation, estimated a boundary triangle mesh and finally used the dipoli-method to construct a headmodel . You can find the code below. If you want to understand the process better, consider taking a look at fieldtrips tutorial on headmodel construction.
In the comments, the topic of adapting the code for indivual MRIs was discussed. Important for a sucessful implementation is finding an error in one of the steps. If you want to inspect your steps, you can try the following code.