function h=clearslice(X,Y,Z,V,xv,yv,zv,thresh);
%CLEARSLICE--slice, but V<thresh is set to clear
%
%h=clearslice(X,Y,Z,V,xv,yv,zv,thresh);
%
%Produces h=slice(X,Y,Z,V,xv,yv,zv) with interpolated
%shading.  Values of V < thresh are set to clear (alpha=0)
%and values of V>thresh are opaque (alpha=1);
%

h=slice(X,Y,Z,V,xv,yv,zv);set(h,'edgecolor','none','facecolor','interp');

alphamap=linspace(0,1,256);
set(gcf,'alphamap',alphamap); %add an alphamap
set(gca,'alim',[0 1]); %set the alphalimits

for j=1:length(h)
  C=get(h(j),'cdata');
  I=find(C>=thresh);
  A=zeros(size(C));
  A(I)=1;
  set(h(j),'facealpha','interp','AlphaData',A);
end


