Back to the main page.

Bug 2138 - reading of updated atlas from wfu_pickatlas does not work

Status CLOSED FIXED
Reported 2013-04-26 11:05:00 +0200
Modified 2013-09-18 13:19:13 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also:

Johanna - 2013-04-26 11:05:29 +0200

I recently updated (with Marek's help) the aal_MNI_V4 file in /home/common/matlab/spm8/toolbox/wfu_pickatlas since the old file had a bug in the actual label names. The old call to ft_prepare_atlas on the old file still works, since it finds the .mat file: cfg=[]; cfg.atlas='/home/common/matlab/spm8/toolbox/wfu_pickatlas/MNI_atlas_templates/legacy/aal_MNI_V4.img'; atlas=ft_prepare_atlas(cfg); Line 583 [if exist(filename1, 'file')] is true, in ft_prepare_atlas. However, with the new version of aal_MNI_V4, neither ft_prepare_atlas (scheduled to be deprecated) or ft_read_atlas work on the new file, due to weirdness (unexpected behaviour) of the variable C (either C = textscan(tline,'%s'); in ft_prepare_atlas, or C = textscan(fid, '%s%s%d'); in ft_read_atlas). cfg=[]; cfg.atlas='/home/common/matlab/spm8/toolbox/wfu_pickatlas/MNI_atlas_templates/aal_MNI_V4.nii'; atlas=ft_prepare_atlas(cfg); ??? Index exceeds matrix dimensions. Error in ==> ft_prepare_atlas at 617 num = C{1}{3}; OR atlas=ft_read_atlas('/home/common/matlab/spm8/toolbox/wfu_pickatlas/MNI_atlas_templates/aal_MNI_V4.nii'); ??? Subscript indices must either be real positive integers or logicals. Error in ==> ft_read_atlas at 97 atlas.tissuelabel(idx) = lab;


Jörn M. Horschig - 2013-06-04 15:30:43 +0200

ft_prepare_atlas is an easy fix, just change C{1}{3} to C{1}{1}, that should work with all spm/wfu_pickatlases: svn ci ft_prepare_atlas.m -m "bugfix #2138 - WFU atlas reading works again" Sending ft_prepare_atlas.m Transmitting file data . Committed revision 8179. ft_read_atlas was apparently fixed by JM (CC) already Sorry Robert if I intervene your work here and sorry if I was too impatient, but I just fixed this and it seemed obvious to also commit it then. Please reopen if some other errors pop up


Robert Oostenveld - 2013-09-18 13:19:13 +0200

closed multiple bugs that have been resolved