function spine(action)
% SPINE Show patch object example of spine

%    Yama Habibzai
%    Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
%    $Revision: 1.8 $
%    $Date: 1997/12/03 17:30:03 $

if nargin <1 
  action = 'init';
end

switch action
case 'init',
  load sethback;
  figurePos = getfgpos(560, 420);
  figure('NumberTitle', 'off', 'Name', 'Spine',...
      'Position', figurePos);

  p=patch('faces', f, 'vertices', v);
  l=light;
  lighting p;
  view(3);
  set(p, 'facec', [.75 .85 .85], 'EdgeColor', 'none');
  set(gca, 'dataaspectratio', [1 1 1]);
  view(-48.8946,   21.5782)
  set(gca, 'CameraViewAngle', 9);
  axis([0 60 0 60 0 80]);
  set(l,'Position',get(gca,'CameraPosition'),'Style','local');
  set(gcf, 'Color', 'k');
  set(gca, 'Color', 'k', 'XColor', 'w', 'YColor', 'w','ZColor', 'w');   
  set(gca, 'Units', 'Normal', 'Position', [.04 .16 .775 .815]);

  % Create the buttons
  frm = uicontrol('Style', 'Frame',....
      'Units', 'Normalized', 'Position',...
      [.83 .115 .14 .17],...
      'BackGroundColor', [.4 .4 .4]);
  
  hndl = uicontrol('Style', 'push',...
      'String', 'Close', 'Units', 'Normalized',...
      'Position', [.85 .14 .1 .05],...
      'callback', 'close');
  
  
  info =  uicontrol('Style', 'push',...
      'String', 'info', 'Units', 'Normalized',...
      'Position', [.85 .21 .1 .05],...
      'callback', 'spine(''info'')');
  
case 'info',
  ttl = '3-D Patch Objects';
  str ={'Patch is the low-level graphics function for creating'
  'Patch graphics objects. A Patch object is one or more'
  'polygons defined by the coordinates of its vertices.'
  'You can specify the coloring and lighting of the Patch. '
  ' '
  'Patch(X,Y,C) adds the filled two-dmensional polygon to'
  'the current Axes. The elements of X and Y specify the'
  'vertices of the polygon. If X and Y are matrices, MATLAB'
  'draws one polygon per column. C determines the color of'
  'the Patch. It can be a single colorspec, one color per'
  'face, or one color per vertex'
  ' '
  'In this example, the MRI data is used to create a 3-D'
  'image of a spine.'
  ' '
  'filename: spine.m'};
  helpwin(str, ttl);
end % switch ...




