Purpose

The module Draw3D and the SimpleDraw3D macro offer operations to draw objects into images.

Regions can be filled in 2D/3D, overwritten by simple text or boxes, lines, pixels, spheres, circles, cones, halfspaces, ellipses or disks. Coordinates for object drawings are received by a field connection and are used to specify the objects` location, orientation and extents.

All pixels values written into an image are not simply overwritten but replaced by the result of user selectable function. Undo and redraw facilities exist which also permit changes of object properties after drawing them.

Windows

Default Panel

../../../Modules/ML/MLMiscModules/mhelp/Images/Screenshots/Draw3D._default.png

Input Fields

input0

name: input0, type: Image

Output Fields

output0

name: output0, type: Image

Parameter Fields

Field Index

1: String Max: Double Text to be drawn: String
2: String Min: Double Timepoint: Integer
3: String Mode: Enum U1: Trigger
Active: Bool numAvailUndos: String U2: Trigger
Allow positions outside of image: Bool Object Shift by Incrementation: Vector3 Undo: Trigger
Clear Positions: Trigger pIndicator: Float Undo All: Trigger
Cr Off X: Double Position Input: Vector3 Undo10: Trigger
Cr Off Y: Double position4: String Update automatically on parameter changes: Bool
Cr Off Z: Double R1: Trigger Ur1: Trigger
D1: Trigger R2: Trigger Ur2: Trigger
D2: Trigger Rot X: Double Use (applyThreshold): Bool
Dl1: Trigger Rot Y: Double Use (permitUndoing): Bool
Dl2: Trigger Rot Z: Double Use 0 background: Bool
Draw: Enum Scale X: Double Value: Double
info: String Scale Y: Double X: Double
L1: Trigger Scale Z: Double Y: Double
L2: Trigger stop: Trigger Z: Double

Visible Fields

Draw

name: drawMode, type: Enum, default: Nothing

Defines the object to be drawn.

Values:

Title Name Deprecated Name Description
Nothing Nothing   Nothing is drawn.
Voxel Voxel   A voxel with the Voxel Size X, Y, Z is drawn.
Line Line  

A line is drawn from 1 to the 2.

The line thickness is given by Voxel Size.

Poly Line PolyLine  

One selected position after another is connected to a list of lines.

The line thickness is given by Voxel Size.

2DFill 2DFill  

A 2D-flood fill is performed with a starting position given by 1.

For filling a 4-neighborhood is used.

Values greater than Min and less than Max are not filled. All other values are filled even if Min is greater than Max.

Note that this also holds if the Use is deactivated.

3DFill 3DFill  

A 3D-flood fill is performed with a starting position given by 1.

For filling a 6-neighborhood is used.

Otherwise, the same restriction as in 2DFill apply.

Circle (center, radius) Circle (center, radius)  

A circle is drawn with origin at 1.

Its outline goes through 2. The line thickness is given by Voxel Size.

Note that the circle is drawn only in currently selected z-slice.

Circle Circle  

A circle with minimum diameter is drawn which goes through 1 and 2. The line thickness is given by Voxel Size.

Note that the circle is drawn only in currently selected z-slice.

Sphere (center, radius) Sphere (center, radius)   A sphere is drawn with origin at 1 and it goes through 2. The surface thickness is given by Voxel Size.
Sphere Sphere   A sphere with minimum diameter is drawn which goes through 1 and 2. The surface thickness is given by Voxel Size.
Filled Circle (center, radius) FilledCircle (center, radius)  

A disk is drawn with its origin at 1 and its outer line goes through 2.

Note that the disk is drawn only in currently selected z-slice.

Filled Circle FilledCircle  

A disk with minimum diameter is drawn whose outer line goes through 1 and 2.

Note that the disk is drawn only in currently selected z-slice.

Filled Sphere (center, redius) FilledSphere (center, redius)   A filled sphere is drawn with its origin at 1 and its surface goes through 2.
Filled Sphere FilledSphere   A filled sphere with minimum diameter is drawn whose surface goes through 1 and 2.
Box Box   A box is drawn whose lower left front edge is given by 1 and its upper right back edge by 2.
String String  

The text given in the Text to be drawn field is drawn at the current 1.

It is rotated and scaled as specified in the fields Scale X/Y/Z, Rot X/Y/Z.

Line feeds are handled by CR-OffX/Y/Z.

Ellipse Ellipse   1 and 2 specify the two edge points of a box whose extends are used as diameters for an ellipsoid to be drawn.
VSized Ellipse VSizedEllipse   The current selection specifies the center of a filled ellipsoid whose diameters are given by the Voxel Size.
VSized Box VSizedBox   The current selection specifies the center of a filled box whose extends are given by the Voxel Size.
Cone Cone   1 and 2 specify the two edge points of a box whose x/z-extends are used as radius of the cone and whose height is used as height of the cone.
Triangle Triangle   1, 2 and 3 specify the edges of the triangle to be drawn.
Parallelogram Parallelogram   A parallelogram is drawn between 1 (P1), 2 (P2), 3 (P3) and a fourth position P4 = P2+(P1-P2)+(P3-P2). It is the “opposite” position to 2.
Four Point Plane FourPointPlane ForPointPlane 1 (P1), 2 (P2), 3 (P3) and position4 (P4) specify a plane consisting of two triangles given by P1, P2, P3 and by P1, P3, P4.
Two XTwo Point Plane TwoXTwoPointPlane   1 (P1), 2 (P2), 3 (P3) and position4 (P4) specify a plane consisting of two triangles given by P1, P2, P4 and by P1, P3, P4.
Two XTwo Point Poly Plane TwoXTwoPointPolyPlane  

1 (P1), 2 (P2), 3 (P3) and position4 (P4) specify a plane consisting of two triangles given by P1, P2, P4 and by P1, P3, P4.

Only the first selected two positions are cleared so that the last two positions can be reused for the next plane.

Half Space HalfSpace   1, 2 and 3 define a plane in the space and the fourth position specifies the side of the plane to be be filled/overdrawn.
Max Coords MaxCoords    

X

name: voxSizeX, type: Double, default: 1, minimum: 1, maximum: 1023

Sets the x-size of the voxel size to draw with.

Y

name: voxSizeY, type: Double, default: 1, minimum: 1, maximum: 1023

Sets the z-size of the voxel size to draw with.

Z

name: voxSizeZ, type: Double, default: 1, minimum: 1, maximum: 1023

Sets the z-size of the voxel size to draw with.

Update automatically on parameter changes

name: autoUpdate, type: Bool, default: FALSE

If checked, the module automatically updates its output image on any parameter change.

Active

name: canUndoAndRedraw, type: Bool, persistent: no

If checked, the Undo and the Redraw mechanisms are active.

Use (applyThreshold)

name: applyThreshold, type: Bool, default: FALSE

If checked, the threshold interval is used for limiting overwritten voxels.

Use 0 background

name: outputMask, type: Bool, default: FALSE

If checked, background values will have a value of 0 instead of the original input image values.

Value

name: writeValue, type: Double, default: 0, minimum: 0

Sets the voxel write value.

Mode

name: pixCompute, type: Enum, default: WriteVal

Defines how the target voxel value is computed.

Values:

Title Name
Write Val WriteVal
Input Val InputVal
Vis Vox + Write Val VisVox + WriteVal
Vis Vox - Write Val VisVox - WriteVal
Vis Vox * Write Val VisVox * WriteVal
Vis Vox / Write Val VisVox / WriteVal
Vis Vox ^ 2 VisVox ^ 2
Sqrt(Vis Vox) Sqrt(VisVox)
Vis Vox Xor Write Val VisVox Xor WriteVal
Vis Vox And Write Val VisVox And WriteVal
Vis Vox Or Write Val VisVox Or WriteVal
Vis Vox Invert VisVox Invert
Vis Vox + Uniform Noise * Write Val VisVox + UniformNoise * WriteVal
Vis Vox + Gauss Noise * Write Val VisVox + GaussNoise * WriteVal
Vis Vox * (1 + Uniform Noise * Write Val) VisVox * (1 + UniformNoise * WriteVal)
Vis Vox * (1 + Gauss Noise * Write Val) VisVox * (1 + GaussNoise * WriteVal)
Min(Vis Vox,Write Val) Min(VisVox,WriteVal)
Max(Vis Vox,Write Val) Max(VisVox,WriteVal)
Input + Write Val Input + WriteVal
Input - Write Val Input - WriteVal
Input * Write Val Input * WriteVal
Input / Write Val Input / WriteVal
Input ^ 2 Input ^ 2
Sqrt(Input) Sqrt(Input)
Input Xor Write Val Input Xor WriteVal
Input And Write Val Input And WriteVal
Input Or Write Val Input Or WriteVal
Input Invert Input Invert
Input + Uniform Noise * Write Val Input + UniformNoise * WriteVal
Input + Gauss Noise * Write Val Input + GaussNoise * WriteVal
Input * (1 + Uniform Noise * Write Val) Input * (1 + UniformNoise * WriteVal)
Input * (1 + Gauss Noise * Write Val) Input * (1 + GaussNoise * WriteVal)
Min(Input, Write Val) Min(Input, WriteVal)
Max(Input, Write Val) Max(Input, WriteVal)

Min

name: borderMin, type: Double, default: 0

Sets the lower limit for interval limiting overwritten voxels.

Max

name: borderMax, type: Double, default: 255

Sets the upper limit for interval limiting overwritten voxels.

Use (permitUndoing)

name: permitUndoing, type: Bool, default: TRUE

if checked, the Undo mechansim is active.

Undo

name: undo, type: Trigger

If pressed, the last drawing is being undone.

Undo10

name: undo10, type: Trigger

If pressed, the last 10 drawings are being undone.

Undo All

name: undoAll, type: Trigger

If pressed, all drawings are being undone, restoring the original image.

numAvailUndos

name: numAvailUndos, type: String, persistent: no

Shows the number of possible undo operations.

Position Input

name: positionInput, type: Vector3, default: -1 -1 -1

Sets the world coordinate where the object is drawn.

1

name: position1, type: String, persistent: no

Sets the first corner coordinate of an object to be drawn.

2

name: position2, type: String, persistent: no

Sets the second corner coordinate of an object to be drawn.

3

name: position3, type: String, persistent: no

Sets the third corner coordinate of an object to be drawn.

Clear Positions

name: clearPos, type: Trigger

If pressed, already selected corner coordinates of an object are being cleared.

Allow positions outside of image

name: allowPosOutside, type: Bool, default: FALSE

If checked, positions outside the input image are being allowed.

Object Shift by Incrementation

name: moveVectorInput, type: Vector3, default: -10000 -10000 -10000

Sets a shift value for moving an object.

L1

name: l1, type: Trigger

If pressed, the object is being moved 1 pixel to the left.

L2

name: l2, type: Trigger

If pressed, the object is being moved 10 pixels to the left.

R1

name: r1, type: Trigger

If pressed, the object is being moved 1 pixel to the right.

R2

name: r2, type: Trigger

If pressed, the object is being moved 10 pixels to the right.

U1

name: u1, type: Trigger

If pressed, the object is being moved 1 pixel up.

U2

name: u2, type: Trigger

If pressed, the object is being moved 10 pixel up.

D1

name: d1, type: Trigger

If pressed, the object is being moved 1 pixel down.

D2

name: d2, type: Trigger

If pressed, the object is being moved 10 pixels down.

Ur1

name: ur1, type: Trigger

If pressed, the object is being moved 1 pixel to the back.

Ur2

name: ur2, type: Trigger

If pressed, the object is being moved 10 pixels to the back.

Dl1

name: dl1, type: Trigger

If pressed, the object is being moved 1 pixel to the front.

Dl2

name: dl2, type: Trigger

If pressed, the object is being moved 10 pixels to the front.

Scale X

name: scaleX, type: Double, default: 1

Sets the x-scale factor for drawn text.

Scale Y

name: scaleY, type: Double, default: 1

Sets the y-scale factor for drawn text.

Scale Z

name: scaleZ, type: Double, default: 1

Sets the z-scale factor for drawn text.

Rot X

name: rotX, type: Double, default: 0

Sets a rotation angle in degrees around x-axes for drawn text.

Rot Y

name: rotY, type: Double, default: 0

Sets a rotation angle in degrees around y-axes for drawn text.

Rot Z

name: rotZ, type: Double, default: 0

Sets a rotation angle in degrees around z-axes for drawn text.

Cr Off X

name: crOffX, type: Double, default: 0

Sets a newline offset in x-direction for drawn text.

Cr Off Y

name: crOffY, type: Double, default: 0

Sets a newline offset in y-direction for drawn text.

Cr Off Z

name: crOffZ, type: Double, default: 0

Sets a newline offset in z-direction for drawn text.

Text to be drawn

name: text, type: String, default: Text to be drawn

Sets the text to be drawn if Draw is set to String.

Timepoint

name: timepoint, type: Integer, default: 0

Sets the timepoint to be drawn to.

Hidden Fields

info

name: info, type: String

position4

name: position4, type: String, persistent: no

pIndicator

name: pIndicator, type: Float, persistent: no

stop

name: stop, type: Trigger