Back to the main page.
Bug 1529 - unexpected behavior of ft_plot_ortho
Status | CLOSED FIXED |
Reported | 2012-06-13 17:17:00 +0200 |
Modified | 2012-08-23 10:48:22 +0200 |
Product: | FieldTrip |
Component: | plotting |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P3 normal |
Assigned to: | Jan-Mathijs Schoffelen |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Burkhard Maess - 2012-06-13 17:17:42 +0200
On 13 Jun 2012, at 14:35, Burkhard Maess wrote: I am still working on the import of freesurfer/MNE based MRI/headmodel/source spaces. I have checked this against the latest version (subversion update just a few minutes ago). Now, I have problems to understand ft_plot_ortho. As a warmup I loaded the spm template (part of ft-world): /external/spm8/templates/T1.nii The simplest call of ft_plot_ortho needed (at least in my case) variable arguments, which is against the idea (I think). I modified ft_plot_ortho accordingly (my version is attached). However, when giving the option ('transform') together with the transform stored in the T1.nii file the display changes in an unexpected way (sort of a zoom). Do you have any ideas why?
Jan-Mathijs Schoffelen - 2012-06-13 17:25:23 +0200
some code pasted below: %% Load the SPMtemplate mritem = ft_read_mri([ getenv('FIELDTRIP_MAINDIR') '/external/spm8/templates/T1.nii']); % mrichecked = ft_determine_coordsys(mritem) ; mritem.coordsys = 'spm'; % define the coordinate system (why is this not part of ft_read_mri %% Display the Anatomy via plot_ortho (defaults) figure('name','MRI TEM'); ft_plot_ortho(mritem.anatomy); %% Display the Anatomy via plot_ortho (at a certain location ) location_voxel = [46 64 37]; location_str = sprintf('x: %.0f y: %.0f z:%.0f',location_voxel(1:3)); figure('name',['MRI TEM VOX' location_str ]); ft_plot_ortho(mritem.anatomy,'location',location_voxel(1:3)); %% Display the Anatomy via plot_ortho (at the same certain location, using external transform ) location_mri = [0 0 0]; location_voxel = mritem.transform\[location_mri 1]'; location_str = sprintf('x: %.0f y: %.0f z:%.0f',location_voxel(1:3)); figure('name',['MRI TEM MRI EXTERN ' location_str]); ft_plot_ortho(mritem.anatomy,'location',location_voxel(1:3)); %% Display the Anatomy via plot_ortho (at the same certain location, using internal transform ) location_mri = [0 0 0]; location_str = sprintf('x: %.0f y: %.0f z:%.0f',location_mri(1:3)); figure('name',['MRI TEM MRI INTERN ' location_str]); ft_plot_ortho(mritem.anatomy,'location',location_mri(1:3),'transform',mritem.transform); %% Display the Anatomy via plot_ortho (at the same certain location, using inverse internal transform ) location_mri = [0 0 0]; location_str = sprintf('x: %.0f y: %.0f z:%.0f',location_mri(1:3)); figure('name',['MRI TEM MRI INTERN ' location_str]); ft_plot_ortho(mritem.anatomy,'location',location_mri(1:3),'transform',inv(mritem.transform));
Jan-Mathijs Schoffelen - 2012-06-13 17:26:44 +0200
Hi Burkhard, We will look into this soon. At the moment Robert and I are pretty beschäftigt with the preparation of two fieldtrip courses (we are leaving tomorrow for Hamburg, and travel to Frankfurt on Sunday). As soon as we have some air again we'll follow up on this
Robert Oostenveld - 2012-06-13 17:29:14 +0200
(In reply to comment #2) I have already made a start: I added a test script according to your email, see http://code.google.com/p/fieldtrip/source/detail?r=6062 It reproduces the first problem ??? Index exceeds matrix dimensions. Error in ==> ft_plot_ortho at 60 if isempty(varargin{1}) || isnumeric(varargin{1}) I have fixed this one as suggested, optional arguments should indeed be optional, not required. manzana> svn commit ft_plot_ortho.m Sending ft_plot_ortho.m Transmitting file data . Committed revision 6064. I have not yet looked at the rest. I'll leave it assigned to the whole team. Perhaps someone else can take over...