Rev | Line | |
---|
[3] | 1 | % DRAWIDENT Draw overlay image highlighting identifiers of dataset subset |
---|
| 2 | % |
---|
| 3 | % DRAWIDENT(DATA,SUBSET) |
---|
| 4 | % |
---|
| 5 | % INPUT |
---|
| 6 | % DATA spectral image dataset |
---|
| 7 | % SUBSET subset of the image (dataset) to be highlighted |
---|
| 8 | % |
---|
| 9 | % DESCRIPTION |
---|
| 10 | % DRAWIDENT renders the spectral image dataset in a dip_image window. |
---|
| 11 | % Then, image pixels corresponding to the data samples in SUBSET dataset |
---|
| 12 | % are highlighted by overlaying with the image. |
---|
| 13 | |
---|
| 14 | % $Id: drawident.m,v 1.2 2005/02/10 15:24:07 pavel Exp $ |
---|
| 15 | |
---|
| 16 | % Copyright: Pavel Paclik, pavel@ph.tn.tudelft.nl |
---|
| 17 | % Faculty of Applied Physics, Delft University of Technology |
---|
| 18 | % P.O. Box 5046, 2600 GA Delft, The Netherlands |
---|
| 19 | |
---|
| 20 | function drawident(data,subset) |
---|
| 21 | |
---|
| 22 | % render the dataset as a dip image |
---|
| 23 | im=data2dip(data); |
---|
| 24 | |
---|
| 25 | % get idents |
---|
| 26 | id=subset.ident; |
---|
| 27 | id=[id{:}]; |
---|
| 28 | |
---|
| 29 | % create an overlay image |
---|
| 30 | z=dip_image(zeros(data.objsize),'bin'); |
---|
| 31 | |
---|
| 32 | % tag the points |
---|
| 33 | z(id)=1; |
---|
| 34 | |
---|
| 35 | % create overlay |
---|
| 36 | if length(size(im))==3 |
---|
| 37 | im=squeeze(im(:,:,1)); |
---|
| 38 | end |
---|
| 39 | out=overlay(im,z,[max(im) 0 0]) |
---|
Note: See
TracBrowser
for help on using the repository browser.