create_mesh_subplots - using view_mesh, display subplots of mesh results Usage: create_mesh_subplots(hvol, hoffset, ROIs, ROI, plot_title, timepoint) where: hvol - h volume output from selxavg-sess, loaded from h bshorts hoffset - h-offset volume, loaded from the h-offset bshorts ROIs - a ROI structure with at least three elements: designtype - either "blocked" or "event-related" nconditions - number of conditions (excluding fixation) mesh_type - 1 for display in raw scanner units 2 for display in percent signal change ROI - your ROI in the standard format plot_title - (optional) title of the plot timepoint - (optional) timepoint to plot for FIR analyses create_mesh_subplots allows the user the display the results of the FS-FAST program selxavg-sess for a particular ROI in the form of a "surface" plot, where high and low values are mapped to high and low points in a 3D space, respectively. Note that for this surface to be possible, your ROI must be rectangular, must be on only one slice, and must be contiguous. create_mesh_subplots does these plots for all conditions (excluding fixation). See also view_mesh for plotting of one condition at a time. This function is part of froi, available from http://froi.sourceforge.net, and is governed under the Artistic License. $Id: create_mesh_subplots.m,v 1.3 2003/09/24 22:40:12 nknouf Exp $
This function calls:
This function is called by:
0001 function create_mesh_subplots(hvol, hoffset, ROIs, ROI, plot_title, timepoint) 0002 % create_mesh_subplots - using view_mesh, display subplots of mesh results 0003 % 0004 % Usage: create_mesh_subplots(hvol, hoffset, ROIs, ROI, plot_title, timepoint) 0005 % where: 0006 % hvol - h volume output from selxavg-sess, loaded from h bshorts 0007 % hoffset - h-offset volume, loaded from the h-offset bshorts 0008 % ROIs - a ROI structure with at least three elements: 0009 % designtype - either "blocked" or "event-related" 0010 % nconditions - number of conditions (excluding fixation) 0011 % mesh_type - 1 for display in raw scanner units 0012 % 2 for display in percent signal change 0013 % ROI - your ROI in the standard format 0014 % plot_title - (optional) title of the plot 0015 % timepoint - (optional) timepoint to plot for FIR analyses 0016 % 0017 % create_mesh_subplots allows the user the display the results of the FS-FAST 0018 % program selxavg-sess for a particular ROI in the form of a "surface" plot, 0019 % where high and low values are mapped to high and low points in a 3D space, 0020 % respectively. Note that for this surface to be possible, your ROI 0021 % must be rectangular, must be on only one slice, and must be contiguous. 0022 % create_mesh_subplots does these plots for all conditions 0023 % (excluding fixation). 0024 % 0025 % See also view_mesh for plotting of one condition at a time. 0026 % 0027 % This function is part of froi, available from http://froi.sourceforge.net, 0028 % and is governed under the Artistic License. 0029 % 0030 % $Id: create_mesh_subplots.m,v 1.3 2003/09/24 22:40:12 nknouf Exp $ 0031 0032 %% argument checking 0033 if (nargin < 5) 0034 plot_title = 'Surface Plots for All Conditions'; 0035 timepoint = 1; 0036 elseif (nargin < 6) 0037 timepoint = 1; 0038 end 0039 0040 %% get subplot dimensions 0041 [rowNum, colNum] = subplot_lookup(ROIs.nconditions); 0042 0043 %% what's our current condition number? 0044 currCond = 1; 0045 0046 %% what's our vector of handles? 0047 handles = []; 0048 0049 %% what's our vector of axes? 0050 axis_list = []; 0051 0052 %% what's our vector of z axis limits? 0053 zaxis_lim = []; 0054 0055 %% convert our hemodynamic volume 0056 fprintf('converting hemodynamic data...\n'); 0057 [hvol, hstd, numSamples] = convert_hvolume(hvol, ROIs.nconditions); 0058 0059 if (strncmp(ROIs.designtype, 'blocked', 7) && ~(numSamples == 1)) 0060 oops(1000); 0061 end 0062 0063 %% loop through each subplot and plot the appropriate data 0064 for i=1:rowNum 0065 for j=1:colNum 0066 currCond = currCond + 1; 0067 0068 %% make sure we aren't calling view_mesh for more conditions 0069 if (currCond > (ROIs.nconditions + 1)) 0070 currCond = currCond - 1; 0071 break; 0072 end 0073 0074 %% get handles to current plots 0075 h = subplot(rowNum, colNum, currCond - 1); 0076 a = gca; 0077 0078 %% save handles for later 0079 handles = [handles h]; 0080 axis_list = [axis_list a]; 0081 clear a, h; 0082 0083 %% actually display the mesh 0084 view_mesh(hvol, hoffset, ROIs, ROI, currCond); 0085 axis equal; 0086 0087 %% get axis limits 0088 junk = axis; 0089 axis_lim = junk(1,5:6); 0090 axis_lim = reshape(axis_lim, 2, 1); 0091 zaxis_lim = [zaxis_lim axis_lim]; 0092 end 0093 end 0094 0095 %% find min and max of axes 0096 min_z = min(min(zaxis_lim)); 0097 max_z = max(max(zaxis_lim)); 0098 0099 %% loop through number of subplots 0100 %% setup viewing parameters 0101 for i=1:(currCond - 1) 0102 current_handle = handles(1,i); 0103 current_axis = axis_list(1, i); 0104 subplot(current_handle); 0105 0106 command = sprintf('title(''Condition %d'')',i); 0107 eval(command); 0108 caxis([min_z, max_z]); 0109 axis equal; 0110 axis([-inf inf -inf inf min_z max_z]); 0111 end 0112 0113 fprintf('displaying results...\n'); 0114 0115 %% need to correct the following functions; leaving out for now 0116 %%subplot_title(plot_title); 0117 %%subplot_colorbar(min_z, max_z);