Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
A rant: features vs. programming features
I was wondering whether anyone else is has the impression that I do of IDL 5: that it makes programming many things easier, and certainly niftier (at least if OOP is your idea of nifty), but it hasn't added much in the way of real functionality. One area of functionality that I thought was screaming for attention was the production of Web-based material, specifically: � an /INTERLACED keyword for WRITE_GIF, � a WRITE_GIF_MOVIE routine, with keywords for pause length and repeats, � a WRITE_MPEG routine, ��a WRITE_SOUND routine (with AIFF and WAVE options), � a WRITE_QUICKTIME routine, and � maybe even WRITE_AVI. I realize that there are straightforward, free ways to do all of these things --- on some operating systems. But one of IDL's strengths is its cross-platform capabilities. Other areas that could be addressed include creation of image maps, clicking on any of which returns a pixel value, the straightforward creation of HTML tables from 2-D arrays of data (or structures), .... I know there's an "IDL on the Web" product in testing, but my impression is that that is quite different (opposite, in some sense): it is meant to make it easier to create Web pages that cause IDL to do things. Is anyone else interested in the kind of features I've mentioned, or am I totally crazy? I get the impression that almost everyone who uses IDL to display data representations eventually puts some of those representations on the Web, or would like to. Joe Gurman P.S. I must be getting to be a real curmudgeon, because I see the creation of Web content as a much more promising area for scientific/technical software than keeping programmers gainfully occupied. Still, both of the people we sent to the recent advanced (read "objects") IDL course came back thinking of ways they could do several things easier and better, so I shouldn't complain. -- Joseph B. Gurman / NASA Goddard Space Flight Center/ Solar Data Analysis Center / Code 682 / Greenbelt MD 20771 USA / gurman@gsfc.nasa.gov / gurman@ari.net | Federal employees are still prohibited from holding opinions while at work. Any opinions expressed herein must therefore be someone else's. | SPAMbot trap: abuse@127.0.0.1
Re: A rant: features vs. programming features
Michael Slameczka wrote: > > Joseph B. Gurman wrote: >> >> � a WRITE_MPEG routine, >> � a WRITE_SOUND routine (with AIFF and WAVE options), >> � a WRITE_QUICKTIME routine, and >> � maybe even WRITE_AVI. > > wow; if someone really has such routines; I would be a happy man. > But what I am now looking for about 12 month now are routines, > where I can do the opposite. That means READ_AVI, READ_QUICKTIME, > READ_MPEG. Is there anybody out there, who knows of such routines? > > Thanks > michael > Have you guys seen this WRITE_MPEG.PRO routine that has been out in the newsgroup. I got it about a year ago; you have to download 'mpeg_encode' program first, but the routine seems to work pretty well. I think it came from Scott Denning (not sure if he wrote it). Here it is: ------------- Cut Here ---------------------------------------------- ; Subject: Re: MPEG creation with IDL ; From: scott@abyss.ATMOS.ColoState.Edu (Scott Denning) ; ; The following idl procedure will produce an mpeg file from a series of ; images stored in a 3D array (width x height x # of frames). It requires ; the "mpeg_encode" executable to be in the unix search path. This can be ; obtained from ftp://mm-ftp.cs.berkeley.edu/pub/ . ; ; Multimedia stuff previously at: ; ftp://s2k-ftp.cs.berkeley.edu/pub/multimedia/mpeg/encode. ; ; There are lots of options that can be handled differently, to make ; tradeoffs between image quality, speed, and disk space. See the ; documentation for mpeg_encode for more details. ; ; If your animation is stored in the array "image_array" and you want to ; write it to a file called "movie.mpg," you would do so by typing ; ; WRITE_MPEG, 'movie.mpg', image_array ; PRO WRITE_MPEG, mpegFileName, image_array movieSize = SIZE(image_array) xSize = movieSize(1) ySize = movieSize(2) nFrames = movieSize(3) nDigits = 1+FIX(ALOG10(nFrames)) formatString = STRCOMPRESS('(i'+STRING(nDigits)+'.'+STRING(nDigits)$ + ')', /REMOVE_ALL) ; Load current color table into byte arrays TVLCT, red, green, blue, /GET red = BYTE(red) green = BYTE(green) blue = BYTE(blue) ON_IOERROR, badWrite ; Make a temporary directory if necessary or clear it otherwise' TMPDIR = '/tmp/idl2mpeg.frames' SPAWN, 'if (-d ' + TMPDIR + ') echo "exists"', result dirExists = result(0) EQ 'exists' IF dirExists THEN command = 'rm ' + TMPDIR + '/*' $ ELSE command = 'mkdir ' + TMPDIR SPAWN, command ; Write each frame into TMPDIR as an 8-bit .gif image file FOR frameNum = 0, nFrames-1 DO BEGIN fileName = TMPDIR + '/frame.' + STRING(frameNum,FORMAT=formatString)$ + '.gif' WRITE_GIF, fileName, image_array(*,*,frameNum), red, green, blue ENDFOR ; Build the mpeg parameter file paramFile = TMPDIR + '/idl2mpeg.params' OPENW, unit, paramFile, /GET_LUN PRINTF, unit, 'PATTERN IBBBBBBBBBBP' PRINTF, unit, 'OUTPUT ' + mpegFileName PRINTF, unit, 'GOP_SIZE 12' PRINTF, unit, 'SLICES_PER_FRAME 5' PRINTF, unit, 'BASE_FILE_FORMAT PPM' PRINTF, unit, 'INPUT_CONVERT giftoppm *' PRINTF, unit, 'INPUT_DIR /tmp/idl2mpeg.frames' PRINTF, unit, 'INPUT' PRINTF, unit, '`ls *.gif`' PRINTF, unit, 'END_INPUT' PRINTF, unit, 'PIXEL FULL' PRINTF, unit, 'RANGE 5' PRINTF, unit, 'PSEARCH_ALG LOGARITHMIC' PRINTF, unit, 'BSEARCH_ALG SIMPLE' PRINTF, unit, 'IQSCALE 8' PRINTF, unit, 'PQSCALE 8' PRINTF, unit, 'BQSCALE 8' PRINTF, unit, 'REFERENCE_FRAME DECODED' PRINTF, unit, 'FORCE_ENCODE_LAST_FRAME' FREE_LUN, unit ; spawn a shell to process the mpeg_encode command SPAWN, 'mpeg_encode ' + paramFile RETURN badWrite: alert, 'Unable to write MPEG file!' END ---------- Cut Here ----------------------------------------------- Hope this helps someone out! 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
Joseph B. Gurman wrote: > > � a WRITE_MPEG routine, > � a WRITE_SOUND routine (with AIFF and WAVE options), > � a WRITE_QUICKTIME routine, and > � maybe even WRITE_AVI. wow; if someone really has such routines; I would be a happy man. But what I am now looking for about 12 month now are routines, where I can do the opposite. That means READ_AVI, READ_QUICKTIME, READ_MPEG. Is there anybody out there, who knows of such routines? Thanks michael ------------------------------------------------------------ ------ Michael Slameczka Laboratory for Biomechanics, ETH Zurich Wagistrasse 4 CH-8952 Schlieren Switzerland Phone: +41 1 633 63 58 / 62 11 Fax: +41 1 633 11 24 email: slameczka@biomech.mat.ethz.ch ------------------------------------------------------------ ------