freesurfer_tools_path - locate the freesurfer*.m installation path [FStoolsPath] = freesurfer_tools_path This function looks for the installation path of freesurfer_read_surf.m in the matlab path. If not found, update the matlab path (try addpath).
0001 function [FStoolsPath] = freesurfer_tools_path 0002 0003 % freesurfer_tools_path - locate the freesurfer*.m installation path 0004 % 0005 % [FStoolsPath] = freesurfer_tools_path 0006 % 0007 % This function looks for the installation path of 0008 % freesurfer_read_surf.m in the matlab path. If not 0009 % found, update the matlab path (try addpath). 0010 % 0011 0012 0013 % $Revision: 1.1 $ $Date: 2005/08/14 21:24:19 $ 0014 0015 % Licence: GNU GPL, no implied or express warranties 0016 % History: 09/2005, Darren.Weber_at_radiology.ucsf.edu 0017 % 0018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0019 0020 FStoolsPath = fileparts(which('freesurfer_read_surf')); 0021 if isempty(FStoolsPath), 0022 msg = sprintf('Cannot find freesurfer_read_surf on the matlab path.\nTry the addpath command.\n\n'); 0023 error(msg); 0024 end 0025 0026 return