EZvapendLabel.m 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. % Create the text in an axis
  2. hFstrip=figure;
  3. %figure(hFstrip,'Visible','off')
  4. t=text(.05,.05,tmPtTx,'FontSize',8, 'FontWeight','bold'); %, 'FontWeight','demi')
  5. %Bspace= zeros(20,size(Fcutsc,2))+255;
  6. F=[];
  7. % Capture the text from the screen:
  8. F=getframe(gca,[10 10 200 200]);
  9. % Close the figure:
  10. close
  11. cc=[];
  12. c=[];
  13. % Select any plane of the resulting image:
  14. cc=F.cdata(:,:,1);
  15. c= cc(182:195,18:60);
  16. %
  17. i=[];
  18. j=[];
  19. % Determine where the text was (black is 0):
  20. %[i,j]=find(cc == 0);
  21. [i,j]=find(c < 255);
  22. % Read in or load the image that is to contain the text:
  23. % Use the size of that image, plus the row/column locations
  24. % of the text, to determine locations in the new image:
  25. %Bspace= zeros(20,size(Fcutsc,2))+255;
  26. Bspace= zeros((210-size(Fcutsc,1)),size(Fcutsc,2))+255;
  27. ind=[];
  28. ind=sub2ind(size(Bspace),i,j);
  29. % Index into new image, replacing pixels with white:
  30. Bspace(ind)=uint8(0);
  31. %figure
  32. % Display and color the new image:
  33. %imagesc(Bspace)
  34. %axis image
  35. %colormap(bone)
  36. %htest=imagesc(Fstrip)