RollingBall dark background

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

RollingBall dark background

Greg
Hi,

I am using jython and Fiji on Max OS 10.10. and on a Red Hat Linux Cluster.

Despite having identical scripts (modulo some path arguments) in both environments, I got completely different results. Inside the analysis pipeline, I traced it back to the Rolling Ball Background Subtraction, here is a minimal example:

Med = IJ.openImage('rbExample.tif')
ip = Med.getProcessor().duplicate()
imp = ImagePlus('mask',ip)
# strange on cluster !                                                          
IJ.run(imp,"Subtract Background...", "rolling=25 disable")

On the cluster I get a white background, whereas the original has a dark background. So I tried:

IJ.run(imp,"Subtract Background...", "rolling=25 disable dark")

no effect, then I tried:

IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")

before doing the subtraction, also no effect on the cluster!

This dark background setting seems to be a bit dubious in general, as you do not know what was set as 'default' in the the specific Fiji installation you use. But now I am trying to set it correct, and that fails ?!

Any help appreciated !

Best,
Greg
Reply | Threaded
Open this post in threaded view
|

Re: RollingBall dark background

Michael Schmid
Hi Greg,

does ImageJ run in headless mode on the cluster? Then it could be a bug of the headless mode.

Michael
________________________________________________________________
On Mar 20, 2015, at 11:30, Greg wrote:

> Hi,
>
> I am using jython and Fiji on Max OS 10.10. and on a Red Hat Linux Cluster.
>
> Despite having identical scripts (modulo some path arguments) in both
> environments, I got completely different results. Inside the analysis
> pipeline, I traced it back to the Rolling Ball Background Subtraction, here
> is a minimal example:
>
> Med = IJ.openImage('rbExample.tif')
> ip = Med.getProcessor().duplicate()
> imp = ImagePlus('mask',ip)
> # strange on cluster !                                                          
> IJ.run(imp,"Subtract Background...", "rolling=25 disable")
>
> On the cluster I get a white background, whereas the original has a dark
> background. So I tried:
>
> IJ.run(imp,"Subtract Background...", "rolling=25 disable dark")
>
> no effect, then I tried:
>
> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
>
> before doing the subtraction, also no effect on the cluster!
>
> This dark background setting seems to be a bit dubious in general, as you do
> not know what was set as 'default' in the the specific Fiji installation you
> use. But now I am trying to set it correct, and that fails ?!
>
> Any help appreciated !
>
> Best,
> Greg

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: RollingBall dark background

ctrueden
In reply to this post by Greg
Hi Greg,

> I tried:
>
> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
>
> before doing the subtraction, also no effect on the cluster!

Very good thing to check. Are you certain that the setting in Process >
Binary > Options for "Black background" really matches on both the desktop
and the cluster? This is a very common cause of black-vs.-white issues
across different machines.

Regards,
Curtis

On Fri, Mar 20, 2015 at 5:30 AM, Greg <[hidden email]> wrote:

> Hi,
>
> I am using jython and Fiji on Max OS 10.10. and on a Red Hat Linux Cluster.
>
> Despite having identical scripts (modulo some path arguments) in both
> environments, I got completely different results. Inside the analysis
> pipeline, I traced it back to the Rolling Ball Background Subtraction, here
> is a minimal example:
>
> Med = IJ.openImage('rbExample.tif')
> ip = Med.getProcessor().duplicate()
> imp = ImagePlus('mask',ip)
> # strange on cluster !
> IJ.run(imp,"Subtract Background...", "rolling=25 disable")
>
> On the cluster I get a white background, whereas the original has a dark
> background. So I tried:
>
> IJ.run(imp,"Subtract Background...", "rolling=25 disable dark")
>
> no effect, then I tried:
>
> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
>
> before doing the subtraction, also no effect on the cluster!
>
> This dark background setting seems to be a bit dubious in general, as you
> do
> not know what was set as 'default' in the the specific Fiji installation
> you
> use. But now I am trying to set it correct, and that fails ?!
>
> Any help appreciated !
>
> Best,
> Greg
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: RollingBall dark background

ctrueden
Hi Greg,

I also added an FAQ entry on why you might see different results with
different installations of ImageJ. Maybe there are some ideas there that
help you to troubleshoot it.

http://imagej.net/Frequently_Asked_Questions#The_same_plugin_gives_different_results_on_different_machines.21

Regards,
Curtis

On Fri, Mar 20, 2015 at 10:42 AM, Curtis Rueden <[hidden email]> wrote:

> Hi Greg,
>
> > I tried:
> >
> > IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
> >
> > before doing the subtraction, also no effect on the cluster!
>
> Very good thing to check. Are you certain that the setting in Process >
> Binary > Options for "Black background" really matches on both the desktop
> and the cluster? This is a very common cause of black-vs.-white issues
> across different machines.
>
> Regards,
> Curtis
>
> On Fri, Mar 20, 2015 at 5:30 AM, Greg <[hidden email]> wrote:
>
>> Hi,
>>
>> I am using jython and Fiji on Max OS 10.10. and on a Red Hat Linux
>> Cluster.
>>
>> Despite having identical scripts (modulo some path arguments) in both
>> environments, I got completely different results. Inside the analysis
>> pipeline, I traced it back to the Rolling Ball Background Subtraction,
>> here
>> is a minimal example:
>>
>> Med = IJ.openImage('rbExample.tif')
>> ip = Med.getProcessor().duplicate()
>> imp = ImagePlus('mask',ip)
>> # strange on cluster !
>> IJ.run(imp,"Subtract Background...", "rolling=25 disable")
>>
>> On the cluster I get a white background, whereas the original has a dark
>> background. So I tried:
>>
>> IJ.run(imp,"Subtract Background...", "rolling=25 disable dark")
>>
>> no effect, then I tried:
>>
>> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
>>
>> before doing the subtraction, also no effect on the cluster!
>>
>> This dark background setting seems to be a bit dubious in general, as you
>> do
>> not know what was set as 'default' in the the specific Fiji installation
>> you
>> use. But now I am trying to set it correct, and that fails ?!
>>
>> Any help appreciated !
>>
>> Best,
>> Greg
>>
>>
>>
>> --
>> View this message in context:
>> http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075.html
>> Sent from the ImageJ mailing list archive at Nabble.com.
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: RollingBall dark background

Michael Schmid
In reply to this post by ctrueden
Hi Greg,

the BackgroundSubtracter has its own "bs.background" item in the ImageJ Prefs file IJ_Prefs.txt.

bs.background=true
means 'Light Background' is the default.

I don't think that the BackgroundSubtracter cares about the "Black background" setting for binary images.

"Light background" depends on the color lookup table in use, so different settings of "Use Inverted Lookup Table" in Edit>Options>Appearance may be also a culprit.

Michael
________________________________________________________________
On Mar 20, 2015, at 16:42, Curtis Rueden wrote:

> Hi Greg,
>
>> I tried:
>>
>> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
>>
>> before doing the subtraction, also no effect on the cluster!
>
> Very good thing to check. Are you certain that the setting in Process >
> Binary > Options for "Black background" really matches on both the desktop
> and the cluster? This is a very common cause of black-vs.-white issues
> across different machines.
>
> Regards,
> Curtis
>
> On Fri, Mar 20, 2015 at 5:30 AM, Greg <[hidden email]> wrote:
>
>> Hi,
>>
>> I am using jython and Fiji on Max OS 10.10. and on a Red Hat Linux Cluster.
>>
>> Despite having identical scripts (modulo some path arguments) in both
>> environments, I got completely different results. Inside the analysis
>> pipeline, I traced it back to the Rolling Ball Background Subtraction, here
>> is a minimal example:
>>
>> Med = IJ.openImage('rbExample.tif')
>> ip = Med.getProcessor().duplicate()
>> imp = ImagePlus('mask',ip)
>> # strange on cluster !
>> IJ.run(imp,"Subtract Background...", "rolling=25 disable")
>>
>> On the cluster I get a white background, whereas the original has a dark
>> background. So I tried:
>>
>> IJ.run(imp,"Subtract Background...", "rolling=25 disable dark")
>>
>> no effect, then I tried:
>>
>> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
>>
>> before doing the subtraction, also no effect on the cluster!
>>
>> This dark background setting seems to be a bit dubious in general, as you
>> do
>> not know what was set as 'default' in the the specific Fiji installation
>> you
>> use. But now I am trying to set it correct, and that fails ?!
>>
>> Any help appreciated !
>>
>> Best,
>> Greg
>>
>>
>>
>> --
>> View this message in context:
>> http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075.html
>> Sent from the ImageJ mailing list archive at Nabble.com.
>>
>> --
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: RollingBall dark background

Greg

Hi,

thank you for your answers. So yes, on the cluster I run ImageJ in headless mode. I wanted to try to check the IJ_Prefs.txt, but I do not have such file in my Fiji folder on the cluster. Maybe I figure it out how to change this setting within jython. But I guess you pointed me to the right direction, I will also check Curtis' links. Isn't it a bit odd that the 'dark' keyword in the IJ.run('Subtract Background'...) command string is not simply doing it ?

Greets,
Greg

Hi Greg,

the BackgroundSubtracter has its own "bs.background" item in the ImageJ Prefs file IJ_Prefs.txt.

bs.background=true
means 'Light Background' is the default.

I don't think that the BackgroundSubtracter cares about the "Black background" setting for binary images.

"Light background" depends on the color lookup table in use, so different settings of "Use Inverted Lookup Table" in Edit>Options>Appearance may be also a culprit.

Michael
________________________________________________________________
On Mar 20, 2015, at 16:42, Curtis Rueden wrote:

> Hi Greg,
>
>> I tried:
>>
>> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
>>
>> before doing the subtraction, also no effect on the cluster!
>
> Very good thing to check. Are you certain that the setting in Process >
> Binary > Options for "Black background" really matches on both the desktop
> and the cluster? This is a very common cause of black-vs.-white issues
> across different machines.
>
> Regards,
> Curtis
>
> On Fri, Mar 20, 2015 at 5:30 AM, Greg <[hidden email]> wrote:
>
>> Hi,
>>
>> I am using jython and Fiji on Max OS 10.10. and on a Red Hat Linux Cluster.
>>
>> Despite having identical scripts (modulo some path arguments) in both
>> environments, I got completely different results. Inside the analysis
>> pipeline, I traced it back to the Rolling Ball Background Subtraction, here
>> is a minimal example:
>>
>> Med = IJ.openImage('rbExample.tif')
>> ip = Med.getProcessor().duplicate()
>> imp = ImagePlus('mask',ip)
>> # strange on cluster !
>> IJ.run(imp,"Subtract Background...", "rolling=25 disable")
>>
>> On the cluster I get a white background, whereas the original has a dark
>> background. So I tried:
>>
>> IJ.run(imp,"Subtract Background...", "rolling=25 disable dark")
>>
>> no effect, then I tried:
>>
>> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
>>
>> before doing the subtraction, also no effect on the cluster!
>>
>> This dark background setting seems to be a bit dubious in general, as you
>> do
>> not know what was set as 'default' in the the specific Fiji installation
>> you
>> use. But now I am trying to set it correct, and that fails ?!
>>
>> Any help appreciated !
>>
>> Best,
>> Greg
>>
>>
>>
>> --
>> View this message in context:
>> http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075.html
>> Sent from the ImageJ mailing list archive at Nabble.com.
>>
>> --
>> 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



If you reply to this email, your message will be added to the discussion below:
http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075p5012095.html
To unsubscribe from RollingBall dark background, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: RollingBall dark background

ctrueden
Hi Greg,

> I wanted to try to check the IJ_Prefs.txt, but I do not have such file
> in my Fiji folder on the cluster.

If your cluster is Linux-based, check $HOME/.imagej/IJ_Prefs.txt for the
user that runs Fiji.

As a super quick fix, you can also run the Edit > Options > Reset... to
reset everything.

-Curtis

On Fri, Mar 20, 2015 at 1:33 PM, Greg <[hidden email]> wrote:

> Hi,
>
> thank you for your answers. So yes, on the cluster I run ImageJ in headless
> mode. I wanted to try to check the IJ_Prefs.txt, but I do not have such
> file in my Fiji folder on the cluster. Maybe I figure it out how to change
> this setting within jython. But I guess you pointed me to the right
> direction, I will also check Curtis' links. Isn't it a bit odd that the
> 'dark' keyword in the IJ.run('Subtract Background'...) command string is
> not simply doing it ?
>
> Greets,
> Greg
>  Hi Greg,
>
> the BackgroundSubtracter has its own "bs.background" item in the ImageJ
> Prefs file IJ_Prefs.txt.
>
> bs.background=true
> means 'Light Background' is the default.
>
> I don't think that the BackgroundSubtracter cares about the "Black
> background" setting for binary images.
>
> "Light background" depends on the color lookup table in use, so different
> settings of "Use Inverted Lookup Table" in Edit>Options>Appearance may be
> also a culprit.
>
> Michael
> ________________________________________________________________
> On Mar 20, 2015, at 16:42, Curtis Rueden wrote:
>
> > Hi Greg,
> >
> >> I tried:
> >>
> >> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
> >>
> >> before doing the subtraction, also no effect on the cluster!
> >
> > Very good thing to check. Are you certain that the setting in Process >
> > Binary > Options for "Black background" really matches on both the
> desktop
> > and the cluster? This is a very common cause of black-vs.-white issues
> > across different machines.
> >
> > Regards,
> > Curtis
> >
> > On Fri, Mar 20, 2015 at 5:30 AM, Greg <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5012095&i=0>> wrote:
> >
> >> Hi,
> >>
> >> I am using jython and Fiji on Max OS 10.10. and on a Red Hat Linux
> Cluster.
> >>
> >> Despite having identical scripts (modulo some path arguments) in both
> >> environments, I got completely different results. Inside the analysis
> >> pipeline, I traced it back to the Rolling Ball Background Subtraction,
> here
> >> is a minimal example:
> >>
> >> Med = IJ.openImage('rbExample.tif')
> >> ip = Med.getProcessor().duplicate()
> >> imp = ImagePlus('mask',ip)
> >> # strange on cluster !
> >> IJ.run(imp,"Subtract Background...", "rolling=25 disable")
> >>
> >> On the cluster I get a white background, whereas the original has a dark
> >> background. So I tried:
> >>
> >> IJ.run(imp,"Subtract Background...", "rolling=25 disable dark")
> >>
> >> no effect, then I tried:
> >>
> >> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
> >>
> >> before doing the subtraction, also no effect on the cluster!
> >>
> >> This dark background setting seems to be a bit dubious in general, as
> you
> >> do
> >> not know what was set as 'default' in the the specific Fiji installation
> >> you
> >> use. But now I am trying to set it correct, and that fails ?!
> >>
> >> Any help appreciated !
> >>
> >> Best,
> >> Greg
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075.html
> >> Sent from the ImageJ mailing list archive at Nabble.com.
> >>
> >> --
> >> 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
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075p5012095.html
>  To unsubscribe from RollingBall dark background, click here
> <
> >
> .
> NAML
> <
>
http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075p5012099.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: RollingBall dark background

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Greg
On Mar 20, 2015, at 6:30 AM, Greg <[hidden email]> wrote:

>
> Hi,
>
> I am using jython and Fiji on Max OS 10.10. and on a Red Hat Linux Cluster.
>
> Despite having identical scripts (modulo some path arguments) in both
> environments, I got completely different results. Inside the analysis
> pipeline, I traced it back to the Rolling Ball Background Subtraction, here
> is a minimal example:
>
> Med = IJ.openImage('rbExample.tif')
> ip = Med.getProcessor().duplicate()
> imp = ImagePlus('mask',ip)
> # strange on cluster !                                                          
> IJ.run(imp,"Subtract Background...", "rolling=25 disable")
>
> On the cluster I get a white background, whereas the original has a dark
> background. So I tried:

In the latest ImageJ daily build (1.49q9), the "Subtract Background…” command resets the default “Light background” setting to false if it detects that it is being run from a macro. It also does not change any of the dialog box options when you run it from a macro.

> IJ.run(imp,"Subtract Background...", "rolling=25 disable dark")
>
> no effect, then I tried:
>
> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
>
> before doing the subtraction, also no effect on the cluster!
>
> This dark background setting seems to be a bit dubious in general, as you do
> not know what was set as 'default' in the the specific Fiji installation you
> use. But now I am trying to set it correct, and that fails ?!

The "Subtract Background…” command ignores the “Black background” setting in the Process>Binary>Options dialog but a lot of commands do use this setting so it is a good idea to explicitly set it in macros using setOption("BlackBackground”,true). In a plugin or script, use Prefs.blackBackground=true.

-wayne

> --
> View this message in context: http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075.html
> Sent from the ImageJ mailing list archive at Nabble.com.



--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: RollingBall dark background

Greg

Hi,

is the headless mode equivalent to running a macro ? Anyways, I sadly get a light background result, so it seems to me that this is the default. And as I run Fiji as a linux64 binary on the cluster (it is not installed system wide) I do not have a .imageJ folder and therefore I still can not locate the IJ_Prefs.txt file ! Shall I maybe just make one ? Isnt there a way to tell Fiji this option 2ithin a jython script ?

Thanks and greets,
Greg

Am 21.03.2015 02:02 schrieb "Rasband, Wayne (NIH/NIMH) [E] [via ImageJ]" <[hidden email]>:
On Mar 20, 2015, at 6:30 AM, Greg <[hidden email]> wrote:

>
> Hi,
>
> I am using jython and Fiji on Max OS 10.10. and on a Red Hat Linux Cluster.
>
> Despite having identical scripts (modulo some path arguments) in both
> environments, I got completely different results. Inside the analysis
> pipeline, I traced it back to the Rolling Ball Background Subtraction, here
> is a minimal example:
>
> Med = IJ.openImage('rbExample.tif')
> ip = Med.getProcessor().duplicate()
> imp = ImagePlus('mask',ip)
> # strange on cluster !                                                          
> IJ.run(imp,"Subtract Background...", "rolling=25 disable")
>
> On the cluster I get a white background, whereas the original has a dark
> background. So I tried:
In the latest ImageJ daily build (1.49q9), the "Subtract Background…” command resets the default “Light background” setting to false if it detects that it is being run from a macro. It also does not change any of the dialog box options when you run it from a macro.

> IJ.run(imp,"Subtract Background...", "rolling=25 disable dark")
>
> no effect, then I tried:
>
> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
>
> before doing the subtraction, also no effect on the cluster!
>
> This dark background setting seems to be a bit dubious in general, as you do
> not know what was set as 'default' in the the specific Fiji installation you
> use. But now I am trying to set it correct, and that fails ?!
The "Subtract Background…” command ignores the “Black background” setting in the Process>Binary>Options dialog but a lot of commands do use this setting so it is a good idea to explicitly set it in macros using setOption("BlackBackground”,true). In a plugin or script, use Prefs.blackBackground=true.

-wayne

> --
> View this message in context: http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075.html
> Sent from the ImageJ mailing list archive at Nabble.com.



--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html



If you reply to this email, your message will be added to the discussion below:
http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075p5012102.html
To unsubscribe from RollingBall dark background, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: RollingBall dark background

Greg
In reply to this post by Rasband, Wayne (NIH/NIMH) [E]
Ok, lazy me finally found the subtractor API:
http://rsb.info.nih.gov/ij/developer/api/ij/plugin/filter/BackgroundSubtracter.html

So when I do

ip = Med.getProcessor().duplicate()
imp = ImagePlus('mask',ip)
bs.rollingBallBackground(ip,25.,False,False,True,False,False)

everything works as expected !
So I guess the parameter 'dark' gets not captured correctly when
running the background subtraction via the plugin interface
IJ.run(...dark).

Thanks and Greets,
Greg


Am 21.03.2015 02:02 schrieb "Rasband, Wayne (NIH/NIMH) [E] [via
ImageJ]" <[hidden email]>:

>
> On Mar 20, 2015, at 6:30 AM, Greg <[hidden email]> wrote:
>
> >
> > Hi,
> >
> > I am using jython and Fiji on Max OS 10.10. and on a Red Hat Linux Cluster.
> >
> > Despite having identical scripts (modulo some path arguments) in both
> > environments, I got completely different results. Inside the analysis
> > pipeline, I traced it back to the Rolling Ball Background Subtraction, here
> > is a minimal example:
> >
> > Med = IJ.openImage('rbExample.tif')
> > ip = Med.getProcessor().duplicate()
> > imp = ImagePlus('mask',ip)
> > # strange on cluster !
> > IJ.run(imp,"Subtract Background...", "rolling=25 disable")
> >
> > On the cluster I get a white background, whereas the original has a dark
> > background. So I tried:
>
> In the latest ImageJ daily build (1.49q9), the "Subtract Background…” command resets the default “Light background” setting to false if it detects that it is being run from a macro. It also does not change any of the dialog box options when you run it from a macro.
>
> > IJ.run(imp,"Subtract Background...", "rolling=25 disable dark")
> >
> > no effect, then I tried:
> >
> > IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
> >
> > before doing the subtraction, also no effect on the cluster!
> >
> > This dark background setting seems to be a bit dubious in general, as you do
> > not know what was set as 'default' in the the specific Fiji installation you
> > use. But now I am trying to set it correct, and that fails ?!
>
> The "Subtract Background…” command ignores the “Black background” setting in the Process>Binary>Options dialog but a lot of commands do use this setting so it is a good idea to explicitly set it in macros using setOption("BlackBackground”,true). In a plugin or script, use Prefs.blackBackground=true.
>
> -wayne
>
> > --
> > View this message in context: http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075.html
> > Sent from the ImageJ mailing list archive at Nabble.com.
>
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075p5012102.html
> To unsubscribe from RollingBall dark background, click here.
> NAML
Reply | Threaded
Open this post in threaded view
|

Re: RollingBall dark background

Rasband, Wayne (NIH/NIMH) [E]
> On Mar 21, 2015, at 8:36 AM, Greg <[hidden email]> wrote:
>
> Ok, lazy me finally found the subtractor API:
> http://rsb.info.nih.gov/ij/developer/api/ij/plugin/filter/BackgroundSubtracter.html
>
> So when I do
>
> ip = Med.getProcessor().duplicate()
> imp = ImagePlus('mask',ip)
> bs.rollingBallBackground(ip,25.,False,False,True,False,False)
>
> everything works as expected !
> So I guess the parameter 'dark' gets not captured correctly when
> running the background subtraction via the plugin interface
> IJ.run(...dark).

The bug that caused IJ.run(imp,"Subtract Background…”,…) to fail in Fiji headless mode is fixed in the latest ImageJ daily build (1.49q10). To upgrade, use the Help>Update ImageJ command and select “daily build” from the drop down menu.

The following macro reproduces the problem. It opens the blobs sample image, calculates and prints the mean pixel value, subtracts the background, and again calculates and prints the mean. It also displays the ImageJ version. The background subtraction failed if the “after” mean is greater than the “before” mean. To run the macro, use

   ./ImageJ --headless -macro sbtest.ijm

The macro (“sbtest.ijm”) should be in the Fiji.app/macros folder.

-wayne

  print("IJ version: "+call("ij.IJ.getFullVersion"));
  run("Blobs (25K)");
  run("Invert LUT", "");
  getStatistics(area, mean);
  print("Mean (before): "+mean);
  run("Subtract Background...", "rolling=25");
  getStatistics(area, mean);
  print("Mean (after): "+mean);
  close;



> Am 21.03.2015 02:02 schrieb "Rasband, Wayne (NIH/NIMH) [E] [via
> ImageJ]" <[hidden email]>:
>>
>> On Mar 20, 2015, at 6:30 AM, Greg <[hidden email]> wrote:
>>
>>>
>>> Hi,
>>>
>>> I am using jython and Fiji on Max OS 10.10. and on a Red Hat Linux Cluster.
>>>
>>> Despite having identical scripts (modulo some path arguments) in both
>>> environments, I got completely different results. Inside the analysis
>>> pipeline, I traced it back to the Rolling Ball Background Subtraction, here
>>> is a minimal example:
>>>
>>> Med = IJ.openImage('rbExample.tif')
>>> ip = Med.getProcessor().duplicate()
>>> imp = ImagePlus('mask',ip)
>>> # strange on cluster !
>>> IJ.run(imp,"Subtract Background...", "rolling=25 disable")
>>>
>>> On the cluster I get a white background, whereas the original has a dark
>>> background. So I tried:
>>
>> In the latest ImageJ daily build (1.49q9), the "Subtract Background…” command resets the default “Light background” setting to false if it detects that it is being run from a macro. It also does not change any of the dialog box options when you run it from a macro.
>>
>>> IJ.run(imp,"Subtract Background...", "rolling=25 disable dark")
>>>
>>> no effect, then I tried:
>>>
>>> IJ.run("Options...", "iterations=1 count=1 black edm=Overwrite")
>>>
>>> before doing the subtraction, also no effect on the cluster!
>>>
>>> This dark background setting seems to be a bit dubious in general, as you do
>>> not know what was set as 'default' in the the specific Fiji installation you
>>> use. But now I am trying to set it correct, and that fails ?!
>>
>> The "Subtract Background…” command ignores the “Black background” setting in the Process>Binary>Options dialog but a lot of commands do use this setting so it is a good idea to explicitly set it in macros using setOption("BlackBackground”,true). In a plugin or script, use Prefs.blackBackground=true.
>>
>> -wayne
>>
>>> --
>>> View this message in context: http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075.html
>>> Sent from the ImageJ mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion below:
>> http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075p5012102.html
>> To unsubscribe from RollingBall dark background, click here.
>> NAML
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/RollingBall-dark-background-tp5012075p5012107.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html