Posted by
Michael Schmid on
Jun 02, 2015; 12:41pm
URL: http://imagej.273.s1.nabble.com/Clearing-32-bit-float-images-tp5013008p5013014.html
Hi Wilhelm,
for setting a pixel value to zero (or any other [uncalibrated] numeric value): Use Process>Math>Set.
If you have a float image and you want to invert it by changing the sign, use Process>Math>Multiply to multiply by -1.
The Edit>Fill (Edit>Clear) command uses the eyedropper foreground (background) color or whatever comes closest for the way the image is currently displayed.
Edit>Invert uses the current display range, i.e. the min and max that you can set in the Brightness&Contrast panel. So you can have e.g. a 16-bit image, display it as 12-bit image (0-4095) and have 'Invert' create the correct values if if you would invert a 12-bit image (0 becomes 4095, and 4095 becomes 0). You could also have a float image with pixel values 0-255, display it with this range, and do the 'Invert' operation just as if it were an 8-bit image, but with floating-point accuracy.
With this convention, Edit>Invert also ensures that an image that is displayable with the current B&C settings remains displayable after 'Invert'. If you have a floating-point image with pixels e.g. 0-255, and you would invert it by multiplying with -1, it will be all black when shown with the 0-255 display range.
Michael
________________________________________________________________
On Jun 2, 2015, at 11:26, Burger Wilhelm wrote:
> Hello Gabriel,
>
> yes, this works, thanks!
>
> It seems odd though - at least for scalar-valued images - that the 'clear' value must be specified as an RGB tuple. And is there any way to set the background to a negative value?
>
> The meaning of "Invert" on float images seems to be a similar issue ...
>
> --Wilhelm
>
>
>> -----Original Message-----
>> From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
>> Gabriel Landini
>> Sent: Tuesday, June 02, 2015 10:54 AM
>> To:
[hidden email]
>> Subject: Re: Clearing 32 bit float images
>>
>> On Tuesday 02 Jun 2015 10:09:55 Burger Wilhelm wrote:
>>> when applying 'Edit -> Clear' on a 32 bit float image (FloatProcessor) I
>>> would assume that the affected pixel values are set to zero. However, the
>>> command inserts some other (display-related?) value. E.g., on the "bridge"
>>> sample image, the new value is 85.0.
>>>
>>> Is this intended behaviour? If yes, how is the clear value determined?
>>
>> Hi Wilhelm,
>> It uses the values in the colour picker.
>> If you set the background colour to 0 it clears with that value.
>>
>> Cheers
>>
>> Gabriel
>>
>> --
>> 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