Jacobian determinant - 2D deformation field and pixel/voxel spacing?

Dear all,
I have a numpy array representing a deformation field with 2D shape (i.e., only x and y displacements), and I want to compute its Jacobian determinant.

Here’s how I’m doing it:
def_field_np is a numpy array w/ shape (256,256,2) representing the x and y displacements

``````def_field_sitk = sitk.GetImageFromArray(def_field_np, isVector=True)
jacobian_det = sitk.DisplacementFieldJacobianDeterminant(def_field_sitk)
jacobian_det = sitk.GetArrayFromImage(jacobian_det)

``````

My questions:

• Can sitk.DisplacementFieldJacobianDeterminant compute the determinant for a 2D deformation field? Or is it expecting a 3D deformation field?
• Should the pixel/voxel spacing be set before computing the determinant?def_field_sitk.SetSpacing(pixel/voxel_spacing)

Thank you!

Yes.

Yes, but why is really the important question. The ITK displacement field as vector displacements in physical (x,y) space. That is to say the space, origin and direction cosine matrix define the input physical space coordinates before the displacement vector is applied.

1 Like