Image shifts during pasting

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

Image shifts during pasting

Adam Hacking
Hi,
 
I am noticing some strange behavior when using the paste command. Here are some of the step taken
 
- open the image and make a duplicate
- outline the ROI (polygon)
- copy
- cut
- paste into original
- paste into duplicate
 
Result
 
Pasting into the original results in perfect replacement (position).
Pasting over the duplicate results in displacement of the pasted section.
 
Any thoughts ?
 
Thanks
 
Adam





Reply | Threaded
Open this post in threaded view
|

Re: Image shifts during pasting

Michael Schmid
Hi Adam,

if 'Restore Selection' (ctrl-shift-E) does not work, you can use the  
Roi Manager to transfer selections from one image to another.

For rectangular rois, you can also do something like, e.g., the  
following:

getSelectionBounds(x, y, width, height);
run("Copy");
makeRectangle(x+2, y+2, width, height);
run("Paste");

This shifts the paste area by 2 pixels in x and y.

Michael
________________________________________________________________

On 1 Jul 2009, at 16:06, Adam Hacking wrote:

> Thanks.
>
> Is there a way to get / direct the coords for the paste location  
> this so the user does not have to manually select the paste region ?
>
> Adam
>
>
>
> --- On Wed, 7/1/09, Michael Schmid <[hidden email]> wrote:
>
> Hi Adam,
>
> select the area where ot paste it, otherwise it will be pasted into
> the center.
> If no other roi is created/modified in between, you can do this with
> "Restore selection"
>
> Michael
> ________________________________________________________________
>
> On 1 Jul 2009, at 15:42, Adam Hacking wrote:
>
> > Hi,
> >
> > I am noticing some strange behavior when using the paste command.
> > Here are some of the step taken
> >
> > - open the image and make a duplicate
> > - outline the ROI (polygon)
> > - copy
> > - cut
> > - paste into original
> > - paste into duplicate
> >
> > Result
> >
> > Pasting into the original results in perfect replacement (position).
> > Pasting over the duplicate results in displacement of the pasted
> > section.
> >
> > Any thoughts ?
> >
> > Thanks
> >
> > Adam
> >
> >
> >
> >
> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Image shifts during pasting

Gabriel Landini
In reply to this post by Adam Hacking
On Wednesday 01 July 2009  15:38:55 Adam Hacking wrote:
> I am noticing some strange behavior when using the paste command. Here are
some of the step taken
>  
> - open the image and make a duplicate
> - outline the ROI (polygon)
> - copy
> - cut
> - paste into original
> - paste into duplicate

No strange result.

> Pasting into the original results in perfect replacement (position).

Yes

> Pasting over the duplicate results in displacement of the pasted section.

The pasting into a new image which is not the source of the ROI, takes place
at the centre of the image.
If you want to paste in the same place *and the image has at least the same
size* (i.e. it can be larger)  use Restore Selection and then Paste.

G.