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

Home » Public Forums » archive » Re: postscript output from Slicer
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: postscript output from Slicer [message #1568] Wed, 15 December 1993 10:34
chase is currently offline  chase
Messages: 62
Registered: May 1993
Member
>>>> > "Sean" == Sean Oughton <so1@st-andrews.ac.uk> writes:
In article <2en2oj$en4@calvin.st-and.ac.uk> so1@st-andrews.ac.uk (Sean Oughton) writes:


Sean> How do you get the output from the Slicer (the isosurface
Sean> drawer) say inot a postscript file? I've checked both the
Sean> online help and the manuals without turning anything up. It
Sean> must be able to be done somehow.

Sean> Cheers sean@dcs.st-and.ac.uk


As of IDL 3.1 there was no option for printing from the slicer.pro
widget program. Some time ago I made a quick little hack for getting
a postscript file of the slicer image window. When "PRINT" is chosen
(from the menu button) it reads back the displayed slicer image and
the writes it to "idl.ps". It is extremely simple, but at least it
gets me some kind of hardcopy. I give the changes below.

I would have posted a UNIX diff for the changes that I made, but the
slicer program has changed with almost every release of IDL. However,
my additions are easy to incorporate.

Make a copy of slicer.pro and put it somewhere in your !PATH where it
will be found before the slicer.pro that comes with the IDL
distribution. Then make the following changes.

--------
In procdure "slicer_event" make the following addition ( the "!" at
the beginning of the line indicates a changed or new line. Remove the
"!" - it is not part of the code.):

case eventval of
!"PRINT": BEGIN
! WIDGET_CONTROL, sl.base, sensitive=0
! ;; It can take a long time to do a TVRD()
! message_base = WIDGET_BASE(title='Working...',xsize=200)
! WIDGET_CONTROL,message_base,/realize
! this_image = tvrd()
! set_plot,'ps',/copy
! tv,this_image
! device,/close
! set_plot,'x'
! WIDGET_CONTROL, message_base,/destroy
! WIDGET_CONTROL, sl.base, sensitive=1
!END

--------
In procdure "slicer" make the following changes:

An older version of slicer used XPdMenu:


XPdMenu, [ '" Done " EXIT', $
'" Erase " ERASE', $
'" Undo " UNDO', $
! '" Help " HELP', $
! '" Print " PRINT' $
! ], lbase

or for the newer version (as of IDL 3.1) which uses WIDGET_BUTTONS
instead of the menus add the "!" line below:

junk = WIDGET_BASE(lbase, COLUMN=3)
junk1 = WIDGET_BUTTON(junk, value="Done", uvalue = "EXIT", /NO_REL)
junk1 = WIDGET_BUTTON(junk, value = "Erase", uvalue = "ERASE", /NO_REL)
!junk1 = WIDGET_BUTTON(junk, value = "Print", uvalue = "PRINT", /NO_REL)
junk1 = WIDGET_BUTTON(junk, value="Undo", uvalue = "UNDO", /NO_REL)
junk1 = WIDGET_BUTTON(junk, value="Help", uvalue = "HELP", /NO_REL)
junk1 = WIDGET_BUTTON(junk, VALUE='Orientation',/MENU)


-----------

Remeber to set your postscript device parameters before using slicer.
If necessary, from the command line before executing slicer (or you can
put this at the beginning of procedure "slicer" in slicer.pro):


;; Setup the postscript device
set_plot,'ps'
device,/color,bits=8 ;; Or whatever is appropiate for you
set_plot,'x'

You can try out the changes by using the IDL xdemo procedure.

It is not much, but I hope it is useful.

Chris
--
===============================
Bldg 24-E188
The Applied Physics Laboratory
The Johns Hopkins University
(301)953-6000 x8529
chris_chase@jhuapl.edu
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: postscript output from Slicer
Next Topic: Re: IDL via MacX

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

Current Time: Thu Oct 09 16:07:03 PDT 2025

Total time taken to generate the page: 0.48469 seconds