In the Fiji /Image menu there is a choice called Drawing and in it are two options: Linear Gradient and Radial Gradient. I can find no documentation of these commands and what they are supposed to do. Can someone point me in the right direction? Thanks- Dave
Dr. David Knecht Professor, Department of Molecular and Cell Biology University of Connecticut 91 N. Eagleville Rd. U-3125 Storrs, CT 06269-3125 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
The minimum enclosing sphere problem is well studied, but most people
consider the general case of d dimensions - which may ignore the special properties of 3D. Also, the problem can be fraught with numerical issues. Google “minimal bounding sphere” for details. The computational geometry package, CGAL, contains an implementation. I am unaware of any ImageJ function that does this - so you are looking at writing something fairly significant in Java. Most of my ImageJ work involves Java plugins, and I have a collection of computational geometry routines that, alas, do not (yet) include this function. Finding the Convex Hull seems like a good first step, if only because it might make a very naive minimal sphere program fast enough. But...the best minimal sphere methods appear to be linear in the number of points (in fixed d), and 3D convex Hull is slower than that. The advantage might be that 3D Convex Hull might already exist and might let you get away with a very slow method to find the sphere from those vertices. That’s a lot of “mights”. Bottom line - I suspect that you will have to write your own code in Java to do this. I suspect this is true also for your alternative plan to find the max distance between vertices of the 3D Convex Hull. Of course, that program is much simpler. Questions: how many boundary points do you expect? How many vertices of the 3D Convex Hull do you expect? And...the kicker...how FAST do you need this computation to be? One more - do you need an exact solution, or is an approximation good enough? And another - how well behaved are your objects? On rereading - I see that you really want “longest axis”. That may be easier than “minimal bounding sphere” - but still unlikely to be a standard ImageJ computation. But, beware - “longest axis” can be tricky in a discrete world. Consider whether your application might prefer to find the axes of a best fitting ellipsoid, instead. For example, consider a brick - do you really want one of the diagonals? Finally, it’s not completely clear to me that the minimal bounding sphere identifies the longest axis! This may be so - it’s just not immediately clear...to me. For many similar problems, I find it easier to use ImageJ to locate the boundary points and write them out to be processed by an external program. On Tue, Jan 26, 2021 at 03:16 Roosch, Svenja < [hidden email]> wrote: > Hello everyone! > > > I have a stack of binary images that is to be interpreted as a 3D image. I > have background (in black) and one irregular-shaped object in it (the model > of a soil aggregate). I now want to know the longest axis of this object. > > > I thought the easiest way would be to let a function find the smallest > containing sphere and take the diameter. I am aware that in BoneJ, there is > a function that allows to find an optimal sphere based on points that are > marked by hand. This is, however, not quite what I need and I hope to find > a solution without too much manual work, since actually, I have a bit more > than one stack. Is anyone aware of a function that can do that? > > > Another way might be to use the 3D Convex Hull package that can find me > the vertices of a convex hull of a 3D object. Does anyone have an idea how > to find the largest pair-wise distance between them in ImageJ? Or is this > something that's better done with another program? > > > Any hint is appreciated. Thanks in advance! > > All the best, > > Svenja > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -Kenneth Sloan -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
This project is interesting to me. If you can provide a "typical" data set, I may be able to write something for you.
No guarantees - but this fits in with other work I am doing, and some tools that I have at hand. -- Kenneth Sloan [hidden email] Vision is the art of seeing what is invisible to others. > On Jan 26, 2021, at 10:27, Kenneth R Sloan <[hidden email]> wrote: > > The minimum enclosing sphere problem is well studied, but most people consider the general case of d dimensions - which may ignore the special properties of 3D. Also, the problem can be fraught with numerical issues. Google “minimal bounding sphere” for details. > > The computational geometry package, CGAL, contains an implementation. > > I am unaware of any ImageJ function that does this - so you are looking at writing something fairly significant in Java. > > Most of my ImageJ work involves Java plugins, and I have a collection of computational geometry routines that, alas, do not (yet) include this function. > > Finding the Convex Hull seems like a good first step, if only because it might make a very naive minimal sphere program fast enough. But...the best minimal sphere methods appear to be linear in the number of points (in fixed d), and 3D convex Hull is slower than that. The advantage might be that 3D Convex Hull might already exist and might let you get away with a very slow method to find the sphere from those vertices. That’s a lot of “mights”. > > Bottom line - I suspect that you will have to write your own code in Java to do this. I suspect this is true also for your alternative plan to find the max distance between vertices of the 3D Convex Hull. Of course, that program is much simpler. > > Questions: how many boundary points do you expect? How many vertices of the 3D Convex Hull do you expect? And...the kicker...how FAST do you need this computation to be? > > One more - do you need an exact solution, or is an approximation good enough? > > And another - how well behaved are your objects? > > On rereading - I see that you really want “longest axis”. That may be easier than “minimal bounding sphere” - but still unlikely to be a standard ImageJ computation. But, beware - “longest axis” can be tricky in a discrete world. Consider whether your application might prefer to find the axes of a best fitting ellipsoid, instead. For example, consider a brick - do you really want one of the diagonals? > > Finally, it’s not completely clear to me that the minimal bounding sphere identifies the longest axis! > This may be so - it’s just not immediately clear...to me. > > For many similar problems, I find it easier to use ImageJ to locate the boundary points and write them out to be processed by an external program. > > On Tue, Jan 26, 2021 at 03:16 Roosch, Svenja <[hidden email] <mailto:[hidden email]>> wrote: > Hello everyone! > > > I have a stack of binary images that is to be interpreted as a 3D image. I have background (in black) and one irregular-shaped object in it (the model of a soil aggregate). I now want to know the longest axis of this object. > > > I thought the easiest way would be to let a function find the smallest containing sphere and take the diameter. I am aware that in BoneJ, there is a function that allows to find an optimal sphere based on points that are marked by hand. This is, however, not quite what I need and I hope to find a solution without too much manual work, since actually, I have a bit more than one stack. Is anyone aware of a function that can do that? > > > Another way might be to use the 3D Convex Hull package that can find me the vertices of a convex hull of a 3D object. Does anyone have an idea how to find the largest pair-wise distance between them in ImageJ? Or is this something that's better done with another program? > > > Any hint is appreciated. Thanks in advance! > > All the best, > > Svenja > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html <http://imagej.nih.gov/ij/list.html> > -- > -Kenneth Sloan -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Knecht, David
Dear Svenja,
Maybe the 3D imageJ Suite (3D ImageJ Suite - ImageJ<https://imagej.net/3D_ImageJ_Suite>) can be of use, like Details about 3D ellipsoid fitting [ImageJ Documentation Wiki] (list.lu)<https://imagejdocu.list.lu/tutorial/plugins/3d_ellipsoid> or 3D Roi Manager [ImageJ Documentation Wiki] (list.lu)<https://imagejdocu.list.lu/plugin/stacks/3d_roi_manager/start>? Best wishes Kees Dr Ir K.R. Straatman FRMS Advanced Imaging Facility University of Leicester www.le.ac.uk/advanced-imaging-facility<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.le.ac.uk%2Fadvanced-imaging-facility&data=04%7C01%7Ckrs5%40leicester.ac.uk%7C485530d84c0e42d1de5608d88a42a407%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637411366106508827%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=I6oSweJYMVqx%2B%2B3VtQ8cXgHDUy4%2F6zDmx%2FSd2lGC8bc%3D&reserved=0> ________________________________ Sent: 26 January 2021 09:03 Subject: Longest axis/minimum containing sphere of 3D object? Hello everyone! I have a stack of binary images that is to be interpreted as a 3D image. I have background (in black) and one irregular-shaped object in it (the model of a soil aggregate). I now want to know the longest axis of this object. I thought the easiest way would be to let a function find the smallest containing sphere and take the diameter. I am aware that in BoneJ, there is a function that allows to find an optimal sphere based on points that are marked by hand. This is, however, not quite what I need and I hope to find a solution without too much manual work, since actually, I have a bit more than one stack. Is anyone aware of a function that can do that? Another way might be to use the 3D Convex Hull package that can find me the vertices of a convex hull of a 3D object. Does anyone have an idea how to find the largest pair-wise distance between them in ImageJ? Or is this something that's better done with another program? Any hint is appreciated. Thanks in advance! All the best, Svenja -- ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&data=04%7C01%7Ckrs5%40leicester.ac.uk%7C7901bf4b5b964f54dc7908d8c1dafe61%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637472493628648363%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=hbDHZDp300Lkh%2FMq7vonoG2AgXtObci1VUMSbZSIM3Q%3D&reserved=0 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Svenja,
BoneJ's Particle Analyser might do what you want. Click 'Feret Max' which I think is the measurement you describe (maximal distance between two points on the surface). Longest axis can be found a few other ways: e.g. fitted ellipsoid, moments of inertia. https://imagej.net/BoneJ.html#Particle_Analyser https://doi.org/10.1101/2020.02.28.969139 BoneJ support is mostly on the forum these days, but we can sometimes be found lurking on the old email list! Michael On 27/01/2021 16:45, Straatman, Kees (Dr.) wrote: Dear Svenja, Maybe the 3D imageJ Suite (3D ImageJ Suite - ImageJ<https://imagej.net/3D_ImageJ_Suite><https://imagej.net/3D_ImageJ_Suite>) can be of use, like Details about 3D ellipsoid fitting [ImageJ Documentation Wiki] (list.lu)<https://imagejdocu.list.lu/tutorial/plugins/3d_ellipsoid><https://imagejdocu.list.lu/tutorial/plugins/3d_ellipsoid> or 3D Roi Manager [ImageJ Documentation Wiki] (list.lu)<https://imagejdocu.list.lu/plugin/stacks/3d_roi_manager/start><https://imagejdocu.list.lu/plugin/stacks/3d_roi_manager/start>? Best wishes Kees Dr Ir K.R. Straatman FRMS Advanced Imaging Facility University of Leicester www.le.ac.uk/advanced-imaging-facility<http://www.le.ac.uk/advanced-imaging-facility><https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.le.ac.uk%2Fadvanced-imaging-facility&data=04%7C01%7Ckrs5%40leicester.ac.uk%7C485530d84c0e42d1de5608d88a42a407%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637411366106508827%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=I6oSweJYMVqx%2B%2B3VtQ8cXgHDUy4%2F6zDmx%2FSd2lGC8bc%3D&reserved=0><https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.le.ac.uk%2Fadvanced-imaging-facility&data=04%7C01%7Ckrs5%40leicester.ac.uk%7C485530d84c0e42d1de5608d88a42a407%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637411366106508827%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=I6oSweJYMVqx%2B%2B3VtQ8cXgHDUy4%2F6zDmx%2FSd2lGC8bc%3D&reserved=0> ________________________________ Sent: 26 January 2021 09:03 Subject: Longest axis/minimum containing sphere of 3D object? Hello everyone! I have a stack of binary images that is to be interpreted as a 3D image. I have background (in black) and one irregular-shaped object in it (the model of a soil aggregate). I now want to know the longest axis of this object. I thought the easiest way would be to let a function find the smallest containing sphere and take the diameter. I am aware that in BoneJ, there is a function that allows to find an optimal sphere based on points that are marked by hand. This is, however, not quite what I need and I hope to find a solution without too much manual work, since actually, I have a bit more than one stack. Is anyone aware of a function that can do that? Another way might be to use the 3D Convex Hull package that can find me the vertices of a convex hull of a 3D object. Does anyone have an idea how to find the largest pair-wise distance between them in ImageJ? Or is this something that's better done with another program? Any hint is appreciated. Thanks in advance! All the best, Svenja -- ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&data=04%7C01%7Ckrs5%40leicester.ac.uk%7C7901bf4b5b964f54dc7908d8c1dafe61%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637472493628648363%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=hbDHZDp300Lkh%2FMq7vonoG2AgXtObci1VUMSbZSIM3Q%3D&reserved=0 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- [Jockey Club College of Veterinary Medicine and Life Sciences - City University of Hong Kong] Dr. Michael Doube BVSc, BPhil, PhD, PGCert Vet Ed, MRCVS, FRMS Associate Professor Department of Infectious Diseases and Public Health 5/F, Block 2, To Yuen Building 31 To Yuen Street Kowloon, Hong Kong Tel: (852) 3442 5296 Fax: (852) 3442 0589 Website: www.cityu.edu.hk/ph<http://www.cityu.edu.hk/ph> Disclaimer: This email (including any attachments) is for the use of the intended recipient only and may contain confidential information and/or copyright material. If you are not the intended recipient, please notify the sender immediately and delete this email and all copies from your system. Any unauthorized use, disclosure, reproduction, copying, distribution, or other form of unauthorized dissemination of the contents is expressly prohibited. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Krs5
I agree that this is the right way to characterize “longest axis”.
But... the OP did ask for Diameter, which is not the same thing. Also, I have always been suspicious of methods that find eigenvectors and eigenvalues and then multiply by a magic constant. This last step has too many assumptions about the distribution of input points. My preferred method is to project the input points on the major axis and scale both axes so that the major axis matches the maximum extent of the projection. Consider the difference between a solid object and the points on the boundary of the object. This (I think) requires different scaling constants. You must take care to verify that your problem matches the assumptions baked into the method! If the OP still wants Diameter, my opinion is that: A) minimum enclosing circle is not quite correct, B) I would find the 3D Convex Hull and then use the obvious brute force method of finding the Diameter Both of these appear to require code that goes beyond existing “off the shelf” methods. I suppose that B could be done in the macro language, but my personal preference would be Java. The 3D suite can provide a good ESTIMATE of the Diameter, and it is up to the OP to decide if the estimate is acceptable. This also looks like the FASTEST method, if that matters. On Wed, Jan 27, 2021 at 02:56 Straatman, Kees (Dr.) <[hidden email]> wrote: > Dear Svenja, > > Maybe the 3D imageJ Suite (3D ImageJ Suite - ImageJ< > https://imagej.net/3D_ImageJ_Suite>) can be of use, like Details about > 3D ellipsoid fitting [ImageJ Documentation Wiki] (list.lu)< > https://imagejdocu.list.lu/tutorial/plugins/3d_ellipsoid> or 3D Roi > Manager [ImageJ Documentation Wiki] (list.lu)< > https://imagejdocu.list.lu/plugin/stacks/3d_roi_manager/start>? > > Best wishes > > Kees > > > Dr Ir K.R. Straatman FRMS > > Advanced Imaging Facility > > University of Leicester > www.le.ac.uk/advanced-imaging-facility< > https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.le.ac.uk%2Fadvanced-imaging-facility&data=04%7C01%7Ckrs5%40leicester.ac.uk%7C485530d84c0e42d1de5608d88a42a407%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637411366106508827%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=I6oSweJYMVqx%2B%2B3VtQ8cXgHDUy4%2F6zDmx%2FSd2lGC8bc%3D&reserved=0 > > > > > ________________________________ > Sent: 26 January 2021 09:03 > Subject: Longest axis/minimum containing sphere of 3D object? > > Hello everyone! > > > I have a stack of binary images that is to be interpreted as a 3D image. I > have background (in black) and one irregular-shaped object in it (the model > of a soil aggregate). I now want to know the longest axis of this object. > > > I thought the easiest way would be to let a function find the smallest > containing sphere and take the diameter. I am aware that in BoneJ, there is > a function that allows to find an optimal sphere based on points that are > marked by hand. This is, however, not quite what I need and I hope to find > a solution without too much manual work, since actually, I have a bit more > than one stack. Is anyone aware of a function that can do that? > > > Another way might be to use the 3D Convex Hull package that can find me > the vertices of a convex hull of a 3D object. Does anyone have an idea how > to find the largest pair-wise distance between them in ImageJ? Or is this > something that's better done with another program? > > > Any hint is appreciated. Thanks in advance! > > All the best, > > Svenja > > -- > ImageJ mailing list: > https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&data=04%7C01%7Ckrs5%40leicester.ac.uk%7C7901bf4b5b964f54dc7908d8c1dafe61%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637472493628648363%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=hbDHZDp300Lkh%2FMq7vonoG2AgXtObci1VUMSbZSIM3Q%3D&reserved=0 > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -Kenneth Sloan -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |