The IDL SLICER3 is a widget-based application to visualize three-dimensional datasets. This program supersedes the SLICER program.
This routine is written in the IDL language. Its source code can be found in the file
subdirectory of the IDL distribution.
A pointer to a three-dimensional data array, or an array of pointers to multiple three-dimensional arrays. If multiple arrays are specified, they all must have the same X, Y, and Z dimensions. If hData3D is not specified, SLICER3 creates a 2 x 2 x 2 array of byte data using the IDL BYTARR function. You can also load data interactively via the File menu of the SLICER3 application (see Examples for details).
Set this keyword equal to a string array of names for the data. The names appear on the droplist widget for the current data. If the number of elements of DATA_NAMES is less than the number of elements in hData3D then default names will be generated for the unnamed data.
Set this keyword equal to the Widget ID of an existing widget that serves as the "group leader" for the SLICER3 graphical user interface. When a group leader is destroyed, all widgets in the group are also destroyed. If SLICER3 is started from a widget application, then GROUP should always be specified.
Set this keyword to block user interaction with all other widgets (and block the command line) until the SLICER3 exits. If SLICER3 is started from some other widget-based application, then it is usually advisable to run SLICER3 with the MODAL keyword set.
NOTE: SLICER3 modifies the current color table, as well as various elements of the plotting system (i.e., the "!X", "!Y", "!Z", and "!P" system variables). If the MODAL keyword is set (recommended), then SLICER3 will, upon exit, restore these system variables (and the color tables) to the values they had when SLICER3 was started.
Select this menu option to choose a file containing a 3D array (or arrays) to load into SLICER3. The file must have been written in the format specified by SLICER3 Data File Structure . For each data array in the file, the following values must be included. Note that the first six values are returned by the IDL SIZE function; see Examples for an example of how to create a data file suitable for SLICER3 with just a few IDL commands.
Data type (Must be type 1 through 5. See SIZE for a list of data types types.)
Number of characters in data name. (See STRLEN for the easiest way to determine this number.)
Select this menu option to save a subset of the 3D data enclosed in the current block to the specified file. Subsets saved in this fashion are suitable for loading via the "Load" menu option. If multiple 3D arrays are available when this option is selected, multiple subsets are saved to the file.
Select this menu option to save the contents of the current SLICER3 image window as a TIFF image in the specified file. When running in 8-bit mode, a "Class P" palette color TIFF file is created. In 24-bit mode, a "Class R" (interleaved by image) TIFF file is created.
As graphical objects are created, they are added to the display list. Select this menu option to delete a specific object from the list. When an object is deleted, the screen is redrawn with the remaining objects.
Operations available in the Main Draw Window are dependent on the mode selected in the Mode Pulldown menu. In general, when coordinate input is required from the user, it is performed by clicking a mouse button on the "surface" of the wire-frame cube that surrounds the data. This 3D location is then used as the basis for whatever input is needed. In most cases, the "front" side of the cube is used. In a few cases, the coordinate input is on the "back" side of the cube.
If multiple datasets are currently available in SLICER3, this menu allows you to select which data will be displayed in the Main Draw Window. Slices, blocks, iso-surfaces, etc. are created from the currently selected data. If only one dataset is loaded, this menu is inactive.
When in Orthogonal mode, use the left mouse button in the main draw window to position and draw an orthogonal slicing plane. Clicking the right mouse button in the main draw window (or any mouse button in the small window) will toggle the slicing plane orientation.
When in Block mode, use the left mouse button in the main draw window to set the location for the "purple" corner of the block. Use the right mouse button to locate the opposite "blue" corner of the block. When in Block mode, the "Save Subset" operation under the main "File" menu is available.
When in this mode, the block will be "subtracted" from the current Z-buffer contents. Subtract mode is only effective when the block intersects some other object in the display (such as an iso-surface).
In iso-surface is like a contour line on a contour map. On one side of the line, the elevation is higher than the contour level, and on the other side of the line, the elevation is lower than the contour level. An iso-surface, however, is a 3D surface that passes through the data such that the data values on one side of the surface are higher than the threshold value, and on the other side of the surface, the data values are lower than the threshold value.
When in Surface mode, a logarithmic histogram plot of the data is displayed in the small draw window. Click and drag a mouse button on this plot to set the iso-surface threshold value. This value is also shown in the text widget below the plot. The threshold value may also be set by typing a new value in this text widget. The histogram plot is affected by the current threshold settings. (See Threshold mode, below).
Iso-surfaces are normally rendered with light-source shading. If multiple datasets are currently loaded, then this menu allows the selection of a different 3D array for the source of the iso-surface shading values. If only one dataset is currently loaded, then this menu is inactive.
When in Threshold mode, a logarithmic histogram plot of the data is displayed in the small draw window. Click and drag the left mouse button on this plot to set the minimum and maximum threshold values. To expand a narrow range of data values into the full range of available colors, set the threshold range before displaying slices, blocks, or projections. The threshold settings also affect the histogram plot in "Surface" mode. The minimum and maximum threshold values are also shown in the text widgets below the histogram plot.
Click and drag the right mouse button on the histogram plot to set the transparency threshold. Portions of any slice, block, or projection that are less than the transparency value are not drawn (clear). Iso-surfaces are not affected by the transparency threshold. The transparency threshold value is also shown in a text widget below the histogram plot.
In Profile mode, a plot is displayed showing the data values along a line. This line is also shown superimposed on the data in the main draw window. The bottom of the plot corresponds to the "purple" end of the line, and the top of the plot corresponds to the "blue" end of the line.
Click and drag the left mouse button to position the profile line, based upon a point on the "front" faces of the wire-frame cube. Click and drag the right mouse button to position the profile line, based upon a point on the "back" faces of the wire-frame cube. As the profile line is moved, The profile plot is dynamically updated.
Click and drag the left mouse button to position the "purple" end of the profile line on one of the "front" faces of the wire-frame cube. Click and drag the right mouse button to position the "blue" end of the profile line on one of the "back" faces of the wire-frame cube. As the profile line is moved, The profile plot is dynamically updated.
In Probe mode, click and drag a mouse button over an object in the main draw window. The actual X-Y-Z location within the data volume is displayed in the three text widgets. Also, the data value at that 3D location is displayed in the status window, above the main draw window. If the cursor is inside the wire-frame cube, but not on any object, then the status window displays "No data value", and the three text widgets are empty. If the cursor is outside the wire-frame cube, then the status window and text widgets are empty.
In view mode, a small window shows the orientation of the data cube in the current view. As view parameters are changed, this window is dynamically updated. The main draw window is then updated when the user clicks on "Display", or exits View mode.
Clicking on this button will cause the objects in the main view window to be drawn in the new view. If any view parameters have been changed since the last time the main view was updated, the main view will be automatically redrawn when the user exits View mode.
max_color=!D.N_COLORSon 8-bit displays, and
max_color=256on 24-bit displays and
nColor = (max_color - 9) / 5):
On 24-bit displays, you can often improve performance by running SLICER3 in 8-bit mode. This can be accomplished (on some platforms) by entering the following command at the start of the IDL session (before any windows are created):
NOTE: If data are loaded via the File menu after SLICER3 is launched with a pointer argument (as shown above), the pointer becomes invalid. You can use an IDL statement like the following to "clean up" after calling SLICER3 in this fashion:
Because we did not launch SLICER3 with the MODAL keyword, the last contents of the main draw window still reside in IDL's Z-buffer. To retrieve this image after exiting SLICER3, use the following IDL statements:
The following IDL commands manually create a data save file suitable for dynamic loading into SLICER3. Note that if you load data into SLICER3 as shown above, you can also create save files by switching to BLOCK mode and using the Save Subset menu option.