{ Date: Mon, 14 Jul 1997 13:29:58 -0500 (CDT) From: Charles.P.Daghlian@Dartmouth.EDU (Charles P. Daghlian) To: Multiple recipients of list Subject: Re: TRACING A BINARY IMAGE Here is one way to trace objects in a stack. The macro has two parts, the first adjusts colors and selects the pencil tool. You them have to trace objects and go to the next slice (. goes up and , goes down). Then run the second macro to make an outline stack. } var n, i, stack, slices, newstack, width, height, temp:integer; procedure CheckForStack; begin if nPics=0 then begin PutMessage('This macro requires a stack.'); exit; end; if nSlices=0 then begin PutMessage('This window is not a stack.'); exit end; end; macro 'Trace stack [T]'; begin CheckForStack; ShowMessage('Changing pixel values.'); for i:= 1 to nSlices do begin ChangeValues(0,1,2); ChangeValues(255,255,254); end; ShowMessage(''); SetPalette('Grayscale',1); SetForegroundColor(1); SetCursor('Cross'); PutMessage('Please outline each item on each slice of the stack, them press F6.'); selectSlice(1); SelectTool('Pencil'); end; macro 'Copy outlines [F6]'; begin CheckForStack; stack:=PidNumber; getPicSize(width, height); SetNewSize(width, height); MakeNewStack('Outlines'); newstack:=PidNumber; makenewWindow('temp'); temp:=PidNumber; SelectPic(stack); for i:= 1 to nSlices do begin selectSlice(i); selectAll; copy; selectPic(temp); paste; SetDensitySlice(1,1); MakeBinary; SelectAll; Copy; SelectPic(newstack); paste; addslice; SelectPic(stack); end; selectPic(temp); dispose; selectPic(newstack); deleteSlice; Selectslice(1); end;