thanks Matti Bruce On Thu, 29 Sep 2011, Matti Stenroos wrote:
Hi & sorry for the second post... ...I made a typo in my fix. Should of course be If nargout>1,... Cheers, Matti From: freesurfer-boun...@nmr.mgh.harvard.edu [mailto:freesurfer-boun...@nmr.mgh.harvard.edu] On Behalf Of Matti Stenroos Sent: 29 September 2011 15:00 To: freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Bug in freesurfer_read_surf.m & a quick fix Hi, In FreeSurfer 4.3.0, the Matlab routine ?freesurfer_read_surf.m? crashes, when run with one output argument: function [vertices, faces] = freesurfer_read_surf(fname) The function help says: % Note that reading the faces of a quad file can take a long % time due to their compact storage format. In this case, the return of % vertices can be faster if the face output variable is not specified; in % this case, the faces are not read. However, when the function is called in the form vertices = freesurfer_read_surf(fname), it crashes on line 152 faces = faces + 1; because the variable ?faces? is not defined. A quick fix: wrap line 152 inside an if clause: If nargin>1 faces=faces+1; end Unfortunately I don?t know, how to check, whether this has been fixed in later releases. Cheers, Matti
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.