I created a plugin that uses a variant of Fuzzy C-Means to segment an image by color information as a project for an university course of mine. I started from Jarek Sacha's K-Means plugin and received a lot of help on optimizations on this list from Gabriel Landini, Johannes Schindelin and Stephan Saalfeld.
The code can be get from here, I would really appreciate if anyone interested used it and reported his feedbacks (suggestions, corrections and so on) on this list. |
On Sunday 23 Jan 2011, Serfaino wrote:
> I created a plugin that uses a variant of Fuzzy C-Means to segment an image > by color information as a project for an university course of mine. I would like to try this. Is there a single jar file download for this? I do not seem to be able to find it in the link posted. Many thanks Gabriel |
Yes Gabriel, there's a jar in the /dist directory of the project called 'sfcm_clustering.jar' It contains the original K-Means plugin, a refactored and extended version, a Fuzzy C-Means plugin and the Spatial Fuzzy C-Means one. Be sure not to have another version of the K-Means plugin already installed.
|
On Sunday 23 Jan 2011, Serafino wrote:
> Yes Gabriel, there's a jar in the /dist directory of the project called > 'sfcm_clustering.jar' It contains the original K-Means plugin, a refactored > and extended version, a Fuzzy C-Means plugin and the Spatial Fuzzy C-Means > one. Thanks. > Be sure not to have another version of the K-Means plugin already > installed. Thanks for the warning. The down side is that Jarek's jar has lots of other useful plugins which I would like to keep. Maybe you can think of a way of keeping jarek's jar without having to tweak inside the jars? I see that jarek's jar has 4 class files under clustering, and in your old>kmeans there are 5 and they have different sizes. What version of jarek's clustering is included in the sfcm jar (I am asking because Jarek kindly fixed a bug that is important for a morphological clustering macro I wrote and which is a bit tricky to test. The one I have from 17/03/2009. Regards Gabriel |
The version I included is dated November 2010, so I guess it is newer than yours. Is there a way to exactly confirm this? I guess you could diff the java files.
By the way in clustering.old.kmeans there are three java files but five classes (Jarek used two inner classes): KMeans, KMeansClusteringPlugin, KMeanUtils, Config, MeanElement. I will figure out a way to make it not necessary to remove Jarek's one, I packaged all the versions together in mine since I have to show what I did and where I start for my university project. Did you find the plugin 'useful' in someway? **UPDATE** Changing the name in plugins.config will do the trick, pushed a new version on the repo |
In reply to this post by Gabriel Landini
I updated the plugins (in clustering.old.kmeans and clustering.kmeans) to include the most recent version of the K-Means plugin by Jarek (in which a correction to the computed euclidean distance has been made).
Now K-Means performs even faster !(it does a squared root less for each computation of the euclidean distance) I do not know if I shall laugh or cry considering how slower is the Fuzzy C-Means version than it now : D |
Dear all,
I have a thresholded image with my objects detected. Now I would like to calculate - the average distance between objects (i.e., between their centroids) - the average distance between any object and its N neighbors, And I would like to be able to calculate these distances as eucliedan, manhattan, etc. Having the X, Y coordenates of each centroid, I know I can do this with a small program, but maybe any of you is aware of a plugin to do this? I guess it is very common in spatial statistics descriptors, etc. Thanks a lot for any comment on this. Rodrigo ________________________ Rodrigo J. Gonçalves ________________________ |
Hi Rodrigo,
I do not understand whether you used the spatial fuzzy c-means plugin in order to segment your image or another technique (thresholding?) and you asked help in the wrong thread |
Hi,
On Sat, 5 Feb 2011, Serafino wrote: > I do not understand whether you used the spatial fuzzy c-means plugin in > order to segment your image or another technique (thresholding?) and you > asked help in the wrong thread To clarify: it is called thread-hijacking, and the effect can be seen here: http://thread.gmane.org/gmane.comp.java.imagej/20374/focus=20474 (it appears as if the question "Nearest Neighbor" was written in response to Serafino's mail mentioning an update to the fuzzy c-means plugin). Ciao, Johannes |
I see, I will get back on the previous topic for this post,
in order to export the cluster centroid matrix and the cluster membership matrix for further data analysis are two 'result tables' suggested? |
On Saturday 05 Feb 2011, Serafino wrote:
> I see, I will get back on the previous topic for this post, > in order to export the cluster centroid matrix and the cluster membership > matrix for further data analysis are two 'result tables' suggested? Hi, Unless things have changed recently, you can't have 2 "active" Results Tables from which you can peek and poke values from macros or plugins. You could add an option to output one or another to the RT, or output one set of values to the RT and the other to a file or the Log window., but the advantage of having one or another in the RT is that one can progrmatically retrieve thos values and use them somewhere else. I hope it helps. Cheers Gabriel |
In reply to this post by Rodrigo Gonçalves-4
Hi Rodrigo,
it is difficult to define an "average distance" between particles: The radial distribution function (RDF; number of occurrences of a given distance vs. distance) reaches out to the maximum distance. Usually, the image includes only a small (and hopefully representative) region of a larger object, so the actual radial distribution function would reach out much further than the image size. If this is the case, you can use my macro to get the RDF: http://imagejdocu.tudor.lu/doku.php?id=macro:radial_distribution_function (by the way, I'll be offline next week, don't expect any response to questions directed to me). If you are interested in *neighboring* particles only, you are probably interested in a Voronoi/Delaunay diagram. There should be a few implementations around, you can search the web for these keywords. Hope this helps, Michael _________________________________________________________________________ On Fri, February 4, 2011 16:01, Rodrigo Gonçalves wrote: > Dear all, > > I have a thresholded image with my objects detected. > Now I would like to calculate > - the average distance between objects (i.e., between their centroids) > - the average distance between any object and its N neighbors, > > And I would like to be able to calculate these distances as eucliedan, > manhattan, etc. > > Having the X, Y coordenates of each centroid, I know I can do this with a > small program, but maybe any of you is aware of a plugin to do this? I > guess it is very common in spatial statistics descriptors, etc. > > Thanks a lot for any comment on this. > Rodrigo > > ________________________ > > Rodrigo J. Gonçalves > > ________________________ > > > > > |
In reply to this post by Serafino
Hi Serafino,
hope you are still reading an answering the posts here. I would like to apply your sfcm plugin to my data. Do you have published anything on this plugin I can cite (and read?) thx RB |
Free forum by Nabble | Edit this page |