Login  Register

Re: Concentric Circle Formation Slices

Posted by Krs5 on Aug 18, 2020; 11:11am
URL: http://imagej.273.s1.nabble.com/Concentric-Circle-Formation-Slices-tp5023860p5023861.html

Dear Thaddeus,

Your macro works for a circle (assuming that the code makeOval(xb,yb,2*,2*R); is makeOval(xb,yb,2*R,2*R);) but for an oval the Xradius and Yradius don't have to be the same and would be

Rx = W1/2;
Ry = H1/2;

and not necessary R = (H1+W1)/4; This is only valid for a circle.

Best wishes

Kees


Dr Ir K.R. Straatman
Advanced Imaging Facility

University of Leicester
www.le.ac.uk/advanced-imaging-facility<http://www.le.ac.uk/advanced-imaging-facility>

________________________________
From: Thaddeus <[hidden email]>
Sent: 18 August 2020 09:39
Subject: Concentric Circle Formation Slices

I intend to produce a macro where after a user generated circle a series of
concentric circles is produced. However, the variables change without any
alteration on my part. The bounding rectangle positions and radius just
decrease on their own for no reason each time I run the macro so I cannot
script it in any straight forward manner. Here is my macro so far:

setBackgroundColor(0, 0, 0);
run("Clear Outside");  // Clear background data

W1 = getValue("Width");
H1 = getValue("Height");
xb = getValue("BX");
yb = getValue("BY");

R = (H1+W1)/4    //get radius
xc=xb+W1/2        // Center x value
yc=yb+H1/2         // Center x value
Rx=0.9*R             // Reduced radius
x=xc-Rx*sqrt(2)   //New bounded corner x value
y=yc-Rx*sqrt(2)   //New bounded corner y value

makeOval(xb,yb,2*,2*R); // This should reproduce the same exact oval as the
user generated one and it
                                      //does not (Ideally this new circle
would be smaller and about the same
                                      //centroid as the original, but I cant
even make the same oval yet)
run("Clear", "slice");        // Remove center data

//Next I would recall the image and repeat with new smaller outer circle

// Ideally I should run this in a loop and each iteration will save only the
data from each new concentric ring

//Thanks for your time and help



--
Sent from: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.1557.x6.nabble.com%2F&amp;data=02%7C01%7Ckrs5%40leicester.ac.uk%7Ca3eb8eb9333748a5d97908d84354327b%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C1%7C637333376207306947&amp;sdata=Xkw060aXUDcBcLXX2pUj6X3kTBoztG8fFp6ces56YQw%3D&amp;reserved=0

--
ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&amp;data=02%7C01%7Ckrs5%40leicester.ac.uk%7Ca3eb8eb9333748a5d97908d84354327b%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C1%7C637333376207306947&amp;sdata=wrCLwYK%2BAC5W3LUcYW8JrCYjDky48T77BzwMUDLJ3sM%3D&amp;reserved=0

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html