I was wondering if there is an implementation to the watershed algorithem similar to the one in ImageJ or at least some parts of it.
I know that there is a watershed function in matlab (Image Proc. toolbox). but the one in imagej seems to do a much better job at it.
In particular, it is beter in removing extra lines that are produced by the watershed algorithem. I looked quite a bit at their source code and it seems they have some post watershed processing to remove the extra lines (artifacts) somehow!
is there away to do that in matlab? I already looked at the demos/posts/blogs that are around here, and not one of the advices work with the problem.
Thanks in advance
Have you found a solution to this issue?
I was able to use the Java source file of imagej watershed algorithem inside matlab. Not the perfect solution since i have to deal with java heap memory (I deal with very large images) but it is better than nothing.
Do you need a more technical solution of how to accomplish this? Basically, Open imagej instance, feed in the image (you have to convert from matlab matrix to java and then to imagej format), watershed, convert back to matlab.
Thanks for your help,
Steve
"Mustafa " <Mustafa.Ge...@live.com> wrote in message <ig7ag5$nsa$1...@fred.mathworks.com>...
Thanks for your help,
Steve
"Mustafa " <Mustafa.Ge...@live.com> wrote in message <ig7ag5$nsa$1...@fred.mathworks.com>...
But if you want to code it in matlab you wil have to actually look at the code in java language and not just call it in matlab.
1. first you have to download ImageJ and add it to the java watch list of matlab. to add it use the command javaaddpath "filepathandname". The file path should be the path of ij.jar that is found in ImageJ.
2. use the code "ij.IJ.open()" to open ImageJ from matlab.
3. from that point, you can use the commands that you obtain in the macro window in the macro recorder in ImageJ. For example "ij.IJ.run(imp, 'Watershed', '');"
4. also, you can go deaper and play around with functions inside the java jar directly. Check http://rsbweb.nih.gov/ij/developer/api/index.html.
for exchanging image between matlab and the ImageJ environment, the easiest thing is saving in imageJ somewhere and then loading in matlab and vice versa. There are ways using BufferedImage in java to do it directly. I managed to do that for 8bit and 16bit grayshades images. I haven't tried for colored image.
I hope this helps.
"Steve " <sfk28rem...@drexel.edu> wrote in message <ig7i5o$fs9$1...@fred.mathworks.com>...