Atlas for 1 year old infants

Thank you Francois, do you have subject for 10 years old ?

it is correct to exported the meg squid (extracted from vecterview example in bst ) exported to matlab and imported again with this new subject

if yes, as you see below the helmet a little bit flipping o the left

but yes thanks to the edit we can corret it

but fro the back ot seems the distance between sensor and scalp is big,

another question
image
image
despite that we have different type of sensor the display sensors have not the othe options
what should be the problem?

1 Like

Thank you Francois, do you have subject for 10 years old ?

Not yet. All the templates are available for download directly with your up-to-date Brainstorm installation, and documented here:
https://neuroimage.usc.edu/brainstorm/Tutorials/DefaultAnatomy#FreeSurfer_templates

A solution that could be interesting for you, since you have a list of digitized head points that covers all the head uniformly, is to warp a template (ICBM152 or Oreilly_24m) to these head points, after manual/approximate registration.
https://neuroimage.usc.edu/brainstorm/Tutorials/TutWarping

it is correct to exported the meg squid (extracted from vecterview example in bst ) exported to matlab and imported again with this new subject

I'm sorry, I don't understand what you are trying to do.
If you need help, please try to describe what you are doing, starting from an empty database.

but yes thanks to the edit we can correct it

You are not really supposed to move the MEG sensors around the head... If the subject was not sitting correctly in the MEG, artificially moving the sensors to a "better looking" position in Brainstorm on't change the position of the head that the sensors were actually recording.
In your screen captures, the head looks very far from the sensors, are you sure it was really like this? If so, you might not be recording a lot of brain signal.

but fro the back ot seems the distance between sensor and scalp is big,

The actual head (green digitized head points) is much bigger than the template your are using. Try warping your template to these points.

despite that we have different type of sensor the display sensors have not the othe options
what should be the problem?

You don't have 3D positions available for the STI/EOG/ECG data channels, therefore you can't display their positions in space. This is normal.

Hi @Francois

I have uploaded the revised templates at https://github.com/christian-oreilly/infant_template_paper/tree/master/Templates

I also added the brainstorm import script in this repository ( https://github.com/christian-oreilly/infant_template_paper/blob/master/import_to_brainstorm/import_template_to_brainstorm.m )

I looked at the ASEG, and they seem to import fine now. I am unclear how to proceed with the channel files though. When trying to add them, I got an error

BST> Error: Could not find measurement data:  
Error using fiff_read_meas_info (line 97) 
Could not find measurement data

Also, even if it would work, I am not sure that this would solve this matter. I think only one channel set can be loaded in a subject at a given time, right? If so, I cannot add the 4 different nodes to the subject and then save it as a template, right?

So, I short, I think the import script works for creating the template zip file, except for the montage part.

1 Like

I am unclear how to proceed with the channel files though. When trying to add them, I got an error

You can ignore this warning. Brainstorm expects to find recordings in FIF files. There are none, it complains, but it does not cause any additional problem.

I think only one channel set can be loaded in a subject at a given time, right?

No. You should create one subfolder for each template (and create one channel file per folder).
Also, you should start from an existing template, not from an empty structure.
The order of the digitized points in the .fif file should match the electrodes in the Brainstorm template (no other solution, since your 3D points are not named in the fif file...). Or we need to add some code to re-order them.

It seems that there are issues in the electrodes positions you provide (I tested only ANTS1-0Months3T):

  • The order of the electrodes is incorrect
  • The NAS/LPA/RPA does not seem correct (but I don't have your fiducials.mat so I can't test this part properly)
  • The size of the cap does not match the size of the head.

Below: your script modified to create one channel file per folder.

% Get EEG defaults folder
RefChannelPath = bst_fullfile(bst_get('BrainstormDefaultsDir'), 'eeg', 'ICBM152');

files = ...;   % Keep your original code
fid_dict = load('/home/christian/brainstorm_db/fiducials.mat');

delete '/home/christian/.brainstorm/defaults/anatomy/*'

for iSubj = 1:size(files, 1)
    % Create subject
    SubjectName = files(iSubj).name;  
    [sSubject, iSubject] = db_add_subject(SubjectName, [], 0, 0);
    % Import anatomy
    FsDir = bst_fullfile(files(iSubj).folder, files(iSubj).name);
    sFid = ...;   % Keep your original code
    import_anatomy_fs(iSubject, FsDir, 15000, 0, sFid);
    
    % Create folder for channel file
    for iMontage = 1:5
        switch iMontage
            case 1
                MontageName = '10-5';
                RefChannelFile = 'channel_ASA_10-05_343.mat';
            case 2
                MontageName = '10-10';
                RefChannelFile = 'channel_10-10_65.mat';
            case 3
                MontageName = '10-20';
                RefChannelFile = 'channel_10-20_19.mat';
            case 4
                MontageName = 'HGSN128';
                RefChannelFile = 'channel_GSN_HydroCel_128_E1.mat';
            case 5
                MontageName = 'HGSN128';
                RefChannelFile = 'channel_GSN_HydroCel_128_E001.mat';
        end
        % Load reference channel file
		RefChannelMat = in_bst_channel(bst_fullfile(RefChannelPath, RefChannelFile));
		FolderName = file_standardize(str_remove_parenth(RefChannelMat.Comment));

		% Create new folder
		iStudy = db_add_condition(SubjectName, FolderName);
		sStudy = bst_get('Study', iStudy);
        
        % Read channel file
        FifMat = import_channel([], bst_fullfile(FsDir, [MontageName '-montage.fif']), 'FIF', 0, 0, 0);

        % Create destination channel file
        ChannelMat = RefChannelMat;
        ChannelMat.SCS.LAS = FifMat.HeadPoints.Loc(:,1);
        ChannelMat.SCS.NAS = FifMat.HeadPoints.Loc(:,2);
        ChannelMat.SCS.RPA = FifMat.HeadPoints.Loc(:,3);
        for i = 15:size(FifMat.HeadPoints.Loc, 2)
            % TODO: Fix order of electrodes
            if (i-14 <= length(ChannelMat.Channel))
                ChannelMat.Channel(i-14).Loc = FifMat.HeadPoints.Loc(:,i);
            end
        end
        ChannelMat.HeadPoints = FifMat.HeadPoints;
        % Re-Register based on NAS/LPA/RPA
        % ChannelMat = channel_detect_type(ChannelMat, 1, 0);

        % Save channel file
        ChannelFile = bst_fullfile(bst_fileparts(file_fullpath(sStudy.FileName)), RefChannelFile);
        bst_save(ChannelFile, ChannelMat, 'v7');
		db_reload_studies(iStudy);
    end

    bst_memory('UnloadAll', 'Forced');
    db_reload_subjects(iSubject);
    panel_protocols('UpdateTree');
    db_save();    
    
    export_default_anat(iSubject, subjectName, 1);    
end
1 Like

I will look into it, but these positions have been validated for every subjects (blue are electrodes, red are fiducial points):

These electrodes are already matched to the heads in the MRI Neurodevelopmental Database, which has been validate at many occasions. They have been further adjusted to the surfaces (slight adjustments on the order of 1-2 mm if I remember well so that they are optimally fit to the meshes) and then they have been re-validated by visualizing them as in the figure above. The image above is generated by importing meshes (separate ones for the head surfaces and the montages) in Blender, so if these were unaligned we would see it directly (I trust much more blender rendering of meshes than neuroimaging software since often neuroimaging works under some assumptions and apply transforms without this being always perfectly clear to the users... whereas blender just plots the 3D coordinated of the vertices and that's it). So the error is probably somewhere between the export function and the plotting in BS. This image is from the templates downloaded from the Git repo? I can download these (scalp surface and montage) and plot them with a meshing software (as barebone as possible) to check that these indeed fit if you'd like.

1 Like

A co-author currently working with these just let me know that "The montages claim to be in the head coordinate frame rather than the MRI coordinate frame". So that might cause the shift you are observing? Does it looks only like a translation issue or is there a scale issue too? It is hard to tell on the 2D rendering.

I am looking into it. Standby a moment and I'll send you and updated version so that you can check with the same code you did the previous figure.

1 Like

So the error is probably somewhere between the export function and the plotting in BS

There is an issue with registration in Brainstorm, based only on the NAS/LPA/RPA.
I don't know where you put them, but maybe your choice of points makes it much better already.

There is no head surface in the anatomy you posted. The head surface used here is the one reconstructed by Brainstorm, which might be shrunk by 1-2mm.
The template position we distribute with these templates must be projected on the head surface within the template (the brainstorm ones), not the ones you see in Blender.

The order must be fixed.

This image is from the templates downloaded from the Git repo?

Yes.
Loaded using the modified script I posted previously.

1 Like

Thank you all for the info that I was wondering about too - very useful . Thanks.

There is no head surface in the anatomy you posted.

Head surfaces are in

bem/inner_skull.surf 
bem/outer_skull.surf 
bem/outer_skin.surf

Let me know if there are issues in using these surfaces directly in Brainstorm. I think it would probably be best to re-use these ones if there are no issues about it because it would make the use of these templates more reproducible across tools.

The fiducials contains the standard BS brain fiducial points. I'll have a look at your comments and those from Eric Larson (who was telling me about the .fif file reporting being in "head" space instead of the "mri" space) and I'll prepare an updated version. I'll sent you a sample file for you to validate so that we can hammer down all the little things that can trip down BS before I generate a final version of these files.

Head surfaces are in bem/inner_skull.surf

Indeed, sorry I skipped that. You can load these surfaces directly with a right-click > Import surface > Select FreeSurfer and answer "NO" to the question about applying an additional transformation.

The corresponding script call, to be added immediately after import_anatomy_fs, it will also make them as default head/skull surfaces:

    % Import head surface
    BemFiles = {...
        bst_fullfile(FsDir, 'bem', 'inner_skull.surf'), ...
        bst_fullfile(FsDir, 'bem', 'outer_skull.surf'), ...
        bst_fullfile(FsDir, 'bem', 'outer_skin.surf')};
    [iNewSurfaces, BstBemFiles] = import_surfaces(iSubject, BemFiles, 'FS', 0);

The inner and outer skull surfaces from the bem folder look good, but the head (outer_skin) is too large (ANTS1-0Months3T):

Comparison between Brainstorm head surface (small one) and the outer_skin from the bem folder:
image image

Is this an error from the MNE watershed algorithm?
Or a copy-paste issue between different subjects?

The fiducials contains the standard BS brain fiducial points.

How were they estimated?
These ones need to be in Brainstorm MRI coordinates (the first line of coordinates in the Brainstorm MRI viewer).

co-author currently working with these just let me know that "The montages claim to be in the head coordinate frame rather than the MRI coordinate frame"

The coregistration in Brainstorm is independent from the original coordinate system of either the surfaces or the electrodes. Everything is converted to CTF/SCS coordinate system using the NAS/LPA/RPA, so as long as these points are correctly defined wrt the other files, there is no possible coordinate system issue.

These surfaces are extracted using cube marching algorithm + Laplacian filtering + post-processing steps from a volumetric BEM segmentation available directly in the MRI Neurodevelopmental Database (NMD) and it fit well to the original BEM segmentation file:

However, when I compare with the MRI directly, I observe something similar than you:

So the problem is apparently with the NMD BEM segmentation for this subject. I can forward this issue to John Richards who is in charge of the NMD. I'll put you in CC.

I think that this discussion involves various issues better captured by individual tickets than an ongoing forum discussion. Also, it involves issues that are not specific to Brainstorm, but that also MNE-Python, the MRI Neurodevelopmental Databased, etc. For these reasons, I will move the description of these issues and related discussion to the GitHub ticket system here: https://github.com/christian-oreilly/infant_template_paper/issues

Do you have MEG sensors for baby?

Do you have MEG sensors for baby?

Yoshio Okada does in Boston:
https://pubmed.ncbi.nlm.nih.gov/27782541/

example_infant_headpos.txt (8.6 KB)

Hi Francois,

I hope you are fine,

Kindly find in the attachment a txt file with positions of nasion and pre auricular points

213 = dig. point cardinal 1 ( -56.1, 0.0, 0.0) (pre auricular)

213 = dig. point cardinal 2 ( -0.0, 73.1, 0.0) (nasion)

213 = dig. point cardinal 3 ( 50.3, 0.0, 0.0) (pre auricular)

And the transformation matrix MEG helmet --> head

222 = transform device -> head

          0.996498 0.012818 0.082632

          -0.043777 0.921912 0.384919

          -0.071245 -0.387188 0.919244

          -2.438648 -0.905069 61.172241 (inv. 6.748720 24.550804 -55.682346)

I would like to ask you how can I load this txt file so that it coregister with the child subjects in Brainstorm,

Thank you in advance!
Best regards
Saeed

I don't have any clear guidelines for that, dealing with coordinate systems can be quite complicated. Since this is very site-specific and your file is not among the common MEG file formats, I won't be able to help you much with this task.
The easiest would be to ask the Elekta/MEGIN technical support for help in adding this information to your .fif file, and then process your modified file in Brainstorm. If you are also using MNE-Python, this is also something you might be able to do from there, and then save a new .fif file.

If what you are expecting to do is to add the extra digitized head points in the Brainstorm data structures in order to be able to run an "automatic registration based on head shape": you need to find a way to convert your digitized head points into the Brainstorm SCS coordinate system, and add them with the correct format in the HeadPoints field of the channel file.

@Saeed_Zahran
PS: Is the head of the baby really as far from all the sensors as your screen capture shows?
Can you really record anything from the baby's brain in this configuration?
When using an adult-size MEG for babies, isn't it better recommended to stick the baby's head close to one side of the helmet?

6 posts were split to a new topic: Modify transformation matrix in Elekta FIF recordings