Git Product home page Git Product logo

infant_template_paper's People

Contributors

christian-oreilly avatar ftadel avatar larsoner avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

infant_template_paper's Issues

Integration with Brainstorm

Initial work on this topic has been discussed here:
https://neuroimage.usc.edu/forums/t/atlas-for-1-year-old-infants/15475/71

There are currently some issues with the co-registration of the montage and the surfaces in
Brainstorm. From previous email exchange with @ftadel and @larsoner

Hi Eric & Christian,

As I wrote in the forum thread (https://neuroimage.usc.edu/forums/t/atlas-for-1-year-old-infants/15475/70):
The coregistration in Brainstorm is independent from the original coordinate system of either the surfaces 
or the electrodes. Everything imported to Brainstorm is converted to CTF/SCS coordinate system using 
the NAS/LPA/RPA (https://neuroimage.usc.edu/brainstorm/CoordinateSystems), so as long as these points 
are correctly defined in the MRI and in the montage file (ie. in the same coordinate system as the rest of 
the 3D points in the same file), there is no possible coordinate system issue once imported in Brainstorm.
=> You can use the coordinate system you want in the montage.fif files.

The current issues (documented in the forum thread):

    

1. The bem/outer_skin surface is too large wrt to the other bem surfaces and the MRI
2. The coordinates in the .fif files are not labelled (impossible to know which electrode they 
correspond to)  => It would be much easier and efficient to transfer these files between programs 
if they were simple text files, one 3D point per line, "Name X Y Z" (and you can add an extra 5th column 
Type if you can't derive it from the name of the point). Like the Polhemus files... all the complexity of the 
FIF files does not bring anything good here, especially if the coordinate system is not even the one 
documented in the FIF structure.
    If you want something truly portable, use the BIDS electrodes.tsv specification, it would be good 
for you to have an export function to this format in any case:
    https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/03-electroencephalography.html#electrodes-description-_electrodestsv
3.    The NAS/LPA/RPA positions for the import of the MRI+surface must be defined in 
Brainstorm MRI coordinates (this is only annoying part that might require extra manual work)


Could we keep this discussion going somewhere it's archived, organized and accessible 
by others - instead of via  emails? (either the Brainstorm forum thread referenced above or a
new brainstorm or MNE github issue)

Cheers
Francois

BEM surfaces are too large

The BEM surfaces in the templates are still a bit too expanded.

Example with the skin surface (1month):

  1. outer_skin.surf from the template:
    image

  2. Skin surface reconstructed from the MRI with Brainstorm:
    image

Therefore, the EEG electrode positions in the template are not fitted on the skin, they are floating a few millimeters away from the skin:
image

All the other BEM layers are also too large. Example of inner_skull.surf:
image

The same is observed for all ages, example of inner_skull.surf on 24months:
image

ENH: Put volume templates in `mri` directory

It's useful to have all volumes in the mri directory, rather than their own atlases directory, because it facilitates things like warping subjects to digitization (MNE for example warps an mri/*.mgz). So if instead of putting them in atlases we can make them mgz with something like:

mri_convert atlases/brain_ANTS_IXI_atlas_head_space.nii.gz mri/brain_ANTS_IXI_atlas_head_space.mgz

then things work at the MNE end like they should.

Not sure if it's worth cutting a 0.2 just for this but it's probably worth adding to the scripts. I can make a PR for this if you want @christian-oreilly

BEM / MRI / Surfaces co-registration

As noted by @ftadel, the head surfaces for the 1 mo time point are not accurate with respect to the average head MRI (the three yellow lines should represent the scalp, the inner skull, and the outer skull surfaces):

Screenshot from 2020-11-11 09-56-01

Upon closer examination, the extracted surfaces follow the BEM4 segmentation as well as could be expected:

Screenshot from 2020-11-11 09-55-22

So it seems that in this case the issue comes from the original BEM4 file not being very faithful to the head average MRI.

strange label boundaries in 6mo parcellation

if I run this:

import mne

subject = mne.datasets.fetch_infant_template('6mo')

Brain = mne.viz.get_brain_class()
brain = Brain(
    subject, hemi='split', surf='inflated', size=(1200, 1200),
    cortex='low_contrast', views=['lateral', 'medial', 'ventral'],
    background='white')

strange_labels = ('isthmuscingulate', 'entorhinal', 'parahippocampal')
regexp = '|'.join(strange_labels)
labels = mne.read_labels_from_annot(subject, 'aparc', regexp=regexp)
for label in labels:
    brain.add_label(label, alpha=0.4)
brain.add_annotation('aparc')
brain.save_image('strange_aparc.png')
brain.close()
del brain

I end up with this image:

strange_aparc

The large medial wall label I've highlighted purple is isthmuscingulate which looks really different from expectations. parahippocampal (just below, in green) and entorhinal I'm less sure about (though I notice that rh-entorhinal doesn't even exist for this brain). For comparison, here is what happens if I simply morph the aparc labels from fsaverage onto this brain:

morphed_aparc

Downsampling

As reported by @larsoner in email exchanges:

The 5120-tri BEM surfaces do not have the same triangle definitions as the standard MNE ICO surface. This indicates that they were downsampled by something other than FreeSurfer routines, so some guarantees that are usually there (e.g., can be downsampled to lower ICO, normals point outward, etc.) may not be satisfied. Maybe it's worth using the FreeSurfer downsampling routines to downsample them rather than mne.decimate_surface (which uses VTK)

Integration with MNE

In order to integrate the templates with MNE, we would want to compute and add to the templates the following artifacts:

  • SUBJECT/bem/SUBJECT-5120-5120-5120-bem-sol.fif
  • SUBJECT/bem/SUBJECT-5120-5120-5120-bem.fif
  • SUBJECT/bem/SUBJECT-fiducials.fif
  • SUBJECT/bem/SUBJECT-head.fif
  • SUBJECT/bem/SUBJECT-oct-6-src.fif (maybe?)
  • SUBJECT/bem/SUBJECT-vol-5-src.fif (maybe?)

BUG: Files not available on git clone

I'm working toward #2 and can no longer git clone:

larsoner@bunk:~/python$ git clone [email protected]:/christian-oreilly/infant_template_paper.git
Cloning into 'infant_template_paper'...
remote: Enumerating objects: 61, done.
remote: Counting objects: 100% (61/61), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 1261 (delta 5), reused 46 (delta 4), pack-reused 1200
Receiving objects: 100% (1261/1261), 649.52 MiB | 43.55 MiB/s, done.
Resolving deltas: 100% (113/113), done.
Downloading Templates/ANTS1-0Months3T.zip (336 MB)
Error downloading object: Templates/ANTS1-0Months3T.zip (0b47676): Smudge error: Error downloading Templates/ANTS1-0Months3T.zip (0b4767620a442f02f196c9618709cc4eb19abba1481d8f3e65837a18ed84af14): batch response: Git LFS is disabled for this repository.

Errors logged to /home/larsoner/python/infant_template_paper/.git/lfs/logs/20210112T115423.922689879.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: Templates/ANTS1-0Months3T.zip: smudge filter lfs failed
  1. Any ideas @christian-oreilly ? Based on some light searching this suggests that GitHub might have killed your uploads because they are over some quota (?).
  2. Are the .zip files you made just the contents immediately preceding the removal of the files from the repo? If so then I can at least still make progress on #2 while the LFS stuff is sorted out.
  3. Any idea if there will be direct-download URLs available? It would be nice if users can directly download the .zip files from somewhere, that way end-users don't need git plus git-lfs on their systems...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.