Login  Register

Convert macro from NIH Image to ImageJ

Posted by dinurf on Dec 31, 2015; 6:05am
URL: http://imagej.273.s1.nabble.com/Convert-macro-from-NIH-Image-to-ImageJ-tp5015304.html

Hi All,

Could someone please help me to convert the macro below? The macro used to be written for NIH Image while I want to run it on ImageJ.

Thank you.

Nay

=============================================
macro 'Fractal Dilation';
var
        iterations,i:integer;
        tab:string;
begin
        SaveState;
        iterations:=64;
        tab:=chr(9);
        SetFont('Monaco');
        SetFontSize(9);
        ResetCounter;
        SetBinaryCount(1);
        NewTextWindow(contact(WindowTitle,'-Counts'), 140, 350);
        MoveWindow(500,50);
        Measure;
        writeln(1:3, tab, histogram[255]:7, tab, histogram[255]:5);
        for i:=1 to iterations do begin
                Dilate;
                Measure;
                writeln(i*2+1:3, tab, histogram[255]:7, tab, histogram[255]/(i*2+1):5);
        end;
        RestoreState;

end;
=========================================================