Coordinate systems
k-Plan world coordinates
k-Plan uses an RAS+ coordinate system, where the x/y/z world origin is positioned at the LPI (left, posterior, inferior) corner of the primary planning image. The x/y/z coordinates increase in the RAS+ (right, anterior, superior) direction of the image. The plan developer dialog shows three orthogonal planes aligned with this coordinate system. The voxel coordinates are assumed to correspond to the centre of each voxel.
NIFTI image coordinates
Planning images are loaded in the NIFTI file format. This format includes the image data in voxel space, along with a transformation that maps from voxel coordinates to world coordinates. The NIFTI world coordinate system is assumed to be RAS+, which matches the coordinate system used by k-Plan.
The image transformation in the NIFTI file can be stored in two ways: as quaternion values (using the qform
header information) or as an affine transformation matrix (using the sform
header information). If only one of these is present in the header, this transformation is used by k-Plan. If both are present, the sform
transformation is used, and a warning is displayed if the sform
and qform
transformations are different. If neither are present, the identity transform is used and a warning is displayed.
The image transformation is applied to the NIFTI voxel data before being displayed in k-Plan, or used for material property conversion. If resampling is required, cubic interpolation is used. If the image is rotated, the image domain is padded so none of the original NIFTI voxel data is lost. If extrapolation is required (for example, the image is rotated by 45 degrees), the minimum value in the NIFTI voxel data is used as the fill value.
k-Plan directly applies the transformation matrix stored in the header. This means that all transformations, including general rotations and shear, are applied. However, after applying the transformation, the LPI corner of the transformed image data is aligned to (0, 0, 0) in the k-Plan world. This means if multiple images are used, any relative translations of the images in NIFTI world coordinates are ignored.
Translations in NIFTI world coordinates
All images are displayed aligned with the LPI corner of the primary planning image. Any relative translations of the images in NIFTI world coordinates are ignored.
Transducer coordinates
Transducers are positioned relative to the k-Plan world coordinates using an affine transform as described in transducers.