Possible to scale an image with its overlay?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible to scale an image with its overlay?

lechristophe
Hi,

I wonder if there is a way to scale or change an image size and scale its
overlay accordingly, i.e. keep the same overlay (but scaled) on the output
image. I've tried Image>Adjust>Size and Image>Scale, but they don't seem to
keep the overlay in the output image. That would be tremendously useful to
compose figures (prepare zoom boxes from high res image, put the ROIs in
the overlay, scale down the whole image and keep the zoom boxes scaled
accordingly).

Thanks for your help,

Christophe

--
Christophe Leterrier
Researcher
Axonal Domains Architecture Team
CRN2M CNRS UMR 7286
Aix Marseille University, France

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Possible to scale an image with its overlay?

Jirka
Hello,
I may have a plugin you ask, it overlay two images together with various
transparency and scale the second image to fit the size of the first one...

JB

--
Best regards, Jiri Borovec
----------------------------------------------------------------------------------------------------
Ing. Jiri Borovec, MSc                           <[hidden email]>
PhD student at CMP CTU, member ISC  |       tel.: +420 2 2435 7590
http://cmp.felk.cvut.cz/~borovji3             |    mob.: +420 728 480 285


On 15 March 2014 17:49, Christophe Leterrier <[hidden email]
> wrote:

> Hi,
>
> I wonder if there is a way to scale or change an image size and scale its
> overlay accordingly, i.e. keep the same overlay (but scaled) on the output
> image. I've tried Image>Adjust>Size and Image>Scale, but they don't seem to
> keep the overlay in the output image. That would be tremendously useful to
> compose figures (prepare zoom boxes from high res image, put the ROIs in
> the overlay, scale down the whole image and keep the zoom boxes scaled
> accordingly).
>
> Thanks for your help,
>
> Christophe
>
> --
> Christophe Leterrier
> Researcher
> Axonal Domains Architecture Team
> CRN2M CNRS UMR 7286
> Aix Marseille University, France
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Possible to scale an image with its overlay?

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by lechristophe
On Mar 15, 2014, at 12:49 PM, Christophe Leterrier wrote:

> Hi,
>
> I wonder if there is a way to scale or change an image size and scale its
> overlay accordingly, i.e. keep the same overlay (but scaled) on the output
> image. I've tried Image>Adjust>Size and Image>Scale, but they don't seem to
> keep the overlay in the output image. That would be tremendously useful to
> compose figures (prepare zoom boxes from high res image, put the ROIs in
> the overlay, scale down the whole image and keep the zoom boxes scaled
> accordingly).

Try scaling the image on screen using the Image>Zoom>Set command and then creating an RGB version using Plugins>Utilities>Capture Image. You can improve the quality of enlarged images by enabling "Interpolate zoomed images" in the Edit>Options>Appearance dialog box.

-wayne
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Possible to scale an image with its overlay?

lechristophe
Dear Wayne,

Thanks for the tip, it will work for images that are smaller than the
screen though I guess? I work with images that are 10k x 10k pixels, and
the "small" version I want to generate is around 2k x 2k, still bigger than
my screen. WHat I do now is that I generate the small image, "burn" the
ROIs in the big image, generate another small image with the ROI boxes, and
recreate the selection from this burnt image befor transferring them to the
intact small image... If there is no possibility to get overlay scaling
built-in, I think I'll write a macro to automatically scale all ROIs in the
ROI manager.

Christophe


2014-03-15 18:45 GMT+01:00 Rasband, Wayne (NIH/NIMH) [E] <
[hidden email]>:

> On Mar 15, 2014, at 12:49 PM, Christophe Leterrier wrote:
>
> > Hi,
> >
> > I wonder if there is a way to scale or change an image size and scale its
> > overlay accordingly, i.e. keep the same overlay (but scaled) on the
> output
> > image. I've tried Image>Adjust>Size and Image>Scale, but they don't seem
> to
> > keep the overlay in the output image. That would be tremendously useful
> to
> > compose figures (prepare zoom boxes from high res image, put the ROIs in
> > the overlay, scale down the whole image and keep the zoom boxes scaled
> > accordingly).
>
> Try scaling the image on screen using the Image>Zoom>Set command and then
> creating an RGB version using Plugins>Utilities>Capture Image. You can
> improve the quality of enlarged images by enabling "Interpolate zoomed
> images" in the Edit>Options>Appearance dialog box.
>
> -wayne
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Possible to scale an image with its overlay?

Jan Eglinger
Hi Christophe,

On 15.03.2014, 9:06 PM, Christophe Leterrier wrote:
> WHat I do now is that I generate the small image, "burn" the
> ROIs in the big image, generate another small image with the ROI boxes, and
> recreate the selection from this burnt image befor transferring them to the
> intact small image... If there is no possibility to get overlay scaling
> built-in, I think I'll write a macro to automatically scale all ROIs in the
> ROI manager.
>

Did you try the 'Edit > Selection > Create Mask' command to create a
mask, then scale the mask and create a selection from it again?

Something along these (ImageJ macro) lines:

   run("Blobs (25K)");
   makeRectangle(50, 50, 60, 40);
   run("Create Mask");
   run("Size...", "width=512 height=508 constrain");
   setAutoThreshold("Default dark");
   run("Create Selection");
   selectWindow("blobs.gif");
   run("Select None");
   run("Size...", "width=512 height=508 constrain");
   selectWindow("Mask");
   selectWindow("blobs.gif");
   run("Restore Selection");


Cheers,
Jan



> 2014-03-15 18:45 GMT+01:00 Rasband, Wayne (NIH/NIMH) [E] <
> [hidden email]>:
>
>> On Mar 15, 2014, at 12:49 PM, Christophe Leterrier wrote:
>>
>>> Hi,
>>>
>>> I wonder if there is a way to scale or change an image size and scale its
>>> overlay accordingly, i.e. keep the same overlay (but scaled) on the
>> output
>>> image. I've tried Image>Adjust>Size and Image>Scale, but they don't seem
>> to
>>> keep the overlay in the output image. That would be tremendously useful
>> to
>>> compose figures (prepare zoom boxes from high res image, put the ROIs in
>>> the overlay, scale down the whole image and keep the zoom boxes scaled
>>> accordingly).
>>
>> Try scaling the image on screen using the Image>Zoom>Set command and then
>> creating an RGB version using Plugins>Utilities>Capture Image. You can
>> improve the quality of enlarged images by enabling "Interpolate zoomed
>> images" in the Edit>Options>Appearance dialog box.
>>
>> -wayne
>> --
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Possible to scale an image with its overlay?

Christian Goosmann-2
In reply to this post by lechristophe
Hi Christophe
I wonder if the TRAKEM 2 plugin would help you. It is great for viewing
huge images and you can add arealists which are like overlays, that can
scale and transform together with the image layer. You can export a flat
RGB with the overlay visible in any scale from any rectangular
selection. It would be cracking a nut with a sledgehammer though.
Christian

---
Christian Goosmann
Mikroskopie
Max-Planck-Institut für Infektionsbiologie
Campus Charité Mitte
Charitéplatz 1
10117 Berlin
Tel.: +49 30 28460 388

Christophe Leterrier wrote:

> Hi,
>
> I wonder if there is a way to scale or change an image size and scale its
> overlay accordingly, i.e. keep the same overlay (but scaled) on the output
> image. I've tried Image>Adjust>Size and Image>Scale, but they don't seem to
> keep the overlay in the output image. That would be tremendously useful to
> compose figures (prepare zoom boxes from high res image, put the ROIs in
> the overlay, scale down the whole image and keep the zoom boxes scaled
> accordingly).
>
> Thanks for your help,
>
> Christophe
>
> --
> Christophe Leterrier
> Researcher
> Axonal Domains Architecture Team
> CRN2M CNRS UMR 7286
> Aix Marseille University, France
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Possible to scale an image with its overlay?

Christian Goosmann-2
In reply to this post by lechristophe
Hi Christophe

I just had exactly the same problem as you so many years ago (your mail
below). I wrote a short macro that sends the overlay to the roi manager,
iterates through all of the parts while scaling them one by one and
updating the overlay after scaling the image itself. Here is the version
that scales the image and overlay by 50% (the overlay elements "keep"
their size though because of the second "scale"):

roiManager("reset");
run("To ROI Manager");
roiManager("Show All without labels");
nroi = roiManager("count");
for (i = 0; i < nroi; i++) {
     roiManager("select", i);
     run("Scale... ", "x=0.50 y=0.50");
     run("Scale... ", "x=2 y=2 centered");
     roiManager("update");
}
run("Select None");
run("Scale...", "x=0.5 y=0.5 interpolation=None average create");
roiManager("Show All without labels");
run("From ROI Manager");

Still using your "transfer labels" macro for updating the labels of
stacks after a color merge by the way...

Best regards

Christian



---
Christian Goosmann
Mikroskopie
Max-Planck-Institut für Infektionsbiologie
Campus Charité Mitte
Charitéplatz 1
10117 Berlin
Tel.: +49 30 28460 388

On 15.03.2014 17:49, Christophe Leterrier wrote:

> Hi,
>
> I wonder if there is a way to scale or change an image size and scale its
> overlay accordingly, i.e. keep the same overlay (but scaled) on the output
> image. I've tried Image>Adjust>Size and Image>Scale, but they don't seem to
> keep the overlay in the output image. That would be tremendously useful to
> compose figures (prepare zoom boxes from high res image, put the ROIs in
> the overlay, scale down the whole image and keep the zoom boxes scaled
> accordingly).
>
> Thanks for your help,
>
> Christophe
>
> --
> Christophe Leterrier
> Researcher
> Axonal Domains Architecture Team
> CRN2M CNRS UMR 7286
> Aix Marseille University, France
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html