buttons.txt HELP ON BUTTON BAR TOOLS I. Tool Selection (Widget) II. OtlColor Selection III. AdjustThreshold Slider IV. 'Delete All' Buttons V. 'Change Intensity' Buttons VI. 'Save Outline' and 'Load Outline' Buttons VII. '3-D Plot' Button VIII. 'Close' Button IX. Callbacks ********************************************************************** I. Tool Selection (ZoomOrEdit Widget) The widget in the upper right-hand corner is called the ZoomOrEdit widget, and it allows you to select a tool to use in editing image outlines. Every tool available on this menu is also available, with accelerators, via the "Tools" submenu, under the "Edit" menu. If you ever make a mistake while editing an outline, you can fix your mistake by choosing "Undo" from the "Edit" menu. It is possible to undo or redo as many as 40 consecutive edits (this value can be changed by modifying the variable NUM_UNDOS in the file EditOtl.m). The tools are: 1. Zoom On (ctrl-Z) Set up the mouse buttons with the following functions: Left-click-and-drag on the main image will allow you to select a rectangle which you would like to see enlarged. Left-click without dragging zooms in by a factor of 2, and the new field of view is centered where you clicked. Right mouse click zooms out by a factor of 2, centered at the point on which you click. Shift-click (either right or left) shifts the field of view without zooming. The new field of view is centered on the point clicked. Double-click anywhere in the image zooms all the way out, i.e. this is the same as choosing the "original size" menu option. 2. Original Size (ctrl-O) Return the main image to its original size. 3. Add Points (ctrl-A) Every time you click on the main image, a new point will be added to the outline object. The new point will be marked with an 'x' in the color currently selected in the OtlColor popup menu (section II). 4. Add Line (ctrl-L) Click to start a multiline, and then click again to anchor each new point. Double-click to finish the action, and to enter all of the lines into the outline object. The lines on the image will be converted to individual outline points; their color will be whatever is selected in the OtlColor popup menu (section II). 5. Delete Points (ctrl-D) ButtonDown any place on the main image creates a purple rectangle, whose free corner can be dragged anywhere else on the visible part of the main image. When you release the mouse button, all outline points contained in the rectangle will be deleted. 5. Change Color ButtonDown any place on the main image creates a rectangle, colored with the current OtlColor (section II). When you release the mouse button, all outline points contained in the rectangle will be changed to OtlColor. 6. Make One Point White (ctrl-W) When you click on the main image, the selected image pixel will turn white. This is sometimes useful when using the Magic Wand (below) to divide two dark regions. The white pixel is not permanent; to erase it, simply re-load the image file. Your outline object will not be erased when you re-load the image file. 7. Magic Wand (ctrl-M) Click on any contiguous dark region in order to draw an outline which encircles all dark pixels connected to the selected region. The threshold between "light pixels" and "dark pixels" is chosen by the "AdjustThreshold" widget below. ************************************************************************** II. OtlColor Menu The OtlColor popup menu allows you to select the color which will be used for new outline points. Right now, you can create six different colored outlines: blue, cyan, green, yellow, red, and magenta. The list of colors can be changed by changing the variable OTLCOLOR in the file mrcat.m. Keep in mind that CTMRedit codes the color of an outline point by storing the first letter of the color name, so e.g. if you want to add the color 'black', you should call it something like 'k-black' so that it won't be confused with 'blue'. ************************************************************************** III. AdjustThreshold Slider Adjust the threshold used by the Magic Wand tool. When the slider is moved, red 'X' marks will show you all of the pixel positions on the boundary between any light region and any neighboring dark region. To delete the red 'X' marks, press the red 'Delete All Thresholds' button below. ************************************************************************** IV. 'Delete All' Buttons The red 'Delete All Thresholds' button deletes the red 'X' marks created by moving the AdjustThreshold slider. The green 'Delete All Outlines' button deletes all points on the outline. If you accidentally delete your outline, and then you decide that you want it back, just choose 'Undo' from the 'Edit' menu. *************************************************************************** V. 'Change Intensity' Buttons These buttons change the intensity of the main image. 'Bright' brightens the image, and 'Dark' darkens the image. *************************************************************************** VI. 'Save Outline' and 'Load Outline' Buttons The 'Save Otl' button saves the current outline to the file specified by the text widgets below. If the specified file already exists, it is backed up. There is no backup of an existing backup. The 'Load Otl' button deletes the outline currently on the screen, and replaces it with an outline loaded from the file specified by the text widgets below. The two text widgets beneath the 'Load Otl' button specify the filename of the OtlFile. The strings in these two text widgets are fully editable; if you edit either string, your otl file will be saved to a different place. The first widget specifies the directory. This directory should already exist. The default directory, 'otl', is created when mrcat starts. The second widget specifies the filename. The default name is 'EdOut' followed by the name of the main image file. When the outline is saved, '.otl' is appended to . It .otl exists, it is backed up as .bak. The full pathname of the outline file is ROOTDIR////.otl ROOTDIR, , and are described in the file "Help on Image Loading" (image.txt). ******************************************************************************* VII. '3-D Plot' Button The 3-D Plot button starts a series of actions: (1) All of the OTL files in the currently selected outline directory are loaded. If an OTL file has header items specifying the top_left_hand_corner, top_right_hand_corner, and bottom_right_hand_corner of the image, then all of the outline points are converted to an absolute 3D coordinate system (using the otl2ras.m function). If an OTL file does not contain these three header items, it is discarded. (2) If the 'Plot Selected Color Only' option is checked in the 'Plot3D' menubar menu, then all outline points which are not of the correct color (section II) are discarded. (3) If 'Interpolate Before Plotting' is checked in the 'Plot3D' menubar menu, then the following things happen: (A) The 'Interpolation Style' submenu under the 'Plot3D' menu is read to determine the style of interpolation. Currently, the possible styles are: 'Surface (linear)': outline curves are smoothly resampled within each image plane. The resulting resampled outline curves are linearly interpolated between neighboring image planes. Note that if you use this option with outlines that have no obvious beginning and end (e.g. circles, ovals), the algorithm may try to linearly interpolate between points at different places on the oval! 'Tubular (shape-based)': Raya and Udupa's shape-based interpolation algorithm is used to smoothly interpolate between planes. This algorithm assumes that the outline curves enclose an object, so that it is possible to define an "inside" and "outside" of the object. This option returns the set of points on the surface between inside and outside. 'Filled Solid (shape-based)': This is the same as 'Tubular', except that it returns a list of all of the points "inside" the solid object. (B) The 'Points per mm' submenu under the 'Plot3D' menu is read. The interpolation algorithm will try to output this many points per mm in each direction, e.g. if '2' is checked, you should get about 2 points per linear millimeter, or about 8 points per cubic millimeter. The default is '1'. (C) An interpolation algorithm (either ras2surf.m or ras2sld.m) is called to smoothly interpolate the output points up to a density (in points/mm) as specified in the 'Points per mm' submenu. (4) The returned list of points is fed to a 'plot3d' widget (started using the function plot3d.m, which is included). This widget gives you a 3D plot, with sliders that allow you to adjust the azimuth and elevation angles. If you click one of the buttons 'Axial', 'Coronal', or 'Sagittal' on the left hand side, you get cross sections through your surface with the orientation specified by the button, and the Elevation slider converts to a slider which allows you to move up and down through the set of cross-sections. If you click the 'Plot3D' button, you will get the 3-D plot again. When you are done with the 'plot3d' widget, close it by choosing 'Close' from the 'File' menu. A new 'plot3d' widget is created each time you click the '3D-Plot' button on the main mrcat GUI window. ******************************************************************************* VIII. 'Close' Button This button closes the mrcat window. This button will not save your outline for you. You must save it by pressing the "Save Otl" button. ******************************************************************************* IX. Callbacks Editing the outline object, choosing an editing tool, saving an outline, loading an outline, and adjusting the intensity threshold are all functions of the EditOtl function. For syntax, type 'help EditOtl' at the command prompt. *******************************************************************************