Login  Register

Re: fill value for Translate...

Posted by Michael Schmid on Sep 16, 2013; 12:50pm
URL: http://imagej.273.s1.nabble.com/fill-value-for-Translate-tp5004772p5004803.html

Hi Michael,

the 'fill' color for the background on Image>Transform>Translate is actually neither white nor black but simply a pixel value of zero (uncalibrated).

If you want to have a different pixel value, you have two possibilities:
(a) Use 32-bit (float) images, subtract a value before translation and add it thereafter
(b) Select the translated area after translation, 'Make Inverse' of the selection and fill that area with the desired value (Process>Math>Set if you have the numeric value). You can easily have a macro for this.
Method (b) won't work well if you translate by a non-integer number of pixels: The border won't be calculated correctly.

Michael
________________________________________________________________
On Sep 16, 2013, at 14:31, Michael Elbaum wrote:

> Thanks Gabriel,     but unfortunately white is no better. Creating a larger image with background fill and then pasting the image in should work, but this is bad for memory esp for working with stacks. I tried selecting the desired grey with the color picker but the border remains black after translation.
> regards,
> Michael
>
>
> ________________________________________
> From: ImageJ Interest Group [[hidden email]] on behalf of Gabriel Landini [[hidden email]]
> Sent: Friday, September 13, 2013 2:38 PM
> To: [hidden email]
> Subject: Re: fill value for Translate...
>
> On Friday 13 Sep 2013 12:18:46 you wrote:
>> Dear all,    when translating an image the background is filled with black.
>> Is it possible to fill with some other value? for example the mean or the
>> average of the perimeter? thanks,
>> Michael
>
>
> If you do:
>
> Invert
> Translate
> Invert
>
> the background is white (at least in my setup).
>
> 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