FrameBuilder

Draw them polygons!

Essential Goals

FrameBuilder is the authoring tool used for assembling materials (pictures, movies, and structure names) into files that can be displayed with the Digital Anatomist atlas software. Its primary function is to allow a subject expert to draw polygonal outlines over areas in a digitized photo or other artwork on the screen, assigning a name to each one which will be used by the Atlas for interactive display and quizzes.

The basic layout of the FrameBuilder includes a single full-screen window for displaying a color bitmap, and one or more menus containing the following items for creating, editing, and saving the names and shapes of the outlines. A picture and its outlines together define a "Frame"; each single frame is constructed and saved individually as a separate file, which follows a specified format.

This document lists the functions available in the FrameBuilder application, discusses some of the reasons why they were implemented a certain way, and suggests areas where further improvement could be made.


NEW FRAME command

New Frame saves any modifications to the current frame and then removes all information about the current frame. It follows these steps:
- if modifications have been made, ask the user if they should be saved
- do the CLEAR BUTTONS and CLEAR IMAGE operations (see below)

OPEN FRAME command

Save modifications to the current frame, if any, then remove all current data structures and replace them with those stored in the specified Frame file.

IMPORT PICT command

If an image is present, do a CLEAR IMAGE operation; then ask for the name and location of another image file.

SAVE FRAME command

Generate a data file containing a valid frame definition, starting with the name of the image file and then a list of structure names and shapes. The user should supply a name for the file; if a file already exists with that name, confirm its replacement with the user.

CLEAR BUTTONS command

Remove all current outlines (both names and shapes).

CLEAR IMAGE command

Clear the image from the screen and remove all references to its file name.

TRACE STRUCTURES command

Change the cursor to a crosshair, and allow the user to draw freeform polygons. After the mouse button is released, make sure the polygon is legal (at least 3 distinct points) and ask for a name. The name should be the same as the previous one, if the user draws several in sequence. This saves typing errors and causes the user to confirm that the proper name is being used for every outline they draw. The naming dialog also should supply lists of standard anatomical names, and let the user select another frame (in a standard filesystem dialog) in order to make a navigational link to that frame; and a button to delete the outline is nice, in case of casual errors.

See the "Areas for Improvement" section below for several important ideas relating to the tracing of polygonal structure outlines.

TRACE RECTANGLES command

This is just like TRACE STRUCTURES, except that the user is dragging from one point to another to create rectangular shapes instead of free-form polygons. It's useful for outlining user-interface-style buttons in the images.

TRACE LINES command

Lines are used for indicating the cross-sections in orthogonal views; the user drags from one point to another, then lets go of the mouse button and specifies the name as usual. The program should allow the lines to be narrower or thicker, at the author's option, depending on what the orthogonal image looks like; in the present program, this is achieved by giving the author 4 expansion/contraction operations to alter the appearance of lines after they are drawn. This is a mammoth kludge.

SELECT OBJECTS command

This changes the cursor to a pointer, which allows the user to click on objects (using shift to select several at once) to select them and move them around. Their shapes can be changed somewhat (made wider or narrower) and the delete key removes them; or they can be cut and then pasted on a different frame.

CHANGE NAMES command

The cursor changes to SuperCard's normal "pointing finger", which causes a customized background script to run when an object is clicked. This brings up a dialog that allows the name of an outline to be changed, or allows the deletion of an outline altogether.

GENERATE TRANSFER LIST

This is a helpful aid for authors who need to put all their data onto a server with FTP. Instead of creating entire directory structures manually and copying the files one by one, they can use this option to make a list of all the necessary information so that another program can use it to do the transfer. It would probably be better to use some archiving program that works on both the author's machine and on a Unix server; but I'm not aware of any that work real well for hundreds of multi-megabyte files. This kind of option would also be useful for generating any map files that might be needed for a particular platform or installation.

Areas for Future Improvement

It goes without saying that SuperCard has some limitations. Not only is it slow, but the business of importing graphics and drawing new shapes at runtime requires that the project be read/write, which makes it susceptible to corruption (like when the power fails while an operation is in progress) and also causes the state of the project to be saved at the end of every session -- so that images and outlines are preserved until the next invocation. The latter behavior is not bad, but is a little bit different from what most people usually expect with a tool of this sort.

The SuperCard version of the program does not keep track of file names and locations very well; for instance, the first time a frame is saved, it will ask for a name without letting the user decide what directory to use for its location...the file is always saved in the directory containing the program itself. The user has to move it manually later, if he wants to. If the user supplies a name that's already in use, the existing file is overwritten silently, which is really bad. Also, certain assumptions are made (such as the existence of a "Scans" directory containing the images), which probably is overly restrictive. It would be better to adjust to the conventions used by a particular author, informing them in a helpful manner if they try to do something which will lead to difficulties (like saving two frames from the same dataset into different file hierarchies, or importing a graphic which is stored on a separate disk, or something like that). Unfortunately many of the helpful ideas would depend on the program knowing how multiple frames and their image files are related; the present simple-minded scheme presupposes only that a well-defined folder hierarchy exists and that all authors will use it the way it was designed.

The basic function of the FrameBuilder is that of a drawing program; and in any normal drawing program, there would be a palette showing the currently-selected tool (object pointer, polygon, rectangle, line tool). The user could point to an object with the default tool and then change its shape, view or change its name, or delete it, all with minimal tool-switching. Unfortunately, the present program doesn't behave like a reasonable drawing program -- some nice features are supplied by SuperCard itself, like the ability to select multiple objects and move them around, but many necessary functions are custom ones which would be hard to fit in with SuperCard's idea of what an object is (like its name, which is normally seen only in SuperEdit). So it's a bit of a patchwork of functionality compared to what one might want. The name of the game is, of course, streamlined data entry; as long as the author can do a lot of work in a short time, that's what's really important. It just doesn't work like the user might initially expect.

It should be possible, with a proper set of tools, to reshape a polygonal area point by point. That would save a lot of mistakes where the mouse goes off just a little bit in a large structure; right now, such errors have to be fixed by completely redrawing the outline.