Contrast/brightness in selected areas

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

Contrast/brightness in selected areas

Søren Roesgaard Nielsen
Hi all

I am new to IMAGEJ/Fiji and have some troubles.

I have a TEM picture which is composed from 4 collectors and merged automatically into one picture.
However, the setup is not calibrated properly, leading to different contrast/brightness for the different collectors.
Therefore I am trying to go through the four sub pictures one by one and adjust the contrast so that I get a nice final picture

However no matter what I try the adjust contrast/brightness is effecting the whole image and not the selection I have made.

Hopefully it is possible to create a macro that can do this adjustment for all of my pictures, but right now I just need help getting started.

A sample image can be found here:

https://drive.google.com/folderview?id=0B-5vWo4CxRjub1ZaRG9KVkxHVkk&usp=sharing

Thanks in advance

Søren Roesgaard


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

Re: Contrast/brightness in selected areas

Krs5
Dear Søren,

You can duplicate your selection, make your changes in the duplicated image, copy the optimised image, select your original image with the selection still in place and paste the optimised selection back in the ROI.

Best wishes

Kees

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Søren Roesgaard Nielsen
Sent: 27 June 2014 08:24
To: [hidden email]
Subject: Contrast/brightness in selected areas

Hi all

I am new to IMAGEJ/Fiji and have some troubles.

I have a TEM picture which is composed from 4 collectors and merged automatically into one picture.
However, the setup is not calibrated properly, leading to different contrast/brightness for the different collectors.
Therefore I am trying to go through the four sub pictures one by one and adjust the contrast so that I get a nice final picture

However no matter what I try the adjust contrast/brightness is effecting the whole image and not the selection I have made.

Hopefully it is possible to create a macro that can do this adjustment for all of my pictures, but right now I just need help getting started.

A sample image can be found here:

https://drive.google.com/folderview?id=0B-5vWo4CxRjub1ZaRG9KVkxHVkk&usp=sharing

Thanks in advance

Søren Roesgaard


--
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: Contrast/brightness in selected areas

Jan Eglinger
Hi Søren,

an alternative method in your case is to use the
'Image > Stacks > Tools > Montage to Stacks...'
command, then make the adjustments on each slice and redo the montage
using 'Image > Stacks > Make Montage...'.

The respective macro commands are:

     run("Montage to Stack...", "images_per_row=2 images_per_column=2");

     run("Make Montage...", "columns=2 rows=2 scale=1 increment=1");

Cheers,
Jan


On 27.06.2014, 9:45 AM, Straatman, Kees (Dr.) wrote:

> Dear Søren,
>
> You can duplicate your selection, make your changes in the duplicated image, copy the optimised image, select your original image with the selection still in place and paste the optimised selection back in the ROI.
>
> Best wishes
>
> Kees
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Søren Roesgaard Nielsen
> Sent: 27 June 2014 08:24
> To: [hidden email]
> Subject: Contrast/brightness in selected areas
>
> Hi all
>
> I am new to IMAGEJ/Fiji and have some troubles.
>
> I have a TEM picture which is composed from 4 collectors and merged automatically into one picture.
> However, the setup is not calibrated properly, leading to different contrast/brightness for the different collectors.
> Therefore I am trying to go through the four sub pictures one by one and adjust the contrast so that I get a nice final picture
>
> However no matter what I try the adjust contrast/brightness is effecting the whole image and not the selection I have made.
>
> Hopefully it is possible to create a macro that can do this adjustment for all of my pictures, but right now I just need help getting started.
>
> A sample image can be found here:
>
> https://drive.google.com/folderview?id=0B-5vWo4CxRjub1ZaRG9KVkxHVkk&usp=sharing
>
> Thanks in advance
>
> Søren Roesgaard

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

Re: Contrast/brightness in selected areas

gankaku
In reply to this post by Søren Roesgaard Nielsen
Hi Søren,

As I see it your problem is actually not a different contrast per image but
rather a shading difference over the complete 4 tiles as well as in each
individual tile.
When you try to adjust this with the normal contrast adjustment or linear
histogram stretching (>Process >Enhance Contrast) you will rather make it
worse because you enhance those differences.

I would recommend rather a shading correction. So, here is a possible
workflow:

Create a stack from your image as stated by Jan Eglinger: run("Montage to
Stack...", "images_per_row=2 images_per_column=2");

Download the following plugin for pseudo flat-field correction (
http://sites.imagej.net/BioVoxxel/plugins/Filters/Pseudo_flat_field_correction.class-20140519201143
).

You need your stack as 8-bit image. So you need to convert it by >Image
>Type >8-bit

When you start the plugin on the created image stack you need to define a
blurring radius (this applies a Gaussian Blur filter to a copy of the
active image/slice). You need to adjust this radius while checking the
preview checkbox to see that in the background image there is no structural
information of your original image left but only blur that much that you
still can see the shading difference. I tested this in your case a radius
of 90 pixels is working fine.

After pressing "Ok" you will be asked if you want to apply this to all
images. Here select "Yes".

Now, your stack is corrected for the shading differences to some extend
(this method might not be suitable for all images but for your example it
is).

Then you apply the second command from Jan Eglingers post:    run("Make
Montage...", "columns=2 rows=2 scale=1 increment=1");


or simply try the following macro if you installed the Pseudo flat-field
correction plugin:

setBatchMode(true);
original = getTitle();
run("Montage to Stack...", "images_per_row=2 images_per_column=2 border=0");
run("8-bit");
run("Pseudo flat field correction", "blurring=90 stack");
selectWindow("Stack");
run("Make Montage...", "columns=2 rows=2 scale=1 first=1 last=4 increment=1
border=0 font=12");
setBatchMode("show");
close("Stack_Background");
close("Stack");
setBatchMode(false);

Now your image should look better concerning the different shading.
Caution, you should potentially do the blurring on a slice which contains
more structural information like your lower right image part to make sure
your blurring really does eliminate all structural information.

You could in theory also apply the pseudo flat-field correction directly to
your mosaic but this will not eliminate the differences at the border
connections.

For any more question, don't hesitate to contact me.

cheers,
Jan





2014-06-27 9:23 GMT+02:00 Søren Roesgaard Nielsen <[hidden email]>:

> Hi all
>
> I am new to IMAGEJ/Fiji and have some troubles.
>
> I have a TEM picture which is composed from 4 collectors and merged
> automatically into one picture.
> However, the setup is not calibrated properly, leading to different
> contrast/brightness for the different collectors.
> Therefore I am trying to go through the four sub pictures one by one and
> adjust the contrast so that I get a nice final picture
>
> However no matter what I try the adjust contrast/brightness is effecting
> the whole image and not the selection I have made.
>
> Hopefully it is possible to create a macro that can do this adjustment for
> all of my pictures, but right now I just need help getting started.
>
> A sample image can be found here:
>
>
> https://drive.google.com/folderview?id=0B-5vWo4CxRjub1ZaRG9KVkxHVkk&usp=sharing
>
> Thanks in advance
>
> Søren Roesgaard
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--

CEO: Dr. rer. nat. Jan Brocher
phone:  +49 (0)6234 917 03 39
mobile: +49 (0)176 705 746 81
e-mail: [hidden email]
info: [hidden email]
inquiries: [hidden email]
web: www.biovoxxel.de

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

Re: Contrast/brightness in selected areas

Gabriel Landini
In reply to this post by Jan Eglinger
> > -----Original Message-----
> > I have a TEM picture which is composed from 4 collectors and merged
> > automatically into one picture. However, the setup is not calibrated
> > properly, leading to different contrast/brightness for the different
> > collectors. Therefore I am trying to go through the four sub pictures one
> > by one and adjust the contrast so that I get a nice final picture

Further to the good previous advice, the problem is that your background is
not even, so just adjusting brightness to 2 adjacent frames probably does not
make the other adjacent frames match.
One thing you can do is to convert your montage to a stack as suggested, then
try to 'flatten' the background of your images using some background
correction method and remake the montage.

You should read this (the "retrospective" section):
http://imagejdocu.tudor.lu/doku.php?id=howto:working:how_to_correct_background_illumination_in_brightfield_microscopy

then try some of the "a posteriori" methods, but always having in mind that
will be degrading the image contents by making assumptions on how the
background behaves, when we do not know how correct that is. The images might
look better, but the image data might become artificially biased (eg, if you
are intending to measure intensities).

Good luck,

Gabriel

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

Re: Contrast/brightness in selected areas

gankaku
Hi Soren, Hi Gabriel,

Thanks, Gabriel, for complementing my post.
I forgot to underline what you mentioned (and which is very important
here) that any intensity measurements after such a pseudo flat-field
correction are obviously extremely biased and cannot be considered reliable
nor accurate. So, in other words... they should rather not be performed!
But I assumed that Soren will not measure intensities on this image type
but rather improve visibility.

@ Soren: The link Gabriel provided actually gives you further understanding
also on the pseudo flat-field correction method included in my suggestion
and macro.

If somebody is also interested in the outcome of the macro/plugin here I
post a before-after-comparison snapshot


2014-06-27 14:39 GMT+02:00 Gabriel Landini <[hidden email]>:

> > > -----Original Message-----
> > > I have a TEM picture which is composed from 4 collectors and merged
> > > automatically into one picture. However, the setup is not calibrated
> > > properly, leading to different contrast/brightness for the different
> > > collectors. Therefore I am trying to go through the four sub pictures
> one
> > > by one and adjust the contrast so that I get a nice final picture
>
> Further to the good previous advice, the problem is that your background is
> not even, so just adjusting brightness to 2 adjacent frames probably does
> not
> make the other adjacent frames match.
> One thing you can do is to convert your montage to a stack as suggested,
> then
> try to 'flatten' the background of your images using some background
> correction method and remake the montage.
>
> You should read this (the "retrospective" section):
>
> http://imagejdocu.tudor.lu/doku.php?id=howto:working:how_to_correct_background_illumination_in_brightfield_microscopy
>
> then try some of the "a posteriori" methods, but always having in mind that
> will be degrading the image contents by making assumptions on how the
> background behaves, when we do not know how correct that is. The images
> might
> look better, but the image data might become artificially biased (eg, if
> you
> are intending to measure intensities).
>
> Good luck,
>
> Gabriel
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>


--

CEO: Dr. rer. nat. Jan Brocher
phone:  +49 (0)6234 917 03 39
mobile: +49 (0)176 705 746 81
e-mail: [hidden email]
info: [hidden email]
inquiries: [hidden email]
web: www.biovoxxel.de

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

comparison.png (405K) Download Attachment