Login  Register

Re: Paste and Blend only overlapping regions (MakeMontage variation)

Posted by Michael Schmid on May 23, 2009; 10:18am
URL: http://imagej.273.s1.nabble.com/Paste-and-Blend-only-overlapping-regions-MakeMontage-variation-tp3692412p3692419.html

Hi Alan,

one possibility, though not as simple as the 'Paste Control', would be the
'Alpha Channel' plugin.

http://imagejdocu.tudor.lu/doku.php?id=plugin:utilities:alpha_channel:start

Create an 8-bit image with the same size of your output image, and set it
to the weight of the copied image: 255 for the areas where you have no
overlap, and 127 for the overlap.

Run the 'Alpha Channel' immediately after 'Paste'.

You can also have a soft transition: Put the edge of the alpha channel
into the center of the overlap area and select a 'smooth radius' > 0 in
the Alpha Channel Dialog.

Michael
_________________________________________________________________________

On Sat, May 23, 2009 11:05, Alan Hewat wrote:

> I have looked at various montage macros for creating composite mosaics
> from overlapping images, and wanted to try something simpler using
> "imageJ/Stacks/Make Montage". Since my image offsets required for
> registration are constant, I can modify the MakeMontage.txt macro to
> offset the image rectangles before pasting.
>
> This works fine, but instead of the default "Paste Control" (Copy) I
> would like to use Blend, but ***only for the overlapping regions***.
> (Otherwise Blend blends the non-overlapped regions with the white or
> other background).
>
>       newImage("test", type+" black", columns*getWidth, rows*getHeight,
> 1);
>       iw=getWidth/columns; ih=getHeight/rows;
>       x[0]=0; x[1]=-25; x[2]=0; x[3]=-25; // image offsets for
> registration
>       y[0]=0; y[1]=0; y[2]=-75; y[3]=-75; // image offsets for
> registration
>       montage=getImageID;
>       selectImage(id);
>       for (i=0; i<4; i++) {
>           selectImage(id);
>           setSlice(i+1);
>           run("Select All");
>           run("Copy");
>           selectImage(montage);
>           makeRectangle((i%columns)*iw+x[i], floor(i/columns)*ih+y[i], sw,
> sh);
>           run("Paste");
>       }
>
> I am relatively new to imageJ macros but am excited by the possibilities.
> ______________________________________________
> Dr Alan Hewat, NeutronOptics, Grenoble, FRANCE
> <[hidden email]> +33.476.98.41.68
>         http://www.NeutronOptics.com/hewat
> ______________________________________________
>