qmsm_shape_editor: Tool for manipulating points on an image

A tool which allows a user to When multiple images and points are to be viewed or corrected, a file listing all the images+points files can be loaded.
Use the mouse wheel to zoom in and out.
An initial shape and associated curves can be created with the qmsm_markup_tool.

Command line options

Run the tool using either:
qmsm_shape_editor -i image.png -p points.pts [-c curves.crvs] [-s shape_model.msm]
where curves.crvs is a
curves file and shape_model.msm contains an msm_shape_model object (for instance, built by the msm_build_shape_model tool.
or:
qmsm_shape_editor -l image_list.txt [-c curves.crvs] [-s shape_model.msm]
where image_list.txt is a text parameter file in the following format:
// Define directories containing image and points files
image_dir: images/
points_dir: points/
images:
{
  example1.pts : example1.png
  example2.pts : example2.png
  example3.pts : example3.png
}
when this option is used (or such a list is loaded using the "File->Load Image List" option), the tool records the list of images and points, and displays the first one.
You can then step through the images using the left and right arrow keys, or the items on the View menu (for first/last).
If you edit any points, when you attempt to move to another image it will ask you if you wish to save the changes (overwritting the existing file). If you set the "Always Save Points" flag (in the Props menu), then it will always save the points, without asking, when you move to the next image.

Point State

The colours of the points indicate their state.
Unless you have changed them (using the Graph Props), they are as follows:

Menu Options

File Menu

View Menu

Props Menu

Help Menu

Interaction Modes

Drag Mode Click and drag to move viewport around
Select Mode Press and drag to move a point. Rubber-band box to select groups.
Drag-Shape Mode Click and drag a point to move it. All un-fixed points are dragged around to satisfy shape model constraints.
Equal Space Mode Click on a point to equally space points on the curve through the point, limited by either the ends of the curve or fixed points.
The "Clear" button sets all points to not fixed.

Undo/Redo

The undo/redo buttons allow you to do just that.

Point Manipulation

Translating all the points

To drag all the points at once, either

Rotating/Scaling all the points

Two steps:

Using a Shape Model to guide the points

If you have loaded a shape model, when you are in the Drag-Shape mode it can be used to help move points around.
When you click and drag, any points which are not fixed will be moved around so that they best satisfy the shape constraints. To avoid this being over-constrained (as may be the case when there are few shape parameters available), a residual term is calculated for each point to ensure smooth deformation. This is calculated by performing a weighted least squares fit of the model to the fixed points. Any residual term at each point is recorded, and a Thin-Plate Spline used to propogate the residual to all other points. This is simple but pleasingly effective.