Drawing Tools Plugin Help
--------------------------
This plugin provides a set of drawing tools which allows you to
rapidly draw, modify and erase contours. To use these tools make sure
3dmod is on "Model" mode, the "Drawing Tools"
plugin window is open and you've selected the "Drawing Mode"
you wish to use. Drawing Tools was originally written to be used in the Zap
window, but most operations also work in the Slicer if Model in Slicer
is selected.
Notice that many of the tools use a red
"sculpt circle" around the cursor, the size of which can be changed using the mouse
wheel or the keys [q] and [w].
Click here to see the
video tutorial
Click here to see
Andrew Noske's IMOD page
List of Default Drawing Modes
--------------------------
- Normal - lets you use normal contour drawing behavior.
- Warp - allows you to quickly correct bad regions of contour
by warping the contour points within the sculpt circle. Click and hold the
[second_button] distort the region
of contour, or the [third_button] do so with local smoothing.
If you select "contort line" or "auto" for the "warp tool
behavior" in the Mouse and Keyboard dialog, the region of contour to be affected will
be highlighted before and as you make the adjustment. There may be some
difference in warping behavior if "area" is selected there.
- Sculpt - lets you quickly draw contours by holding the point
addition mouse button [second_button] and pushing the contour
outwards or inwards with the sculpt circle. Holding down [shift]
as well lets you will pinch contours toward the center instead, as if
grabbing the nearest point within the sculpt circle. You can also use the
[third_button] to do warping as described for Warp if "use button 3 in
sculpt to warp" is selected in the Mouse and Keyboard dialog.
- Join - is similar to Sculpt, but also allows you to merge
two contours by pushing one contour over another or split a contour
by pushing a gap through the middle. Using the [third_button] lets
you join or split contours using a rectangle. To join, start inside one
contour and end inside the other; to split a contour in two, start on one
side of the contour and end on the other side. In each case, the rectangle
indicates the new segments of contour that will be formed.
- LiveWire - an edge detection tool to help you quickly trace around
dark membranes [second_button], similar to the "magnetic
lasso" tool in Photoshop. For more details, see the Tips section
below. * Does not work in the Slicer.
- The Wand - an adaptive flood filling algorithm where you can click and
drag [second_button] to rapidly fill in an area of similar
greyscale. Using the [third_button] you can use the little sculpt
circle to make minor touchups to the selected contour. Does not work in the Slicer.
- Eraser - allows you to delete contours [second_button] or points
[third_button] touching the sculpt circle. Holding [shift+second_button]
lets you break apart a contour, deleting points under the circle and leaving
the contour open.
- Measure - allows you to draw a straight line between any
two points [second_button] and displays the distance between these
points in the relevant units.
* With the LiveWire tool be warned that it doesn't work on certain
images. Either it works brilliantly or not at all. It should crash much less than
it used to; if it crashes for you, be sure to save regularly and please
report the problem.
Extra Drawing Modes
--------------------------
NOTE: The list above shows the default order of drawing tools, but by clicking any of
the numbers (to the right of the tools) it's possible to change the order,
remove tools, show more or fewer tools (up to 9), and/or add to the list
one of these other modes:
- Transform - allows you to move [second_button], scale [third_button], rotate [shift+second_button] or
stretch [shift+third_button] the currently selected contour.
- Curve - allows you to draw a smooth contour by clicking a sequence
of points [second_button] and then end the contour by pressing
[space] or connecting the end of the contour to the beginning. To disconnect
from the selected contour without adjustment press [n].
- Circle - allows you to rapidly draw circles by clicking and dragging
the mouse [second_button] from one edge of the circle to the far edge.
Using the [third_button] after a circle is made, you can also quickly
stretch/squash the
circle (or whatever contour is selected) into shape (to make ovals).
- Correct - allows you to delete [second_button]
segments of a contour within a "correction" circle, and/or which are
cut off by the circle. The red overlay shows what the result will be before
you click the button. This feature may be useful to help prune contours
produced by automatic segmentation, but which were oversegmented, and contain
undesirable regions.
Modeling in the Slicer: These tools, except for Livewire and
Wand, can be used at an arbitrary angle in the slicer. They work by
transforming the contour being operated on by the slicer angles, so that it is
coplanar in Z. If an operation works on the current contour and it is not
sufficiently coplanar after this transformation, then the operation will not
be done. This should correspond to the contour being fully drawn on the
current slice. When necessary, all contours in an object are tested for
whether they lie on the plane being viewed. These statements apply in both
the Slicer and the Zap, so you will not be able to operate on tilted contours
in the Zap window. If the angles have changed since a contour was drawn, you
can return to angles that make it lie in a plane with the hot key Shift+W.
When modeling without Drawing Tools, 3dmod starts a new contour at the same
"surface" number as the last, and when modeling in the Slicer, it starts a new
surface when it starts to add contours at a new set of angles. Drawing Tools
does not set the surface number for any new contours. This is not
needed for meshing to work right, unless there are only small changes in
angles between overlapping contours that should not be meshed together.
If necessary, you can use Edit-Surface-Move to assign a surface number for
contours created here.
Hot Key Summary
---------------------
[1]-[9] |
Select corresponding draw mode (see above) |
[W] |
[Ctrl+Q] |
Increase size of sculpt circle (hold shift to go faster; but Shift+W
does not do this when modeling in Slicer, Ctrl+Shift+Q has to be used.) |
[Q] |
Decrease size of sculpt circle (hold shift to go faster). |
|
|
[R] |
Reduce current contour |
[E] |
Smooth current contour by moving points |
[Shift+E] |
Smooth current contour without moving existing points |
|
|
[A] |
Find next intersecting contour edge |
[I] |
Invert points in current contour |
[Shift+I] |
Reorder points in current contour to start at selected point |
|
|
[Y] |
Go to next largest value using find property
(see: More Actions - find points/contours) |
[Shift+Y] |
Go to next smallest value using find property |
[L] |
Recalculate values of contours/points using find property
and select the smallest |
[Shift+L] |
Recalculate values of contours/points using find property
and select the largest |
|
|
[Ctrl+X] |
Cut current contour |
[Ctrl+C] |
Copy current contour |
[Ctrl+V] |
Paste contour into current slice and object, centered on mouse. You
can copy or cut and paste between Zap and Slicer windows, or between
different angles of the Slicer window; the pasted contour will always be
flat in the current slice. |
[Ctrl+Shift+V] |
Paste contour into current slice and object in same XY position |
|
|
[Space] |
Copy current contour to current slice (use also [?]) |
[Shift] |
Hold Shift down to alter the behavior of certain draw modes |
Tips
---------------------
Holding and dragging [shift+first_button] allows you to quickly
scroll up and down through the slices.
Be warned that the sculpt and join tool were designed for 2D
closed contours and so I would not recommend using these tools
with open or scattered contours which span multiple slices.
To use the Livewire, click to add the first point of a contour,
move the mouse to another point along the membrane, and click to add the
segment if it follows the membrane well enough. You can finish the contour
by clicking close enough to the starting point; or, if the line forward to
the starting point follows the membrane from the last point added, you can
just click again near that last point to complete the contour. Smoothing
occurs after the contour is finished.
If you select a contour using the "transform" tool, you can
copy it to nearby slices by simply scrolling to a different
slice and mouse clicking [second_button]. In this way transform can
be useful to quickly mark-up simple shapes.
The join tool and, to a lesser extent, the sculpt tool can become
sluggish for objects with numerous contours. Modeling in Slicer will make
them even slower.
To improve performance you should consider adding an extra object and
then use 'Edit - Object - Move' to merge the contours into the
desired object periodically.
Another way to improve performance can be to reduce contours. Use
'Reduce Contour' to reduce the current contours, by selectively
removing points, or 'Reduce Object' to reduce ALL contours
in the current object. Use 'Smooth Contour' to smooth the
current contours, by adding points, or 'Smooth Object' to
smooth ALL contours in the current object.
Reducing objects can often substantially reduce the number of points in
the model, but be very careful you don't lose information in
the process.
Under More Actions are a number of other options to sort, transform,
move, copy, expand and modify contours. These have been listed in more
detail below and it's recommended you read about them all - especially
the 'crop contours' feature.
In 3dmod (without the drawing tool plugin) there are several
useful drawing tools you might not know about:
- You can select multiple contours by holding
[ctrl+first_button].
- You can delete points by holding [shift+third_button].
- You can transform selected contour(s) by toggling
the Zap "contour transform mode" with [P] - this mode is
similar to the "transform" drawing tool.
More Actions
---------------------
In addition to the options on the plugin you can see, a large number of
additional tools are available when you click the "More Actions" button.
A small description of each is written below. Note that most of these tools
allow you to specify a range of contours and/or apply the action to only
dotted or solid contours.
- clean model and fix contours - Contains a number of options to clean
multiple objects and 'fix' contours by removing bad, redundant or
out-of-bounds points and more. It's recommended you run this on all
finished models, and also contains an option to make all contours clockwise
or anticlockwise.
- find intersecting edges [a] - Finds closed contours which cross
their own path or the path of other contours. In most situations (eg: closed
membranes) no two lines should ever intersect; especially a line crossing
itself; so it's a good idea to use this tool before converting your contours
into the final mesh model. One of the options is to automatically 'delete
intersecting contours in current object', but I'd suggest you leave it on
'list all intersecting edges' then use [a] to check them all individually.
- sort contours - Physically sorts contours using the criteria you
select. Among the many options you can sort a range (by default all) of
contours by: surface number, number points, contour length, area, max segment
length, avg gray value, interpolated, random, mean value in x/y/z or min
value x/y/z!
- find contours [y] - Use [y] to find the contour or point with the
next biggest value based on the criteria you select. Clicking this will let
you choose the criteria (same list as above) and value to start at...
from there use [y] and [Y] to iterate through contours. Using this it's
possible, say, to find contours with 5 points (or in surface #5) without
needing to sort them.
- delete contours - Allows you to delete any contours which meet your
specified criteria. You can choose to run it over a range of contours in
the current object, or ALL contours in a range of objects. The 'criteria
for deletion' you can choose from include 'slices / z value' and/or
'number of points'... but keep in mind this delete feature can be
used to delete a range of contours after you've sorted them using some
other criteria. This tool was originally created to allow easy deletion
of contours off every Nth slice etc.
- crop contours - Will crop and 'cut open' contours in the current
object which go outside the tomogram boundaries or rubber band area. This
feature can be VERY HANDY. The edges of tomograms typically look messy after
manual segmentation AND it's a pain to manually mark individual membranes
which intersect the edge as open. I suggest use Interpolator plugin and the
sculpt tool and just allow all your contours to go outside the boundary.
THEN, when you're done (and maybe saved a backup!), run this tool and it
will automatically calculate intersection points and cut open all the relevant
segments of contour!
- copy contours - Use this to copy or move a range of contours from
the current object to another object.
- transform contours - Use this to precisely translate;
scale and/or rotate a range of contours in the current object.
- modify contours - Allows you to modify contour properties over
a range of contours in the current object.
- move point - Use this to move the current point or the current
contour to a precise position. The move can be relative or absolute. (Does
not work when modeling in Slicer.)
If you click 'Mouse/Keyboard' you can set the shortcut key [d]
to bring up this dialog or several other options - by default it will all
point in the selected contour to the end.
- expand contours - Use this to expand a ring around a range of
open or closed contours within the current object. In other words, a single
circular contour will become two concentric circles some thickness apart.
This is useful if you've drawn through center of a thick membrane and
then decide to model both sides. There are also options here to shrink
or grow the contour by some thickness (without turning each closed contour
into two contours).
- print basic model info - Prints some basic information about the
current object including the average distance between points; average points
per contour; and number of empty contours.
- print detailed object info - Prints detailed information about the
current object. This includes: bounding coordinates, the number and fraction
of contours which are: empty, single points, interpolated, anti-clockwise,
open, and also the total and average number of points, length,
segment length and area of all contours.
- print detailed contour info - Prints detailed information about the
current contour; or a range of them. In addition to bounding box, area and
length, there is an option to print out all segment lengths or all point
sizes and positions.
- reset values - Resets all settings (for this Drawing Tools plugin)
to default.
---------------------
This plugin was created by Andrew Noske (andrew.noske<at>gmail<dot>com).
If you encounter bugs please e-mail me before e-mailing the
IMOD group (to reduce traffic).
In your e-mail please tell me exactly how and when the problem
occurred and attach the model file you were using with
enough information that I can replicate the error/crash.
NOTE: Maintaining this plugin is part of the is part of the
"SLASH segmententation"
initiative. Please contact me for citation information.
Acknowledgements: Brad Marsh at the Institute for Molecular Bioscience (www.imb.uq.edu.au) for helping encourage this work - without this nor any of my other plugins would exist. Jeffrey Bush at the The National Center for
Microscopy and Imaging Research (www.ncmir.ucsd.edu) for helping me add the amazing LiveWire code, and Mark Ellisman for encouraging us to give back to IMOD. David Mastronarde and the team at The Boulder Lab for 3-D Electron Microscopy
(bio3d.colorado.edu) for their wonderful support of all my plugins.