Re: 2D histogram of two channels

Posted by Rainer M. Engel on
URL: http://imagej.273.s1.nabble.com/2D-histogram-of-two-channels-tp5022216p5022220.html

Dear Philipp and Jan,

I tried both methods you proposed.

I used the older version of color finder (2006/08/29: Version 1.2),
which gives me a 256x256px image right away. It applies some Auto
Threshold and sets "Fire" as LUT.

The groovy script Jan provided works also nice and as it seems maybe
with some advantage regarding speed & accuracy. I'll have to see.

I'm much more accustomed to the macro language, but I understand what
kind of groovy thing is going on and I'll try to extent the script to
some batch processing. I also found some related templates (Fiji Script
Editor).

Thank you both for your help.

Regards,
Rainer



Am 04.06.2019 um 16:38 schrieb Jan Eglinger:

> Dear Rainer,
>
> in Fiji, you can get the result image of the Coloc_2 plugin directly via
> scripting languages, e.g. using the following Groovy script:
>
> ```
> #@ Img input1
> #@ Img input2
>
> import sc.fiji.coloc.gadgets.DataContainer
> import sc.fiji.coloc.algorithms.Histogram2D
>
> container = new DataContainer(input1, input2, 0, 0, "First", "Second")
>
> hist2d = new Histogram2D("My custom 2D histogram")
> hist2d.execute(container)
>
> result = hist2d.getPlotImage()
> ```
>
> The result image is 32-bit, so you will have to adjust the display range
> to see anything.
>
> For the red and green channel of the Clown sample image, I get the
> attached result image. Interestingly, there seem to be some strange
> artifacts in the 2D histogram image that I can't see in the 1d histogram
> plots of the same image. Dan White (the author of Coloc_2) might want to
> comment on this, but I'm not sure if he still subscribed to this mailing
> list, so it might be worth asking on the image.sc forum instead:
> https://forum.image.sc/
>
> Best regards
> Jan
>
>
> On 04.06.2019 12:38, Rainer M. Engel wrote:
>> Hey..
>>
>> I did some search for 2D histograms of two channels (or of two one
>> channel/grey images).
>>
>> It would look for example like this:
>> https://www.pyimagesearch.com/wp-content/uploads/2014/01/grant-2d-histograms.png
>>
>> Source [1]
>>
>> I found another resource, which describes image properties one
>> could read from these [2]. By this I got some new search phrases and
>> found Coloc 2 as an ImageJ-Plugin [3].
>>
>> Can this plugin export the resulting 256x256px 2D Histograms? I have not
>> made this so far. Here they are called 2D intensity histograms. The
>> distributions' weight is also shown with an overlayed straight line
>> (regression line). This seems to be a static feature.
>>
>> Is there a way to access/store this "2D intensity histogram"?
>>
>> Any help is much appreciated.
>>
>> Regards,
>> Rainer
>>
>>
>> [1]
>> https://www.pyimagesearch.com/2014/01/22/clever-girl-a-guide-to-utilizing-color-histograms-for-computer-vision-and-image-search-engines/
>>
>>
>> [2] https://svi.nl/TwoChannelHistogram
>>
>> [3] https://imagej.net/Coloc_2
>>
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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