new Geometry(origin, size, spacing, orientation)
- Source:
2D/3D Geometry class.
Parameters:
Name | Type | Description |
---|---|---|
origin |
dwv.math.Point3D | The object origin (a 3D point). |
size |
dwv.image.Size | The object size. |
spacing |
dwv.image.Spacing | The object spacing. |
orientation |
dwv.math.Matrix33 | The object orientation (33 matrix, default to 33 identity). |
Methods
appendFrame()
- Source:
Append a frame to the geometry.
appendOrigin(origin, index)
- Source:
Append an origin to the geometry.
Parameters:
Name | Type | Description |
---|---|---|
origin |
dwv.math.Point3D | The origin to append. |
index |
number | The index at which to append. |
equals(rhs) → {boolean}
- Source:
Check for equality.
Parameters:
Name | Type | Description |
---|---|---|
rhs |
dwv.image.Geometry | The object to compare to. |
Returns:
True if both objects are equal.
- Type
- boolean
getOrientation() → {dwv.math.Matrix33}
- Source:
Get the object orientation.
Returns:
The object orientation.
- Type
- dwv.math.Matrix33
getOrigin() → {dwv.math.Point3D}
- Source:
Get the object origin. This should be the lowest origin to ease calculations (?).
Returns:
The object origin.
- Type
- dwv.math.Point3D
getOrigins() → {Array}
- Source:
Get the object origins.
Returns:
The object origins.
- Type
- Array
getSize(viewOrientation) → {dwv.image.Size}
- Source:
Get the object size. Warning: the size comes as stored in DICOM, meaning that it could be oriented.
Parameters:
Name | Type | Description |
---|---|---|
viewOrientation |
dwv.math.Matrix33 | The view orientation (optional) |
Returns:
The object size.
- Type
- dwv.image.Size
getSliceGeometrySpacing() → {number}
- Source:
Get the slice spacing from the difference in the Z directions of the origins.
Returns:
The spacing.
- Type
- number
getSliceIndex(point) → {number}
- Source:
Get the slice position of a point in the current slice layout. Slice indices increase with decreasing origins (high index -> low origin), this simplified the handling of reconstruction since it means the displayed data is in the same 'direction' as the extracted data. As seen in the getOrigin method, the main origin is the lowest one. This implies that the index to world and reverse method do some flipping magic...
Parameters:
Name | Type | Description |
---|---|---|
point |
dwv.math.Point3D | The point to evaluate. |
Returns:
The slice index.
- Type
- number
getSpacing(viewOrientation) → {dwv.image.Spacing}
- Source:
Get the object spacing. Warning: the size comes as stored in DICOM, meaning that it could be oriented.
Parameters:
Name | Type | Description |
---|---|---|
viewOrientation |
dwv.math.Matrix33 | The view orientation (optional) |
Returns:
The object spacing.
- Type
- dwv.image.Spacing
indexToWorld(index) → {dwv.math.Point}
- Source:
Convert an index into world coordinates.
Parameters:
Name | Type | Description |
---|---|---|
index |
dwv.math.Index | The index to convert. |
Returns:
The corresponding point.
- Type
- dwv.math.Point
isInBounds(point) → {boolean}
- Source:
Check that a point is within bounds.
Parameters:
Name | Type | Description |
---|---|---|
point |
dwv.math.Point | The point to check. |
Returns:
True if the given coordinates are within bounds.
- Type
- boolean
pointToWorld(point) → {dwv.math.Point3D}
- Source:
Convert a 3D point into world coordinates.
Parameters:
Name | Type | Description |
---|---|---|
point |
dwv.math.Point3D | The 3D point to convert. |
Returns:
The corresponding world 3D point.
- Type
- dwv.math.Point3D
toString() → {string}
- Source:
Get a string representation of the geometry.
Returns:
The geometry as a string.
- Type
- string
worldToIndex(point) → {dwv.math.Index}
- Source:
Convert world coordinates into an index.
Parameters:
Name | Type | Description |
---|---|---|
point |
dwv.math.Point | The point to convert. |
Returns:
The corresponding index.
- Type
- dwv.math.Index