Posted by
gankaku on
Jun 27, 2014; 10:33am
URL: http://imagej.273.s1.nabble.com/Contrast-brightness-in-selected-areas-tp5008461p5008465.html
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