Geometry
nanodrr.geometry
¶
convert
¶
convert(
rotation: Float[Tensor, "B D"],
translation: Float[Tensor, "B 3"],
parameterization: Parameterization,
convention: str = None,
degrees: bool = True,
isocenter: Float[Tensor, 3] | None = None,
) -> Float[Tensor, "B 4 4"]
Convert a rotation parameterization + camera center into a batch of camera
poses in SE(3). The translation is interpreted as the camera center in world
coordinates, i.e., the resulting matrix stores t = R @ translation.
| PARAMETER | DESCRIPTION |
|---|---|
rotation
|
Rotation parameters, shape depends on parameterization:
TYPE:
|
translation
|
Camera center in world coordinates, shape (B, 3).
For
TYPE:
|
parameterization
|
Which rotation representation to use.
TYPE:
|
convention
|
Required for EULER only. 3-letter string from {X, Y, Z}, e.g., "XYZ".
TYPE:
|
degrees
|
If
TYPE:
|
isocenter
|
If provided, the rotation is applied about this point
instead of the world origin. The resulting translation is adjusted
so that the camera orbits around
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Float[Tensor, 'B 4 4']
|
Batched SE(3) matrices of shape (B, 4, 4). |
Source code in src/nanodrr/geometry/se3.py
transform_point
¶
transform_point(
xform: Float[Tensor, "B *_ N+1 N+1"], v: Float[Tensor, "B *_ N"]
) -> Float[Tensor, "B *_ N"]
Apply homogeneous transformation to points.
| PARAMETER | DESCRIPTION |
|---|---|
xform
|
Transformation matrix of shape (B, ..., N+1, N+1).
TYPE:
|
v
|
Points of shape (B, ..., N).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Float[Tensor, 'B *_ N']
|
Transformed points of shape (B, ..., N). |