Posted by
Rainer M. Engel on
URL: http://imagej.273.s1.nabble.com/Image-Thresholding-for-Binary-workflow-tp5007850p5007875.html
Thank you Michael and Jan,
good advice which will work in most cases. Very good.
Then, what would be the best (fastest) method to filter for a distinct
color value. The Macro Expression did not seem to be very fast on that.
Someting like "Replace value" (Plugin, FIJI) for 32bit images would be
great, although I did not test it for speed so far.
Speed:
run("Macro...", "code=[if (v==127) v=0;]"); -> 12547ms
run("Replace value", "pattern=127 replacement=0"); -> 125ms
But the plugin does not care about ROIs ...
I'm not sure if I can modify the plugins code, anyway, maybe I'll have a
look some time. Should be feasible ;-)
Best regards,
Rainer
Am 23.05.2014 14:59, schrieb Michael Schmid:
> Hi Rainer,
>
>> Process > Binary > Make Binary
>> sometimes caused plausible black/white dominance switches.
>
> If you have this problem, it is most likely caused by different settings of 'Black Background' in Process>Binary>Options. You should also check whether the image has an inverted LUT.
>
>> I tried ..
>> setMinAndMax(173, 173);
>> .. but this does no clamping like I thought it might..
>
> The setMinAndMax changes only the display, not the image data. For 8-bit images, this is done via the LUT, so you can apply the LUT afterwards, and the image will be converted to 0 (values less or equal 173) and 255 (values higher than 173). The mapping will be independent on LUT and Black background settings:
>
> setMinAndMax(173, 173);
> run("Apply LUT");
>
>
> Michael
> ________________________________________________________________
> On May 22, 2014, at 11:23, Rainer M. Engel wrote:
>
>> Hello together,
>>
>> I'm looking for way to threshold an image and in the same process making
>> it binary.
>>
>> Process > Binary > Make Binary
>> sometimes caused plausible black/white dominance switches.
>>
>> Process > Math > Macro
>> works better for my purposes (i.e.| if (v<=25) v=0; else v=255)
>>
>> The later Expression is very slow compared even to an Gaussian Blur or
>> similar. Are there other, hopefully faster ways (for high resolution) to
>> threshold and make binary (8bit)?
>>
>> I tried ..
>> setMinAndMax(173, 173);
>> .. but this does no clamping like I thought it might..
>>
>> Any help is much appreciated.
>>
>> Best regards,
>> Rainer
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html