Back to the main page.

Bug 2006 - ft_prepare_sourcemodel: consider support for atlas-based parcellation

Reported 2013-02-23 12:30:00 +0100
Modified 2014-02-12 10:34:11 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Jan-Mathijs Schoffelen
Depends on:
See also:

Jan-Mathijs Schoffelen - 2013-02-23 12:30:39 +0100

for the creation of individual 3D grids.

Jan-Mathijs Schoffelen - 2013-02-25 11:10:38 +0100

After discussing this with Alex, the following seems to make sense as an extension to the warpmni method in ft_prepare_sourcemodel. -make the template MRI explicit: default will still be T1.nii -allow for an added volumetric segmentation that represents an atlas. This atlas should either be defined in the same coordinate system as the template MRI (i.e. MNI space), or in the subject specific coordinate system. The former makes most sense. -pass on the segmentation info to the sourcemodel.

Alexander Backus - 2013-02-25 13:28:59 +0100

Created attachment 426 MRI structure with two regions of interest dim: [151 188 154] hdr: [1x1 struct] transform: [4x4 double] unit: 'mm' roi: [151x188x154 double] roilabel: {'rightHPC' 'leftHPC'}

Alexander Backus - 2013-02-25 13:29:31 +0100

(In reply to comment #2) MNI space!

Jan-Mathijs Schoffelen - 2013-03-06 16:51:11 +0100

svn commit -m "enhancement - allow in general for segmentations in cfg.mri, not only tpms but also atlas-based segmentations" ft_prepare_sourcemodel.m utilities/ft_datatype.m Sending ft_prepare_sourcemodel.m Sending utilities/ft_datatype.m Transmitting file data .. Committed revision 7598.

Jan-Mathijs Schoffelen - 2013-03-06 17:00:21 +0100

Alex, Ik heb ft_prepare_sourcemodel aangepast. Je zou nu in twee stappen een ROI-gebaseerd bronmodel kunnen bouwen. stap 1: load bug2006_roimri cfg = []; cfg.mri = bug2006_roimri; cfg.grid.resolution = 0.5; cfg.smooth = 2; templategrid = ft_prepare_sourcemodel(cfg); cfg = []; cfg.grid.template = templategrid; cfg.grid.nonlinear= 'yes'; cfg.warpmni = 'yes'; sourcemodel = ft_prepare_sourcemodel(cfg); Dit veronderstelt vooralsnog dat de template MRI gealigned is met de MRI waar de ROI van bepaald is. Misschien zou je het eens kunnen testen.

Alexander Backus - 2013-09-23 16:45:09 +0200

(In reply to comment #5) The suggested steps worked in March 2013. Now, ft_prepare_sourcemodel seems to not support this function anymore, by only allowing regular 3D grids to be warped to MNI space. Here is the current code for the generalized atlas approach (AAL in this case). _______________________ % load atlas cfg = []; cfg.atlas = fullfile('fieldtrip','template','atlas','aal','ROI_MNI_V4.nii'); atlas = ft_prepare_atlas(cfg); % dirty fix segatlas = ft_datatype_segmentation(atlas); segatlas.brick0label =; % create grid based on atlas cfg = []; cfg.mri = segatlas; % may also be debugged with the supplied bug2006_roimri file cfg.grid.resolution = 0.5; cfg.smooth = 2; templategrid = ft_prepare_sourcemodel(cfg); % warp the grid cfg = []; cfg.grid.template = templategrid; cfg.grid.nonlinear = 'yes'; cfg.warpmni = 'yes'; %cfg.mri = segmentedmri; % some segmented mri in native subject space needs to go here??? sourcemodel = ft_prepare_sourcemodel(cfg); % ERROR HERE: no vol; if I supply a segmented mri, the grid will lose all its anatomical labels and is converted to a regular 3D grid.

Alexander Backus - 2013-09-24 13:45:31 +0200

(In reply to comment #6) (In reply to comment #6) Fixed: Now it's: cfg.grid.warpmni = 'yes'; Instead of (the earlier): cfg.warpmni = 'yes'; Sorry :-)

Jan-Mathijs Schoffelen - 2013-11-29 10:22:25 +0100

As far as I can see, this is now supported.