EditPolygon

General Purpose

EditPolygon lets you create 2D polygons in the image window to identify objects in the image. These polygons are used to delineate areas of the data for measurements, for cutting out part of the image, or as building blocks for 3D Objects which can be used for 3D measurement and Modeling. EditPolygon provides interactive and automatic creation of polygons and editing of existing polygons. There are several other programs that use these polygons. 2DObjFinder automatically creates polygons using an image mask. Cutmask cuts out data either inside or outside the polygons. Volume builder puts 2D polygons together to create 3DObjects. All of these programs can look at the same set of polygons so that they can be used together. When any of one of these programs are running and have a set of polygons loaded into an image window, any other one will see those polygons and be able to work with them.

Topics

Basic_Steps | Wave_Mode | Action_Mode | Test_Section | Edit_Options | Auto_Polygon | Graphics_Toggles | Hot_Keys | Save_.POL_File


Basic_Steps

1. Enter the Image window number for the image that you will be editing or creating polygons in.

2. If you want to edit an existing polygon data set, enter the name of the polygon data set in the field for polygon data, or hit the polygon data button to pop up the file search menu.

3. Otherwise, the program is ready for you to start interactively creating polygons by clicking in the image at the positions where you want to place vertices of your polygons.

4. After you complete each polygon, either hit the close polygon button, or the space bar, to close the polygon. You cannot start a new polygon in the same section until you close the last one.

5. Now that you've gone through the work of tracing some object by hand, read the action mode section to learn about how you can modify your polygons or semi- automatically create new polygons.

6. When you are finished createing or editing polygons, you can save the polygons to a file by hitting the Sav .POL File button. You can also just leave the EditPolygon program running and start the program that you want to use the polygons and it will use the polygons that EditPolygon loaded into the window. The polygons will stay loaded in the window as long as one of the polygon type programs is using them.

Wave_Mode

If you are working with multiple wave data, you can always be sure of which wave you are modeling in, by setting the active wave toggles. If you are in Black and white mode in the image, it's easy, because the wave that is displayed is the one you are modeling. In this case, polygons that are actually applied to a section will be red. In RGB mode, the current wave is not obvious in the window so you are more dependant on the toggles in the editpolygon menu. In this case polygons will be different colors for the different waves so you can distiguish which is from which wave. The colors are controllable using the monitor pulldown for Sel_Gr_Color. Here you can set the colors for each wave to be whatever you want. The pulldown for active wave mode is just a shortcut for modeling in multiple waves. If it is set to one, then the polygons you create will only be applied to the currently active wave. If it is set to all, then all the polygons created while in this mode will be applied to all the waves.

Action_Mode

The action mode pulldown contains the choices for what will happen when you click in the image window using the mouse. The possible actions are add, modify, roam, select auto and off. Add is default.

1) Add - pick the points that will be part of a polygon. When the last point is picked for the polygon, use the Close Polygon button or hot key to close that polygon.

2) Modify lets you move a single point on the polygon, giving the polygon a new shape. To do this click on the point to move and keep the mouse button held down until you're finished the move.

3) Roam lets you drag the whole polygon to a new spot. To roam click in the middle of the polygon to be roamed,and hold down the mouse until your done dragging the polygon to the new spot.

4) Select mode, by clicking inside of a polygon, the polygon will be highlighted so that you can verify that it is indeed the polygon you meant to select. Once a polygon is selected, it can be smoothed or deleted. Only One polygon can be selected at a time and the f, s and a key are only active when the selected polygon is in a currently displayed section. The smoothing keys are really mostly for automatically made polygon where with some methods, a "miss" could result in an incorrect jagged edge.

*Note that the last polygon made is the "selected" polygon unless another polygon gets selected so you can apply these three keys just after making a polygon without going to select mode. But if you delete the last polygon, the next to last will not become a selected polygon.

"f" key: smooths jagged edges one at a time starting with the worst.

"s" key: smooths the jagged edges all at once. Currently, smoothing just means putting the very wrong point in between it's two adjacent points.

"a" key: if the polygon is just plain wrong and you want to get rid of it. hit the "a" key.

4a. Deleteing a polygon. If you just want to delete the last polygon that was created in a section hit the "d" key. Beware that if you are in select mode the "d" key is not active because we just don't want to confuse if you select a polygon and hit the d key you might delete the last polygon when you meant to delete the selected one.

5) Auto mode attempts to create a polygon around a particular structure. By clicking inside the structure with the mouse a polygon will be created. For more info on this, please see the autopolygon keyword.

6) Off - if you are running several programs at the same time, there may be a time when you will be clicking in the window for another program and you don't want button presses to have an effect on EditPolygon. In this case set mode to off.

Test_Section

When test_section is on, you can create polygons that will be shown as you move thru the sections, but will not be applied to the section unless you hit the apply test section button, or hit the hot key "t". When the polygon is applied, it will turn red, (or the waves color) instead of green. If you want to add, delete or modify an existing section polygon, toggle off the test section so that the action will apply to the real section instead of the test section. Then the next time you want to work with the test section, toggle the test section toggle back on and the polygons that were in the test section will show again and can still be used. If you want to delete the polygons in the test section, you can either, hit the "d" key as many times as there are polygons, or in the edit options pulldown, select "delete test section" to clean the slate. You can also use select from the action mode pulldown to select the polygons you want to delete then hit the "a" key to delete it. You may want to use test section to make sure you have a polygon or polygons that are good for a number of sections. When you've got the right polygon for all the sections you can you the copy polygons function in the edit options pulldown to copy the test section to all the sections at once. When you apply a test section, if the active wave mode is one, the section will be applied to the current section in the toggled wave. If the wave mode is all, it will be applied to that section in all the waves.

Edit_Options

This pulldown has the following functions:

Copy Polygons - pops up a menu to let you copy polygons from one or a range of sections to one or a range of sections:

COPY_FROM there are four ways that you can copy polygons. use the toggles on the left to choose one of these ways.

1. sect - means you will copy from one section. fill in the sect,time and wave to copy from.

2. time - means you will copy all the sections in one time point to corresponding sections in other time points.

3. wave - you will copy all the sections in one wave to correspoding sections in other waves.

4. test sect - you will copy from the test section

note: when you select a toggle. any fields that are not neccessary will dissapear so you know what range you can copy to.

COPY_TO depending on what type of range you will copy from, there are different ranges you can copy to. copying from one section or the test section, you should enter the z range time range and wave range to copy to. you can copy one time to multiple times in multiple waves. you can copy one wave to multiple waves.

The set all button sets the output to the whole range of the image window, just so you don't have to go and figure out what your range is.

Clear test section - removes all the polygons in the test section

Clear partial - pops up a menu allowing you to select individual sections or a range of sections to clear.

Clear all - remove polygons from all sections

Auto_Polygon

Autopolygon mode creates polygons semi-automatically using a single point picked by the user as a comparison intensity for the edge it trying to find.

Method - There are currently five methods to choose from for doing automatic polygon creation. The first four methods use a "radial" approach in that a point is picked inside the structure and then the edge is searched for in "num points" directions, radiating from the initial pick. The difference in these methods is the criterion for edge:

Biggest Change: compare successive adjacent sampling areas for average intensity from "min reach" data points from the center to "max reach" and use the biggest change.

Percent Change: compare successive adjacent sampling areas for average intensity starting at "min reach" data points from the center and stop when the entered % change difference is found. if not found by the time the "max reach" is reached, just use max reach.

Rate of Change: compare successive triplets of adjacent sampling areas for average intensity and measures rate of change for each triplet from "min reach" data points, from the center, to "max reach" and uses the position where the rate of change was the highest.

Change from Center: compare successive sampling areas to the ORIGINAL PICKED POINT sampling area for average intensity starting at "min reach" data points from the center and stop when the entered % change difference is found. if not found by the time the "max reach" is reached, just use max reach.

For all of these radial methods, once the initial polygon is made, it is possible that there will be points on the polygon where structure was missed, leaving a sharp edge sticking out. In this case, Use the keyboard keys to clean up the polygon:

"f" key: smooths jagged edges one at a time starting with the worst.

"s" key: smooths the jagged edges all at once. Currently, smoothing just means putting the very wrong point in between it's two adjacent points.

"d" key: if the polygon is just plain wrong and you want to get rid of it. hit the d key.

Tracer % change- * THIS METHOD IS USUALLY THE BEST METHOD The fifth method uses the same criterion as Change from Center to find the edge initially, then instead of using the radial method, it follows the structure around by doing a sweeping search for the continuation of the edge. To use this method, understand that the initial search is to the right of your mouse click and that it will compare each sampling area intensity to the sampling area intensity at the place you clicked. Once it finds an edge, it will start by assuming the structure moves downward and will sweep in that direction to find the edge. From then on, it will assume that the edge will follow in the vacinty of the direction of that last two points, always sweeping in that direction. This method, therefore,does not require that you click an object from the inside.

2D vs 3D - select if you want the automatic search for the object to be for just the current section (2D) or if you want it to find polygons for the object in 3D. When 3D is selected, the search parameters will be used to try to decide how many sections to include. You can limit the number of sections from the center point section using the max z reach parameter. 2D-3D functionality works for both manual picking and with an auto pick file.

change - defines the the percent change in intensity you are looking for use the pulldown to select if this change should be an increase or a decrease from the comparison value.

numpoints - For the first four methods, numpoints specifies how many points should be used to surround the structure. For the last method, "tracer", numpoints is used as a minimum number of points that are acceptable to define the structure. If the resulting number of points is less than this number the polygon will not be created.

sample - when searching for the change in intensity, a local mean will be taken for each position. the size of the area measured is the square of the sample value.

step_size - is used for the "tracer" method only and defines how far apart the points will be.

min_reach - gives a distance from the center point to begin the outward search for intensity change. Helps to avoid structure closer to the picked point from being "found" instead of the desired structure.

max_reach - Sets a limit for how far to search for the structure from the picked point to avoid other structures and futile searching when structure is not found.

max_z_reach - Sets a limit for how far in one z direction to search for polygons with a 3D object. ie. reach of 4 when point is picked in section 10 would allow polygons to be made from sections 6 to 14.

max_diff - the biggest allowable difference for length of vectors between a point and the center for two adjacent points. this helps to avoid horribly wrong points from being made when the criterion cant find structure.

extend - once the edge is found, the actual point can be placed a specified distance from that edge. a negative number will put points inside the structure, and a positive number puts the points farther out from the structure.

The above parameters are saved in your .iveprefs directory so that next time you use Editpolygons auto mode, the last method you used will be the default and the parameters used for any method are preserved.

automatic smooth - if one of the first four methods is used, it's possible that holes in the structure will cause a spike in the polygon. When this happens, the polygons can sometimes be fixed just by using the smooth function. When this is toggled on, each polygon made is automatically checked for these spikes and smoothed. In order to selectively smooth polygons, use the smooth hot key immediately after making a 2D polygon, or use the select mode to select objects to be smoothed with the hot key.

Auto Pick File can be used to read in a file of points to be used as seeds for each section for an auto method. This file needs to be in the Pick Points format.

More Tools....

Propagating Tools- Once you have semi_automatically created 2D polygons in one section, you can use that section to propagate polygon seeds for finding polygons in other sections. Whether you want to autopick a single section or a range of sections, you need to set these two parameters.

1. Using ZWT - enter the Z, wave and time of the section that already contains polygons to be used as seeds for createing the current sections polygons.

2. AutoPick uses points from a different section as seeds for new polygons in the current section. There are two methods for getting the seed points:
   a. if using last picked point is toggled on, the point that was picked for each polygon in the reference section will be used.
   b. otherwise the center of gravity for each polygon in the neighboring section will be used.

Graphics_Toggles

There are several toggles for how the graphics are displayed. "show graphics zwt" - lets you see what graphics you have in some specified section while looking at any other sections. If you toggle this on, the specified section will show in an light brown. "show polygons all waves" - will show the polygons on the corresponding sections for all the waves even in black and white mode. "graphics" - toggles on and off the polygon graphics

Hot_Keys

This is a list of the keys that are associated with this program. In order for the keys to have an effect, you need to have the mouse in the window you are working in. If you do not want these keys to do anything if they are hit, turn off the keys toggle in the EditPolygon main menu.

spacebar - closes a polygon

"e" - deletes last point

"s" - smooths out selected polygon

"f" - smooths selected polygon one step at a time

"a" - deletes a selected polygon

"g" - unselects a selected polygon

"d" - deletes the last polygon made in a section

"t" - transfers a test polygon to a section

"1" - puts action mode to add

"2" - puts action mode to modify

"3" - puts action mode to roam

"4" - puts action mode to delete

"5" - puts action mode to auto

"z" - changes the automethod to biggest change

"x" - changes the automethod to percent change

"c" - changes the automethod to rate of change

"v" - changes the automethod to change from center

"b" - changes the automethod to tracer % change

Save_.POL_file

The points in your polygon can be written to a file. A submenu will pop up allowing you to enter the file name to save to. The file will be saved when the save button in this submenu is hit.