comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Cut, copy and paste
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Cut, copy and paste [message #12230] Tue, 28 July 1998 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Daniel SAGE wrote:
>
> Hello,
> I am using IDL 5.1. I create a widget to visualize an image (TIFF)
> with different options. It misses the traditional Edit with the well
> known command cut, copy, and paste to copy a portion of an image.
> Is there a possibility to write a cut/copy/paste in IDL ?

Jan -

Yes! But the key word here is "write". You can use IDL's DEFROI.PRO to
define a polygonal region of interest on the image (or download
DEFROI2.PRO/.DOC and DEFROIS.PRO/.DOC from:

ftp://bial8.ucsd.edu pub/software/idl/share/idl_share.tar.gz

These routines allow you to define multiple ROI's at once, and
are a bit more flexible than DEFROI.PRO. It looks like you're
involved with medical imaging, so there might be more routines
here that would be useful. See the README file for routine
summaries.

You can also get a rubber-band box routine from Ray Sterner's
libraries:

http://fermi.jhuapl.edu/s1r/idl/idl.html

There are a *ton* of other routines here. I wouldn't think of writing
something unless I had checked here first.

As for the method, I'd suggest implementing a "buffer" for your
cut/copy/paste, as a pixmap window, and then use a combination of:
"TV", "TVRD", "DEVICE, COPY=[]" to perform the moving of data from
your window to/from the pixmap. Be careful using TVRD with scrollable
draw widgets or when the widget is obscured/iconified. This has been
a bug under X-Windows for some time now, and I'm not sure if it has
been fixed in 5.x or not. You can always use my SAFE_TVRD.PRO instead,
but it's just a bit slower (but it works consistently!).

Hope this helps.

Dave
--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
[Message index]
 
Read Message
Read Message
Previous Topic: Tick mark annotations after rotation using az?
Next Topic: Cut, copy and paste

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 11:48:47 PDT 2025

Total time taken to generate the page: 1.91934 seconds