One major problem with the iTools is that controlling them via a script can be quite complicated (and I’m not even talking about extending them, i.e., adding new capabilities to them). IDL 7.1 is a major change in the programmatic iTools API: many routines were renamed, several routines were added, and a couple keywords were added.
The main changes to the API which will cause backward compatibility problems are trivial changes to helper routine names: ITSETCURRENT
to ISETCURRENT
, ITGETCURRENT
to IGETCURRENT
, ITDELETE
to IDELETE
, ITRESET
to IRESET
, ITREGISTER
to IREGISTER
, and ITRESOLVE
to IRESOLVE
. The arguments to the routines remained the same.
The main new routine is IOPEN
. It uses the registered file readers to open a given file, optionally sending the data directly to an iTool:
IDL> iopen, file_which('endocell.jpg'), /visualize
Third-party developers can add to the registered file-readers which IOPEN
will use (but that is extending the iTools and beyond the scope of what we are talking about here). The ISAVE
routine was also added to save the contents of an iTools window to an image file, PostScript file, or iTools SAVE file. For example,
IDL> iplot, findgen(11)
IDL> isave, 'test.ps'
The output format is determined by the extension of the filename.
Properties of iTool components can be set easily:
IDL> iplot, findgen(11)
IDL> isetproperty, 'plot', color=[255, 0, 0]
They can also be retrieved with `IGETPROPERTY.
The IPUTDATA and IGETDATA routines make it much more convenient to get at the data in an iTool. For example, the following grabs the data from an iTool and plots using PLOT
:
IDL> iplot, findgen(11)
IDL> igetdata, 'plot', data
IDL> plot, data
Data for an iTool can also be changed:
IDL> iputdata, 'plot', 2. * findgen(11)
The iTool detects the change and automatically updates its display. The iTools equivalent to CONVERT_COORD
, ICONVERTCOORD
, was also added to convert between coordinate systems.
New routines also allow the current iTool window to be annotated:
IDL> iplot, findgen(11), /scatter, sym_index=1
IDL> itext, 'important point', 5., 3., /data, font_size=9
IDL> ipolyline, [[4.1, 3.9], [4.9, 3.2]], /data, arrow_style=2, $
IDL> arrow_size=0.025
For drawing, IELLIPSE
, IPOLYGON
, IPOLYLINE
, and ITEXT
were added.
The IROTATE
, ITRANSLATE
, ISCALE
, and IZOOM
routines were also added to manipulate the current iTool window.
Updating to IDL 7.1 will probably mean making changes to any code that programmatically controls iTools. But a lot of things that required getting into the guts of the iTools framework before now can be done with a single command.
August 17th, 2009 at 3:43 pm
Thanks for the useful tips. I had noticed some changes in the objects (I had to modify some code that previously worked), but I had missed some of these new routines. Even though I now realise they were in the new features list in the help, I think ITTVIS should have made the new features easier to notice in their website. For instance, by giving a summary like the one you wrote.