deepdrr
deepdrr copied to clipboard
Support for Faceup/Facedown for volume create from HU
I get the hu_matrix from pydicom
then create volume
with Volume.from_hu
and trying to get projection with PA view.
Because the anatomical_coordinate_system
for Volume.from_hu
does not implement RAS
, I can only get projection on axial plane.
The raised error show NotImplementedError("conversion from RAS (not hard, look at LPS example)" )
.
The rotation matrix of LPS is
rotation = [
[spacing[0], 0, 0],
[0, 0, spacing[2]],
[0, -spacing[1], 0],
]
I know the difference between LPS
and RAS
is only the opposite direction of axis.
However, I tried to add negative symbol -
, but I still can't get PA view projection.
Could you please give me some hint to modify it?
You would pass a custom argument to the world_from_anatomical
transform, thus rotating the volume with respect to world. The faceup()
method is just a convenience method that modifies this transform with a rotation. You can see its source code for an example of how to do construct the rotation.