Copying anatomy from one database to another database

Greetings,

I have a dataset in the few hundreds with children (ranging from 8 - 18 years old). I would like to perform source localization with an age-match template (available for every 0.5 years old).

To save time, I thought I would create a "dummy" database, where I imported and segmented each of the relevant age templates. I also imported the same EEG to calculate the head models. Then in my real database where I've imported all the EEG, for each subject, I'd copy the contents of the "anat" folder from the appropriate "dummy" database as well as the headmodel. This seems to work with the "anat" content, but then when trying to do source localization, I get an error with the head model about the pial_cortex_low not being found (it points to the "dummy" database, even after reloading by EEG database).

Are there any suggestions as to how I can solve this issue, or other workarounds to not have to do the head model for each individual when it's based on the same template?

Thanks.
Paul

Hello Paul,

This approach does not seem very practical as there are hundreds of duplicated files (i.e., each subject of the same age will have a copy of the anatomy for their age).

This is right, as the HM depends of an specific anatomy file.

Ideally, the database would be comprised by Subjects of the same age (same template), and all of them will use the Default anatomy, so only one copy of anatomy files will be needed. In this sense, if a new anatomy file is created (e.g. a surface with different number of vertices) this new file will be automatically available for everyone using the Default anatomy. In your current situation, you would need to copy again that file for everyone of the same age.

However, I understand that your real database comprised of subjects of multiple ages, right?
Is there are reason for which you need to have subjects from different ages in the same DB?

About the HM.
If you set the database where the subjects use the Default anatomy, computing the HM for the Group analysis (Default) Subject, and then copying it to all the subjects will be enough.

If each Subject in the DB has a copy of the anatomy files, you would need to:

  1. Copy the HM file for each Subject
  2. Create a Matlab script, that modifies the SurfaceFile file in the HM .mat file, to point towards their own copy of the anatomy file, i.e. SubjectXX/pial_cortex_low
    For this you can use the function bst_save()
% Absolute path to the HM model to modify
headModelFullPath = 'YOURDISK/.../Protocol/data/SubjectXX/pial_cortex_low';
% Relative path to their own anatomy file
headModelTmpMat.SurfaceFile = 'SubjectXX/pial_cortex_low';
% Overwrite the SurfaceFile field
bst_save(headModelFullPath, headModelTmpMat, [], 1);