Login  Register

Duplicate command fails to preserve overlay coordinates relative to image data coordinates.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Duplicate command fails to preserve overlay coordinates relative to image data coordinates.

Michael Ellis
43 posts
The Duplicate command when used with a region of interest to create a copy of a portion of an image, fails to translate the overlay.

For example:

- Open the "Clown"  sample image,
- Use the Oval ROI tool to draw an oval around the clown's right eye. (right to you, not the clown - not that it really matters!)
- Add this oval to the overlay using the "Add Selection" tool.
- Create a rectangular ROI that is larger than and  completely encloses the overlay oval.
- Use the Duplicate command to create a copy of the selected ROI of the image.

The selected portion of the image is duplicated but the oval in the overlay now occupies a different position relative to the clown's eye.

This script the demonstrates the problem:

run("Clown (14K)");
makeOval(147, 62, 90, 44);
run("Add Selection...", "stroke=blue width=2 fill=none");
makeRectangle(111, 34, 166, 113);
run("Duplicate...", "title=clown-1.jpg");


The overlay is duplicated but its position relative to the image is not preserved.

Any thoughts? Is this a bug or a feature that other things rely on?

-- Michael Ellis
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Duplicate command fails to preserve overlay coordinates relative to image data coordinates.

Rasband, Wayne (NIH/NIMH) [E]
1064 posts
On Nov 18, 2010, at 9:37 AM, [hidden email] wrote:

> The Duplicate command when used with a region of interest to create a copy of a portion of an image, fails to translate the overlay.
>
> For example:
>
> - Open the "Clown"  sample image,
> - Use the Oval ROI tool to draw an oval around the clown's right eye. (right to you, not the clown - not that it really matters!)
> - Add this oval to the overlay using the "Add Selection" tool.
> - Create a rectangular ROI that is larger than and  completely encloses the overlay oval.
> - Use the Duplicate command to create a copy of the selected ROI of the image.
>
> The selected portion of the image is duplicated but the oval in the overlay now occupies a different position relative to the clown's eye.
>
> This script the demonstrates the problem:
>
> run("Clown (14K)");
> makeOval(147, 62, 90, 44);
> run("Add Selection...", "stroke=blue width=2 fill=none");
> makeRectangle(111, 34, 166, 113);
> run("Duplicate...", "title=clown-1.jpg");
>
>
> The overlay is duplicated but its position relative to the image is not preserved.
>
> Any thoughts? Is this a bug or a feature that other things rely on?

This is a bug that is fixed in the 1.44k daily build.

-wayne
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Duplicate command fails to preserve overlay coordinates relative to image data coordinates.

Michael Ellis
43 posts
Wayne,

Wow! that was fast!

Many thanks.

Michael Ellis

On 18 Nov 2010, at 21:30, Rasband, Wayne (NIH/NIMH) [E] wrote:

> On Nov 18, 2010, at 9:37 AM, [hidden email] wrote:
>
>> The Duplicate command when used with a region of interest to create a copy of a portion of an image, fails to translate the overlay.
>>
>> For example:
>>
>> - Open the "Clown"  sample image,
>> - Use the Oval ROI tool to draw an oval around the clown's right eye. (right to you, not the clown - not that it really matters!)
>> - Add this oval to the overlay using the "Add Selection" tool.
>> - Create a rectangular ROI that is larger than and  completely encloses the overlay oval.
>> - Use the Duplicate command to create a copy of the selected ROI of the image.
>>
>> The selected portion of the image is duplicated but the oval in the overlay now occupies a different position relative to the clown's eye.
>>
>> This script the demonstrates the problem:
>>
>> run("Clown (14K)");
>> makeOval(147, 62, 90, 44);
>> run("Add Selection...", "stroke=blue width=2 fill=none");
>> makeRectangle(111, 34, 166, 113);
>> run("Duplicate...", "title=clown-1.jpg");
>>
>>
>> The overlay is duplicated but its position relative to the image is not preserved.
>>
>> Any thoughts? Is this a bug or a feature that other things rely on?
>
> This is a bug that is fixed in the 1.44k daily build.
>
> -wayne