macro 'Make stack'; var i, r, x, y, w, h: integer; begin DisposeAll; w := 400; h := 80; SetNewSize(w,h); MakeNewStack('Spots on Sine Wave'); SetBackground(0); SetForeground(255); for x := 0 to w-1 do begin MakeLineRoi(x,0,x,h); SetForeground(50+round(25*(sin(3.1415926*(x+21)/120)+1))); Fill; end; r := 10; x := 20; y := 10; while r <= 60 do begin MakeOvalRoi(x,y,r,r); AddConstant(49); r := r + 10; x := x + r + 20; end; SelectAll; Copy; for i := 2 to 7 do begin AddSlice; Paste; end; SelectSlice(2); SubtractBackground('2D Rolling Ball',50); SelectSlice(4); SubtractBackground('2D Rolling Ball',10); SelectSlice(6); SubtractBackground('2D Rolling Ball',20); ScaleMath(false); i := 2; while i < nSlices do begin SelectSlice(i); SelectAll; Copy; SelectSlice(i+1); Paste; Subtract; i := i + 2; end; for i := 1 to 7 do begin SelectPic(1); SelectSlice(i); SetNewSize(390,170); SurfacePlot; end; end; macro 'Scale Stack'; var i, w, h: integer; begin SelectPic(1); GetPicSize(w,h); SetNewSize(w,h); MakeNewStack('Scaled'); for i := 1 to 6 do addSlice; for i := 1 to 7 do begin SelectPic(1); SelectSlice(i); SelectAll; Copy; SelectPic(nPics); SelectSlice(i); Paste; ScaleSelection(0.5,0.5); end; end; macro 'Make Figure'; var i, x, y, w, h, sw, sh: integer; begin x := 0; y := 10; w := 290; h := 170; SelectPic(1); GetPicSize(sw,sh); SetNewSize(512,1024); SetBackground(0); SetForeground(255); MakeNewWindow('Figure 2'); for i := 1 to 7 do begin SelectPic(i+1); MakeRoi(0,0,w,h); Copy; SelectPic(nPics); MakeRoi(x,y,w,h); Paste; doOr; SelectPic(nPics-1); SelectSlice(i); MakeRoi(sw/4,sh/4,sw/2,sh/2); Copy; SelectPic(nPics); MakeRoi(x+w-5,y,sw/2,sh/2); Paste; MakeRoi(x+w-5,y+sh/2+5,sw/2,sh/2); Paste; MakeRoi(x+w-5,y+sh/2+5,sw/2,sh/2); SetThreshold(10+70*(i mod 2)); ApplyLut; SetThreshold(-1); y := y + 100; end; end;