Hello all,
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? --Wilhelm -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
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 |
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 |
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 |
In reply to this post by Burger Wilhelm
On Jun 2, 2015, at 5:26 AM, Burger Wilhelm <[hidden email]> 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? I do not know how to set the background to a negative value using the GUI but you can use the ImageProcessor.setColor(double) method to set it, as in the following example. > The meaning of "Invert" on float images seems to be a similar issue … Each pixel in the float image is inverted using p = max - (p - min); where ‘min’ and ‘max’ are the limits of the display range, set using ImageProcessor.setMinAndMax(double,double), as in the example below. -wayne imp = IJ.createImage("original", "32-bit ramp", 500, 500, 1); roi = new OvalRoi(106,108,259,211); ip = imp.getProcessor(); ip.setRoi(roi); ip.setColor(-1); ip.fill(ip.getMask()); ip.setMinAndMax(-1, 1); ip.resetRoi(); IJ.log("original: "+ip.getStatistics()); imp.show(); ip2 = ip.duplicate(); ip2.invert(); IJ.log("inverted: "+ip2.getStatistics()); new ImagePlus("inverted",ip2).show(); >> -----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 |
In reply to this post by Michael Schmid
Makes sense, I was not aware of this 'convention'.
Thanks to Micheal and Wayne for clarifying this! --Wilhelm ________________________________________ From: ImageJ Interest Group [[hidden email]] On Behalf Of Michael Schmid [[hidden email]] Sent: Tuesday, June 02, 2015 14:41 To: [hidden email] Subject: Re: Clearing 32 bit float images 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 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |