procedure DeInterlace(OddSlice: boolean); { If OddSlice is true, each even line is replaced by the adjacent odd line, otherwise each odd line is replaced by the adjacent even line. } var i,width,height,row1,row2:integer; begin GetPicSize(width,height); if OddSlice then begin i := 1; while i < (height - 2) do begin GetRow(0, i, width); PutRow(0, i - 1, width); i := i + 2; end; end else begin i := 0; while i < (height - 1) do begin GetRow(0, i, width); PutRow(0, i + 1, width); i := i + 2; end; end; end; macro 'De-interlace Stack'; {Converts 30fps movies to 60 fields per second.} var i, width, height:integer; begin if nSlices=0 then exit('Stack required.'); i:=nSlices; GetPicSize(width,height); if (i * width * height) > get('freemem') then exit('There is not enough free RAM to de-interlace this stack.'); repeat SelectSlice(i); SelectAll; Copy; AddSlice; Paste; i:=i - 1; until i = 0; KillRoi; for i := 1 to nSlices do begin SelectSlice(i); DeInterlace(odd(i)); end; end;