|
IDL Demo Library |
|
The Slicer program is a widget based application to visualize 3D data. For details on the calling sequence of the SLICER3 program see the entry in the Reference Manual.
Select a file containing a 3D array (or arrays) to load into Slicer3. The file must have been written in a certain binary format. For each data array in the file, the following values are present:
Any number of 3D datasets can be concatenated into a single file of this type (as long as they all have the same dimensions).
(See EXAMPLE, below.)
NOTE: Files saved by the "Save Subset" operation (see below) are suitable for input via the "Load" operation.
Data files that are moved from one platform to another may not load as expected, due to differing byte order. See the "BYTEORDER" and "SWAP_ENDIAN" IDL commands for details.
Slicer3 must be in "Block" mode for this operation to be available. When selected, a subset of the 3D data enclosed in the current block is written to the chosen save file. This subset can then be loaded back into Slicer3 at any time. If multiple 3D arrays are currently available in Slicer3, then multiple subsets are saved to the file.
When selected, a tiff image of the current Slicer3 contents is saved to the chosen 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.
Exits Slicer3.
Erases the display window and deletes all the objects in the display list.
As graphical objects are created, they are added to the display list. The "Delete" menu allows the user to delete a specific object from the list. When an object is deleted, the screen is redrawn with the remaining objects.
Selecting this will cause the original color scheme to be restored.
This allows the user to change the percentage of differential shading applied to the X, Y, and Z slices.
This allows the user to use the "XLOADCT" operation to modify the colors used for slices and blocks. In some cases, the new colors will not be visible until the user selects "Done" in the XLOADCT tool.
This allows the user to use the "XLOADCT" operation to modify the colors used for iso-surfaces.
This allows the user to use the "XLOADCT" operation to modify the colors used for projections. Note that on some platforms, the selected colors may not become visible until after the XLOADCT tool is exited.
This brings up a panel allowing the user to set:
The X and Y dimensions are always the same. If the user selects "Ok", then the display is redrawn.
Brings up help information about Slicer3.
If multiple datasets are currently available in Slicer3, this menu allows the selection of the current data. Slices, blocks, iso-surfaces, etc. are created from the currently selected data. If only one dataset is currently loaded, then this menu is inactive.
This menu is used to select the current mode of operation.
Interaction in the main draw window is dependent upon the currently selected mode ("Slice", "Block", "Surface", etc., see below). 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.
To display a slice, click and drag the left mouse button on the wire-frame cube. When the button is released, a slice through the data will be drawn at that location.
When in Draw mode, new slices will be merged into the current Z-buffer contents.
When in Expose mode, new slices will be drawn in front of everything else.
When in Orthogonal mode, use the left mouse button in the big window to position and draw an orthogonal slicing plane. Clicking the right mouse button in the big window (or any mouse button in the small window) will toggle the slicing plane orientation.
Clicking any mouse button in the small window will reset the oblique slicing plane to its default orientation.
When in this mode, click and drag the left mouse button in the big window to set the surface normal for the oblique slicing plane.
When in this mode, click and drag the left mouse button in the big window to set the center point for the surface normal.
Clicking this button will cause an oblique slicing plane to be drawn.
When in Block mode, use the left mouse button in the big 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 "added" to the current Z-buffer contents.
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).
Clicking this button will cause the block to be drawn.
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).
Selecting this mode will cause the iso-surface polygon facing to face towards the lower data values. Usually, this is the mode to use when the iso-surface is desired to surround high data values.
Selecting this mode will cause the iso-surface polygon facing to face towards the higher data values. Usually, this is the mode to use when the iso-surface is desired to surround low data values.
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.
Clicking this button will cause the iso-surface to be created and drawn. Iso-surfaces often consist of tens of thousands of polygons, and can sometimes take considerable time to create and render.
A "voxel" projection of a 3D array is the projection of the data values within that array onto a viewing plane. This is similar to taking an X-ray image of a 3D object.
Select this mode for a Maximum intensity projection.
Select this mode for an Average intensity projection.
Select this mode for a Low resolution projection.
Select this mode for a Medium resolution projection.
Select this mode for a High resolution projection.
Use the slider to set the depth queue percent. A value of 50, for example, indicates that the farthest part of the projection will be 50% as bright as the closest part of the projection.
Clicking this button will cause the projection to be calculated and drawn. Projections can sometimes take considerable time to display. Higher resolution projections take more computation time.
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 this text widget, a minimum threshold value can be entered.
In this text widget, a maximum threshold value can be entered.
In this text widget, a transparency threshold value can be entered.
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.
Use this text widget to enter the X coordinate for the probe.
Use this text widget to enter the Y coordinate for the probe.
Use this text widget to enter the Z coordinate for the probe.
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.
Use this slider to set the angle of the first view rotation (in degrees). The droplist widget adjacent to the slider indicates which axis this rotation is about.
Use this slider to set the angle of the second view rotation (in degrees). The droplist widget adjacent to the slider indicates which axis this rotation is about.
Use this slider to set the zoom factor percent. Depending upon the view rotations, Slicer3 may override this setting to ensure that all eight corners of the data cube are within the window.
Use this slider to set a scale factor for the Z axis (to compensate for the data's aspect ratio).
Create a data save file suitable for dynamic loading into Slicer3.
; Store some 3D data in a variable called "data_1". data_1 = INDGEN(20,30,40) ; Store some 3D data in a variable called "data_2". data_2 = FINDGEN(20,30,40) ; Define the names for the datasets (their names will ; appear in the "Data:" pull-down menu in Slicer3. data_1_name = `Test Data 1' data_2_name = `Data 2' ; Select a data file name. dataFile = PICKFILE() ; Write the file. GET_LUN, lun OPENW, lun, dataFile WRITEU, lun, SIZE(data_1) WRITEU, lun, STRLEN(data_1_name) WRITEU, lun, BYTE(data_1_name) WRITEU, lun, data_1 WRITEU, lun, SIZE(data_2) WRITEU, lun, STRLEN(data_2_name) WRITEU, lun, BYTE(data_2_name) WRITEU, lun, data_2 CLOSE, lun FREE_LUN, lun
Run Slicer3 with data passed to it at startup.
; Create some 3D data. data = INDGEN(20,30,40) ; Create a pointer to the data, and use the "/NO_COPY" ; keyword to save memory. h_data = PTR_NEW(data, /NO_COPY) ; Start up Slicer3. SLICER3, h_data, /MODAL ; If the user did not interactively load any data into ; Slicer3 (via the "File/Load" menu), then the original ; pointer to the data still exists (and the original data ; will still reside in memory). To free it, use: if PTR_VALID(h_data) then PTR_FREE, h_data ; If the pointer is no longer valid, then that indicates ; that the user interactively loaded data into Slicer3. ; Any data that is loaded interactively is automatically ; deleted when the user exits Slicer3. ; Note that the last contents of the main view window in ; Slicer3 still resides in the Z-buffer. To access this ; image after exiting Slicer3, perform the following actions: current_device = !D.Name SET_PLOT, `Z' image_buffer = TVRD() depth_buffer = TVRD(CHANNEL=1, /WORDS) SET_PLOT, current_device TV, image_buffer
Note that the image contained in "image_buffer" will look "correct" only if the colors loaded by Slicer3 have not been changed since the user exited Slicer3.
IDL Demo Online Help (October 11, 2006)