Dear all,
Is there a way to measure manually two consecutive lines using the straight line tool, the second being perpendicular to the first one (automatically fitting to a 90° angle to the first one when drawn)? I've searched for macro or plugin doing this but with no result. I need this functionality to measure fungal spores. So i have to measure the length and the width of spores (so two lines per spore) and the two lines used to measure these data have to be perpendicular to each other. Thanks, Romain -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Romain,
what do you mean by: "[...] measure manually two consecutive lines [...]" What do you like to measure? The intensity profile? Please be more specific. Herbie ::::::::::::::::::::::::::::::::::::::::: Am 31.01.16 um 23:30 schrieb Romain Penz: > Dear all, > > > Is there a way to measure manually two consecutive lines using the > straight line tool, the second being perpendicular to the first one > (automatically fitting to a 90° angle to the first one when drawn)? > > > I've searched for macro or plugin doing this but with no result. > > > I need this functionality to measure fungal spores. So i have to > measure the length and the width of spores (so two lines per spore) > and the two lines used to measure these data have to be perpendicular > to each other. > > > Thanks, > > > Romain > > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Herbie,
I need to measure the length and width of spores in µm. When using the term "manually" I mean to simply use the straight line tool to draw length or width of spore using the mouse or the pad of my laptop to point the starting point and the ending point of each line and then use the measure tool (ctrl+m) ("manually" is opposed in my mind to the measure plugins which can measure automatically some data about ROI). The only thing I need to be automatic is that the second line I draw is fitting to a 90° angle to the first one when I have defined the starting point (even if the two lines are not secant ones, like needed with some spores which look like curved sausages (see the second picture even if the two lines are not perpendicular)). To see what I want to do I attach a picture on which we can see on each spore two straight lines perpendicular to each other (picture from another software). Thanks ________________________________________ De : ImageJ Interest Group <[hidden email]> de la part de Herbie <[hidden email]> Envoyé : lundi 1 février 2016 09:55 À : [hidden email] Objet : Re: measuring two lines perpendicularly Dear Romain, what do you mean by: "[...] measure manually two consecutive lines [...]" What do you like to measure? The intensity profile? Please be more specific. Herbie ::::::::::::::::::::::::::::::::::::::::: Am 31.01.16 um 23:30 schrieb Romain Penz: > Dear all, > > > Is there a way to measure manually two consecutive lines using the > straight line tool, the second being perpendicular to the first one > (automatically fitting to a 90° angle to the first one when drawn)? > > > I've searched for macro or plugin doing this but with no result. > > > I need this functionality to measure fungal spores. So i have to > measure the length and the width of spores (so two lines per spore) > and the two lines used to measure these data have to be perpendicular > to each other. > > > Thanks, > > > Romain > > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Romain,
as far as I know there is no ImageJ-tool that _restricts manual drawing_ at 90deg with respect to an existing line. One approach I can think of is a ImageJ-macro that draws an arbitrary perpendicular line to an existing one (it was recently discussed on this list). Of course this line isn't positioned correctly and its length isn't what you want. However, it is possible to position it manually without changing its orientation. However, changing its length without changing its orientation may be problematic. Another approach my be the various options in "Set Measurements". Did you consider those? For descriptions you may have a look at the ImageJ-manual. HTH Herbie ::::::::::::::::::::::::::::::::::::::::: Am 01.02.16 um 11:38 schrieb Romain Penz: > Dear Herbie, > > I need to measure the length and width of spores in µm. > > When using the term "manually" I mean to simply use the straight line > tool to draw length or width of spore using the mouse or the pad of > my laptop to point the starting point and the ending point of each > line and then use the measure tool (ctrl+m) ("manually" is opposed in > my mind to the measure plugins which can measure automatically some > data about ROI). The only thing I need to be automatic is that the > second line I draw is fitting to a 90° angle to the first one when I > have defined the starting point (even if the two lines are not secant > ones, like needed with some spores which look like curved sausages > (see the second picture even if the two lines are not > perpendicular)). > > To see what I want to do I attach a picture on which we can see on > each spore two straight lines perpendicular to each other (picture > from another software). > > Thanks > > ________________________________________ De : ImageJ Interest Group > <[hidden email]> de la part de Herbie <[hidden email]> Envoyé : > lundi 1 février 2016 09:55 À : [hidden email] Objet : Re: > measuring two lines perpendicularly > > Dear Romain, > > what do you mean by: "[...] measure manually two consecutive lines > [...]" > > What do you like to measure? The intensity profile? > > Please be more specific. > > Herbie > > ::::::::::::::::::::::::::::::::::::::::: Am 31.01.16 um 23:30 > schrieb Romain Penz: >> Dear all, >> >> >> Is there a way to measure manually two consecutive lines using the >> straight line tool, the second being perpendicular to the first >> one (automatically fitting to a 90° angle to the first one when >> drawn)? >> >> >> I've searched for macro or plugin doing this but with no result. >> >> >> I need this functionality to measure fungal spores. So i have to >> measure the length and the width of spores (so two lines per >> spore) and the two lines used to measure these data have to be >> perpendicular to each other. >> >> >> Thanks, >> >> >> Romain >> >> -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> > > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
I will try that plugin. It could be an effective solution for some spores associated with a rectangular ROI (elliptic spores especially). Thanks a lot.
The curved spores will need the use of two rectangles I guess. Otherwise a tool live displaying the angle between two lines (the angle a second line I'm drawing has with the precedent drawn) could allow me to do what I want and could be the simplest way to achieve my goal. I will search in parallel on that direction. Duleep Samuel <[hidden email]> wrote you can do the same using “Selection Rotator” tool, contributed by Peter Haub, which is included with ImageJ 1.50d. To add this tool to the toolbar, select it from the toolbar’s “>>” menu. (I checked it it is working icely) http://permalink.gmane.org/gmane.comp.java.imagej/39308, Regards, Samuel (PS btw I am in Division of plant Pathology) there was something on ROI rotator https://github.com/imagej/imagej1/blob/master/ij/plugin/RoiRotator.java On Tue, Feb 2, 2016 at 2:58 PM, Romain Penz <[hidden email]> wrote: Hi Samuel, not a bad idea if the spore is not curved. The only restriction is to be able to rotate the rectangle to exactly surrounding the spore because the spores are rarely vertically or horizontally oriented (the tool edit > selection > rotate may be a solution but being able to rotate the rectangle manually would allow a finest fitting. Do you know a way to dos this?) Thanks De : Duleep Samuel <[hidden email]> Envoyé : mardi 2 février 2016 05:00 À : [hidden email] Objet : Re: measuring two lines perpendicularly can you draw a rectangle surrounding the spore, the dimension of the rectangle will be those of the spore, regards, DK Samuel, Virology Lab, Ind Insr of Hort Reserach, Bangalore India On Mon, Feb 1, 2016 at 4:00 AM, Romain Penz <[hidden email]> wrote: Dear all, Is there a way to measure manually two consecutive lines using the straight line tool, the second being perpendicular to the first one (automatically fitting to a 90° angle to the first one when drawn)? I've searched for macro or plugin doing this but with no result. I need this functionality to measure fungal spores. So i have to measure the length and the width of spores (so two lines per spore) and the two lines used to measure these data have to be perpendicular to each other. Thanks, Romain -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
On Tuesday 02 Feb 2016 14:59:59 you wrote:
> I will try that plugin. It could be an effective solution for some spores > associated with a rectangular ROI (elliptic spores especially). Thanks a > lot. Rather than doing it by hand, you could also try to binarise the spores, then extract the feret diameter and the breadth (which is the maximum distances from the feret to the boundaries, measured perpendicularly to the feret. Note thought, that the segments on each side of the feret are not necessarily co- linear. The Particles8 plugin can compute that. Or compute the size of the bounding box based in the rotating calipers algorithm. I think BoneJ can do this. Cheers Gabriel -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
I have made some progress, modifying the L-Shape Tool macro from Jerome Mutterer.
Now I'm able to get two separate lines (2 separate Roi) perpendicular. See the code below. To get exactly what I need, I have to found a solution in order to : - Be able to "click" with the left mouse to define the beginning of the second line (which is automatic in the code below) - then drag the line to the desired length (following a linear function perpendicular to the first one). Is there a function to do this? I've searched but with no results. Do you know how to do this? macro "L-Shape Tool -C000L1991L91e6" { run("Line Width...", "line=1"); getPixelSize(unit, pixelWidth, pixelHeight); getCursorLoc(x, y, z, flags); xstart = x; ystart = y; x2=x; y2=y; while (flags!=0) { getCursorLoc(x, y, z, flags); if (x!=x2 || y!=y2) makeLine(xstart, ystart, x, y); x2=x; y2=y; wait(10); } roiManager("Add"); if (x!=xstart || y!=ystart) { drawLshape(xstart, ystart, x, y); roiManager("Add") } } function drawLshape(x1, y1, x2, y2) { a = atan ((x2-x1)/(y2-y1)); x3=0;y3=0; while (flags&16==0) { // getCursorLoc(x, y, z, flags); if (x!=x3 || y!=y3) { sign=1; if (x2>x) sign=-1; w=sqrt ((x2-x)*(x2-x)+(y2-y)*(y2-y)); wsa = sign*w*sin((PI/2)+a); wca = sign*w*cos((PI/2)+a); //makeLine( x1,y1,x2,y2,x2 + wsa,y2 + wca); // l-shape //makeLine( x1,y1,x2,y2,x2 + wsa,y2 + wca,x2 - wsa,y2 - wca); // t-shap //makeLine( x2+wsa,y2+wca,x2-wsa,y2-wca); t-shape 2 separate lines //makeLine( (x1+x2)/2+wsa,(y1+y2)/2+wca,(x1+x2)/2-wsa,(y1+y2)/2-wca); //x-shape 2 separate lines makeLine( x+wsa,y+wca,x-wsa,y-wca); // X-L-or-T-shape 2 separate lines x3=x;y3=y; wait(10); } } } ________________________________________ De : ImageJ Interest Group <[hidden email]> de la part de Gabriel Landini <[hidden email]> Envoyé : mardi 2 février 2016 16:38 À : [hidden email] Objet : Re: measuring two lines perpendicularly On Tuesday 02 Feb 2016 14:59:59 you wrote: > I will try that plugin. It could be an effective solution for some spores > associated with a rectangular ROI (elliptic spores especially). Thanks a > lot. Rather than doing it by hand, you could also try to binarise the spores, then extract the feret diameter and the breadth (which is the maximum distances from the feret to the boundaries, measured perpendicularly to the feret. Note thought, that the segments on each side of the feret are not necessarily co- linear. The Particles8 plugin can compute that. Or compute the size of the bounding box based in the rotating calipers algorithm. I think BoneJ can do this. Cheers Gabriel -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |