Hey everyone
I have an 8-bit image, and I'm trying to threshold using Fiji's Image -> Adjust -> Threshold. Let's say I do it manually using Fiji and it yeields "Result-image X". Now I try to replicate that in Java. What I do it: Get the image: implus imp = IJ.getImage(); I have checked that I get the right image. Apply std. threshold: imp.getProcessor().setAutoThreshold("Default"); Apply threshold: imp.getProcessor().setThreshold(x,y,0); Where x, y are the lower and upper values from the threshold slider in the Threshold window from ImageJ. 0 is just the "Red" option. And finally: IJ.run(imp, "Convert to Mask", ""); To convert the image. Unfortunately the result I get from the code vs. the result I see in "Result-image X" is not the same. From what I can see it seems that in ImageJ Fiji then lower and upper values from the sliders in the Threshold window somehow is... lost. Let's say that the lower and upper are 0 and 35. When I run the code it seems that no matter what I do the lower and upper values are set to 0 and 0. I have checked that the values I get in are the appropriate doubles and everything so I'm kinda stuck, and is hoping someone can provide an answer. Thanks :) |
On Apr 17, 2010, at 6:32 PM, Cspr wrote:
> Hey everyone > > I have an 8-bit image, and I'm trying to threshold using Fiji's Image -> > Adjust -> Threshold. Let's say I do it manually using Fiji and it yeields > "Result-image X". > > Now I try to replicate that in Java. What I do it: > > Get the image: implus imp = IJ.getImage(); > I have checked that I get the right image. > > Apply std. threshold: imp.getProcessor().setAutoThreshold("Default"); > > Apply threshold: imp.getProcessor().setThreshold(x,y,0); > Where x, y are the lower and upper values from the threshold slider in the > Threshold window from ImageJ. 0 is just the "Red" option. > > And finally: > IJ.run(imp, "Convert to Mask", ""); > > To convert the image. > > Unfortunately the result I get from the code vs. the result I see in > "Result-image X" is not the same. From what I can see it seems that in > ImageJ Fiji then lower and upper values from the sliders in the Threshold > window somehow is... lost. Let's say that the lower and upper are 0 and 35. > When I run the code it seems that no matter what I do the lower and upper > values are set to 0 and 0. > > I have checked that the values I get in are the appropriate doubles and > everything so I'm kinda stuck, and is hoping someone can provide an answer. The command recorder (Plugins>Macros>Record) in ImageJ 1.43 will generate Java code. Here is what it generates when I threshold an image and use the "Convert to Mask" command: ImagePlus imp = IJ.getImage(); IJ.setAutoThreshold(imp, "Default"); IJ.run(imp, "Convert to Mask", ""); Thresholding the image and clicking on "Set" in the "Threshold" window generates: ImagePlus imp = IJ.getImage(); IJ.setAutoThreshold(imp, "Default"); IJ.setThreshold(imp, 0, 162); Note that the IJ.setThreshold(imp, 0, 162) call is not handled correctly unless you are running the 1.43u daily build. -wayne |
In reply to this post by Cspr
Dear lister,
A new plugin FociPicker3D written for 3D and 2D particle/foci analysis has been released at http://rsbweb.nih.gov/ij/plugins/foci-picker3d/index.html. it could be used to analyze the area/volume of particle, the center of mass, the mean intensity, and the number of particles/foci in 2D and 3D images. The FociPicker algorithm is based on local maxima, and the objects are thresholded using local thresholds and background (general threshold settings are also possible). For more details, please visit the plugin webpage. There are responses that the webpage link cannot be loaded correctly using Firefox, but it works with IE (Internet Explorer) and Google Chrome. Firefox is WORKING when you set the code to Unicode (UTF-16). Firefox-->View-->Encoding-->Unicode(UTF-16). best wishes! Guanghua Du ************************************** Guanghua Du, PhD James-Franck Str. 1 Physik Dept, E12, TUM 85748, Garching b. Muenchen Germany Tel:+49-89-28914286 E-mail: [hidden email] ************************************** |
Hello Guanghua,
This looks great. Thanks a lot for sharing it! I noticed you released with no license, so it involves the most restrictive one. Wouldn't you like to make it more reusable by adding a GPL license? Best regards, ignacio On Mon, Apr 19, 2010 at 10:22 AM, Guanghua Du <[hidden email]> wrote: > Dear lister, > A new plugin FociPicker3D written for 3D and 2D particle/foci analysis > has been released at > http://rsbweb.nih.gov/ij/plugins/foci-picker3d/index.html. > it could be used to analyze the area/volume of particle, the center of > mass, the mean intensity, and the number of particles/foci in 2D and 3D > images. > > The FociPicker algorithm is based on local maxima, and the objects are > thresholded using local thresholds and background (general threshold > settings are also possible). For more details, please visit the plugin > webpage. > > > There are responses that the webpage link cannot be loaded correctly using > Firefox, but it works with IE (Internet Explorer) and Google Chrome. Firefox > is WORKING when you set the code to Unicode (UTF-16). > Firefox-->View-->Encoding-->Unicode(UTF-16). > > > best wishes! > > Guanghua Du > > > ************************************** > Guanghua Du, PhD > James-Franck Str. 1 > Physik Dept, E12, TUM > 85748, Garching b. Muenchen > Germany > > Tel:+49-89-28914286 > E-mail: [hidden email] > ************************************** > -- Ignacio Arganda-Carreras, Ph.D. Seung's lab, 46-5065 Department of Brain and Cognitive Sciences Massachusetts Institute of Technology 43 Vassar St. Cambridge, MA 02139 USA Phone: (001) 617-452-4976 Website: http://bioweb.cnb.csic.es/~iarganda/index_EN.html |
Hi, ignacio,
I have no idea how to apply the GPL license? best wishes, guanghua Ignacio Arganda-Carreras wrote: > Hello Guanghua, > > This looks great. Thanks a lot for sharing it! > > I noticed you released with no license, so it involves the most restrictive > one. Wouldn't you like to make it more reusable by adding a GPL license? > > Best regards, > > ignacio > > On Mon, Apr 19, 2010 at 10:22 AM, Guanghua Du <[hidden email]> wrote: > >> Dear lister, >> A new plugin FociPicker3D written for 3D and 2D particle/foci analysis >> has been released at >> http://rsbweb.nih.gov/ij/plugins/foci-picker3d/index.html. >> it could be used to analyze the area/volume of particle, the center of >> mass, the mean intensity, and the number of particles/foci in 2D and 3D >> images. >> >> The FociPicker algorithm is based on local maxima, and the objects are >> thresholded using local thresholds and background (general threshold >> settings are also possible). For more details, please visit the plugin >> webpage. >> >> >> There are responses that the webpage link cannot be loaded correctly using >> Firefox, but it works with IE (Internet Explorer) and Google Chrome. Firefox >> is WORKING when you set the code to Unicode (UTF-16). >> Firefox-->View-->Encoding-->Unicode(UTF-16). >> >> >> best wishes! >> >> Guanghua Du >> >> >> ************************************** >> Guanghua Du, PhD >> James-Franck Str. 1 >> Physik Dept, E12, TUM >> 85748, Garching b. Muenchen >> Germany >> >> Tel:+49-89-28914286 >> E-mail: [hidden email] >> ************************************** >> > > > -- best wishes! ************************************** Guanghua Du, PhD James-Franck Str. 1 Physik Dept, E12, TUM 85748, Garching b. Muenchen Germany Tel:+49-89-28914286 E-mail: [hidden email] ************************************** |
Hi again Guanghua,
GPL means basically that you allow other people to use and modify your program and source code as long as whatever they do with it remains as well under the GPL terms. It's on my opinion a very fair way of forcing everything to stay open source: http://www.gnu.org/licenses/gpl.html To apply it, you just have to add some lines at the beginning of your code: http://www.gnu.org/licenses/gpl-howto.html Look for example how i did it in AnalyzeSkeleton: http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=blob;f=src-plugins/AnalyzeSkeleton_/skeleton_analysis/AnalyzeSkeleton_.java;h=ce4bcb334d02205b381710718d12e7bdb80a5d0b;hb=HEAD#l19 Cheers! ignacio <http://www.gnu.org/licenses/gpl-howto.html> On Mon, Apr 19, 2010 at 12:00 PM, Guanghua Du <[hidden email]> wrote: > Hi, ignacio, > > I have no idea how to apply the GPL license? > > best wishes, > > guanghua > > > > Ignacio Arganda-Carreras wrote: > >> Hello Guanghua, >> >> This looks great. Thanks a lot for sharing it! >> >> I noticed you released with no license, so it involves the most >> restrictive >> one. Wouldn't you like to make it more reusable by adding a GPL license? >> >> Best regards, >> >> ignacio >> >> On Mon, Apr 19, 2010 at 10:22 AM, Guanghua Du <[hidden email]> wrote: >> >> Dear lister, >>> A new plugin FociPicker3D written for 3D and 2D particle/foci analysis >>> has been released at >>> http://rsbweb.nih.gov/ij/plugins/foci-picker3d/index.html. >>> it could be used to analyze the area/volume of particle, the center of >>> mass, the mean intensity, and the number of particles/foci in 2D and 3D >>> images. >>> >>> The FociPicker algorithm is based on local maxima, and the objects are >>> thresholded using local thresholds and background (general threshold >>> settings are also possible). For more details, please visit the plugin >>> webpage. >>> >>> >>> There are responses that the webpage link cannot be loaded correctly >>> using >>> Firefox, but it works with IE (Internet Explorer) and Google Chrome. >>> Firefox >>> is WORKING when you set the code to Unicode (UTF-16). >>> Firefox-->View-->Encoding-->Unicode(UTF-16). >>> >>> >>> best wishes! >>> >>> Guanghua Du >>> >>> >>> ************************************** >>> Guanghua Du, PhD >>> James-Franck Str. 1 >>> Physik Dept, E12, TUM >>> 85748, Garching b. Muenchen >>> Germany >>> >>> Tel:+49-89-28914286 >>> E-mail: [hidden email] >>> ************************************** >>> >>> >> >> >> > -- > best wishes! > > ************************************** > Guanghua Du, PhD > James-Franck Str. 1 > Physik Dept, E12, TUM > 85748, Garching b. Muenchen > Germany > > Tel:+49-89-28914286 > E-mail: [hidden email] > ************************************** > -- Ignacio Arganda-Carreras, Ph.D. Seung's lab, 46-5065 Department of Brain and Cognitive Sciences Massachusetts Institute of Technology 43 Vassar St. Cambridge, MA 02139 USA Phone: (001) 617-452-4976 Website: http://bioweb.cnb.csic.es/~iarganda/index_EN.html |
In my opinion it makes GPL licensed code useless to professional software developers, and therefore should be avoided. See http://www.opensource.org/ for less restrictive alternatives, such as the BSD and MIT licenses.
Bob On Apr 19, 2010, at 9:29 AM, Ignacio Arganda-Carreras wrote: > Hi again Guanghua, > > GPL means basically that you allow other people to use and modify your > program and source code as long as whatever they do with it remains as well > under the GPL terms. It's on my opinion a very fair way of forcing > everything to stay open source: > > http://www.gnu.org/licenses/gpl.html > > To apply it, you just have to add some lines at the beginning of your code: > > http://www.gnu.org/licenses/gpl-howto.html > > Look for example how i did it in AnalyzeSkeleton: > > http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=blob;f=src-plugins/AnalyzeSkeleton_/skeleton_analysis/AnalyzeSkeleton_.java;h=ce4bcb334d02205b381710718d12e7bdb80a5d0b;hb=HEAD#l19 > > Cheers! > > ignacio > <http://www.gnu.org/licenses/gpl-howto.html> > > On Mon, Apr 19, 2010 at 12:00 PM, Guanghua Du <[hidden email]> wrote: > >> Hi, ignacio, >> >> I have no idea how to apply the GPL license? >> >> best wishes, >> >> guanghua >> >> >> >> Ignacio Arganda-Carreras wrote: >> >>> Hello Guanghua, >>> >>> This looks great. Thanks a lot for sharing it! >>> >>> I noticed you released with no license, so it involves the most >>> restrictive >>> one. Wouldn't you like to make it more reusable by adding a GPL license? >>> >>> Best regards, >>> >>> ignacio >>> >>> On Mon, Apr 19, 2010 at 10:22 AM, Guanghua Du <[hidden email]> wrote: >>> >>> Dear lister, >>>> A new plugin FociPicker3D written for 3D and 2D particle/foci analysis >>>> has been released at >>>> http://rsbweb.nih.gov/ij/plugins/foci-picker3d/index.html. >>>> it could be used to analyze the area/volume of particle, the center of >>>> mass, the mean intensity, and the number of particles/foci in 2D and 3D >>>> images. >>>> >>>> The FociPicker algorithm is based on local maxima, and the objects are >>>> thresholded using local thresholds and background (general threshold >>>> settings are also possible). For more details, please visit the plugin >>>> webpage. >>>> >>>> >>>> There are responses that the webpage link cannot be loaded correctly >>>> using >>>> Firefox, but it works with IE (Internet Explorer) and Google Chrome. >>>> Firefox >>>> is WORKING when you set the code to Unicode (UTF-16). >>>> Firefox-->View-->Encoding-->Unicode(UTF-16). >>>> >>>> >>>> best wishes! >>>> >>>> Guanghua Du >>>> >>>> >>>> ************************************** >>>> Guanghua Du, PhD >>>> James-Franck Str. 1 >>>> Physik Dept, E12, TUM >>>> 85748, Garching b. Muenchen >>>> Germany >>>> >>>> Tel:+49-89-28914286 >>>> E-mail: [hidden email] >>>> ************************************** >>>> >>>> >>> >>> >>> >> -- >> best wishes! >> >> ************************************** >> Guanghua Du, PhD >> James-Franck Str. 1 >> Physik Dept, E12, TUM >> 85748, Garching b. Muenchen >> Germany >> >> Tel:+49-89-28914286 >> E-mail: [hidden email] >> ************************************** >> > > > > -- > Ignacio Arganda-Carreras, Ph.D. > Seung's lab, 46-5065 > Department of Brain and Cognitive Sciences > Massachusetts Institute of Technology > 43 Vassar St. > Cambridge, MA 02139 > USA > > Phone: (001) 617-452-4976 > Website: http://bioweb.cnb.csic.es/~iarganda/index_EN.html Robert Dougherty, Ph.D. President, OptiNav, Inc. 4176 148th Ave. NE Redmond, WA 98052 Tel. (425)891-4883 FAX (425)467-1119 www.optinav.com [hidden email] |
Hey Bob,
In my experience, GPL fits great with the idea of ImageJ plugins, programs that you want to make open, usable and also tunable by the scientific community. I understand your point, but I don't think it's such a big deal. You could always create a specific version of your software with a suitable license for commercial purposes if you need it. All the best, ignacio On Mon, Apr 19, 2010 at 12:46 PM, Robert Dougherty <[hidden email]> wrote: > In my opinion it makes GPL licensed code useless to professional software > developers, and therefore should be avoided. See > http://www.opensource.org/ for less restrictive alternatives, such as the > BSD and MIT licenses. > > Bob > > On Apr 19, 2010, at 9:29 AM, Ignacio Arganda-Carreras wrote: > > > Hi again Guanghua, > > > > GPL means basically that you allow other people to use and modify your > > program and source code as long as whatever they do with it remains as > well > > under the GPL terms. It's on my opinion a very fair way of forcing > > everything to stay open source: > > > > http://www.gnu.org/licenses/gpl.html > > > > To apply it, you just have to add some lines at the beginning of your > code: > > > > http://www.gnu.org/licenses/gpl-howto.html > > > > Look for example how i did it in AnalyzeSkeleton: > > > > > http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=blob;f=src-plugins/AnalyzeSkeleton_/skeleton_analysis/AnalyzeSkeleton_.java;h=ce4bcb334d02205b381710718d12e7bdb80a5d0b;hb=HEAD#l19 > > > > Cheers! > > > > ignacio > > <http://www.gnu.org/licenses/gpl-howto.html> > > > > On Mon, Apr 19, 2010 at 12:00 PM, Guanghua Du <[hidden email]> wrote: > > > >> Hi, ignacio, > >> > >> I have no idea how to apply the GPL license? > >> > >> best wishes, > >> > >> guanghua > >> > >> > >> > >> Ignacio Arganda-Carreras wrote: > >> > >>> Hello Guanghua, > >>> > >>> This looks great. Thanks a lot for sharing it! > >>> > >>> I noticed you released with no license, so it involves the most > >>> restrictive > >>> one. Wouldn't you like to make it more reusable by adding a GPL > license? > >>> > >>> Best regards, > >>> > >>> ignacio > >>> > >>> On Mon, Apr 19, 2010 at 10:22 AM, Guanghua Du <[hidden email]> wrote: > >>> > >>> Dear lister, > >>>> A new plugin FociPicker3D written for 3D and 2D particle/foci analysis > >>>> has been released at > >>>> http://rsbweb.nih.gov/ij/plugins/foci-picker3d/index.html. > >>>> it could be used to analyze the area/volume of particle, the center of > >>>> mass, the mean intensity, and the number of particles/foci in 2D and > 3D > >>>> images. > >>>> > >>>> The FociPicker algorithm is based on local maxima, and the objects are > >>>> thresholded using local thresholds and background (general threshold > >>>> settings are also possible). For more details, please visit the plugin > >>>> webpage. > >>>> > >>>> > >>>> There are responses that the webpage link cannot be loaded correctly > >>>> using > >>>> Firefox, but it works with IE (Internet Explorer) and Google Chrome. > >>>> Firefox > >>>> is WORKING when you set the code to Unicode (UTF-16). > >>>> Firefox-->View-->Encoding-->Unicode(UTF-16). > >>>> > >>>> > >>>> best wishes! > >>>> > >>>> Guanghua Du > >>>> > >>>> > >>>> ************************************** > >>>> Guanghua Du, PhD > >>>> James-Franck Str. 1 > >>>> Physik Dept, E12, TUM > >>>> 85748, Garching b. Muenchen > >>>> Germany > >>>> > >>>> Tel:+49-89-28914286 > >>>> E-mail: [hidden email] > >>>> ************************************** > >>>> > >>>> > >>> > >>> > >>> > >> -- > >> best wishes! > >> > >> ************************************** > >> Guanghua Du, PhD > >> James-Franck Str. 1 > >> Physik Dept, E12, TUM > >> 85748, Garching b. Muenchen > >> Germany > >> > >> Tel:+49-89-28914286 > >> E-mail: [hidden email] > >> ************************************** > >> > > > > > > > > -- > > Ignacio Arganda-Carreras, Ph.D. > > Seung's lab, 46-5065 > > Department of Brain and Cognitive Sciences > > Massachusetts Institute of Technology > > 43 Vassar St. > > Cambridge, MA 02139 > > USA > > > > Phone: (001) 617-452-4976 > > Website: http://bioweb.cnb.csic.es/~iarganda/index_EN.html > > Robert Dougherty, Ph.D. > President, OptiNav, Inc. > 4176 148th Ave. NE > Redmond, WA 98052 > Tel. (425)891-4883 > FAX (425)467-1119 > www.optinav.com > [hidden email] > -- Ignacio Arganda-Carreras, Ph.D. Seung's lab, 46-5065 Department of Brain and Cognitive Sciences Massachusetts Institute of Technology 43 Vassar St. Cambridge, MA 02139 USA Phone: (001) 617-452-4976 Website: http://bioweb.cnb.csic.es/~iarganda/index_EN.html |
Ignacio,
I'm not sure what the scientific community is, but I sometimes sell products derived from ImageJ and its parts. This is only possible because it is not constrained by a restrictive license. Anything GLP can never be included in product I make, so it might as well not exist as far as I'm concerned. This is not my idea of a good fit. Bob On Apr 19, 2010, at 9:56 AM, Ignacio Arganda-Carreras wrote: > Hey Bob, > > In my experience, GPL fits great with the idea of ImageJ plugins, programs > that you want to make open, usable and also tunable by the scientific > community. > > I understand your point, but I don't think it's such a big deal. You could > always create a specific version of your software with a suitable license > for commercial purposes if you need it. > > All the best, > > ignacio > > > > On Mon, Apr 19, 2010 at 12:46 PM, Robert Dougherty <[hidden email]> wrote: > >> In my opinion it makes GPL licensed code useless to professional software >> developers, and therefore should be avoided. See >> http://www.opensource.org/ for less restrictive alternatives, such as the >> BSD and MIT licenses. >> >> Bob >> >> On Apr 19, 2010, at 9:29 AM, Ignacio Arganda-Carreras wrote: >> >>> Hi again Guanghua, >>> >>> GPL means basically that you allow other people to use and modify your >>> program and source code as long as whatever they do with it remains as >> well >>> under the GPL terms. It's on my opinion a very fair way of forcing >>> everything to stay open source: >>> >>> http://www.gnu.org/licenses/gpl.html >>> >>> To apply it, you just have to add some lines at the beginning of your >> code: >>> >>> http://www.gnu.org/licenses/gpl-howto.html >>> >>> Look for example how i did it in AnalyzeSkeleton: >>> >>> |
Hi Bob,
On Mon, 19 Apr 2010, Robert Dougherty wrote: > I'm not sure what the scientific community is, but I sometimes sell > products derived from ImageJ and its parts. For many people I know, the scientific community is considered to consist of people working in academia, i.e. of people who get their money through grants, in return for a promise to do research. > This is only possible because it is not constrained by a restrictive > license. Anything GLP can never be included in product I make, so it > might as well not exist as far as I'm concerned. This is not my idea of > a good fit. I am sorry if you feel that way. I certainly would want you to be able to make money off of ImageJ. On the other hand, I was exposed to people who feel very strongly in favor of the GPL, some just because their code (before they made sure to publish all their code as GPL) was used by others in commercial products, and they never saw even so much as a cent or more acknowledgement than their name mentioned in an obscure menu options. The worst such story I know of: the author was not even aware that his code was used in a commercial product before stumbling over his name in a product he had to pay for. So yes, there are people who like the GPL, and there are people who do not like it. In my opinion, both parties have a point, and it would be the wisest to just accept each others' views and go on with life. Ciao, Johannes |
Johannes,
> Hi Bob, > > > For many people I know, the scientific community is considered to consist > of people working in academia, i.e. of people who get their money through > grants, in return for a promise to do research. Carefully worded, as always. Yes, i suppose I'm a member of the club. >> > > On the other hand, I was exposed to people who feel very strongly in favor > of the GPL, some just because their code (before they made sure to publish > all their code as GPL) was used by others in commercial products, and they > never saw even so much as a cent or more acknowledgement than their name > mentioned in an obscure menu options. > > The worst such story I know of: the author was not even aware that his > code was used in a commercial product before stumbling over his name in a > product he had to pay for. I'm missing something. It looks like your are saying that your friends want to be sure that their work is never economically important to spare themselves the the embarrassment of finding out that it is and that they were not clever enough to benefit from it. Doesn't this shortchange the people who otherwise would have developed the product into something useful and convenient enough for customers to pay for and the customers who will never be able to use it because it is frozen in the scientific community stage of development? It seems like a big price to pay to avoid embarrassment, and they still get bragging rights and have stories to tell in pubs if they use the BSD license. > > So yes, there are people who like the GPL, and there are people who do not > like it. In my opinion, both parties have a point, and it would be the > wisest to just accept each others' views and go on with life. > > Ciao, > Johannes Bob |
Hi,
On Mon, 19 Apr 2010, Robert Dougherty wrote: > > [explanation about possible reasons to choose GPL] > It looks like your are saying that your friends want to be sure that > their work is never economically important to spare themselves the the > embarrassment of finding out that it is and that they were not clever > enough to benefit from it. I probably did a bad job at explaining; English is not my first language. In no way did I mean to indicate that the people I personally know who pick the GPL over the BSD license would be embarrassed to know that their code would be economically exploitable. The reasons are usually not as simple as that. Personally, some of my GPL-licensed code is quite likely up-to-par, if not better than, commercially available code. In some cases, I just decided that I want to get contributions back instead of money. Or to allow others to improve my code (and benefit from those improvements myself). Also, you should always keep in mind that asking nicely for a license change works more often than you might think. (But of course, that usually means that when you want to sell something using code of others, you have to share the profits with them. You might see that as a downside.) In fact, I can think of five cases regarding ImageJ-related code right now where a license change was asked for, and in four of them, the authors agreed happily to said license change. But let's move on, discussions about licenses are about as exciting as a rusty drill. Ciao, Johannes |
Free forum by Nabble | Edit this page |