docstr: Convert a 4x4 matrix describing a rigid transform into a
  12-sized vector of natural affine parameters: translation,
  rotation, log-scale, pre-rotation (to allow for pre-rotation
  when combined with non-unitary scales). In case the transform
  has a negative determinant, set the `_direct` attribute to
  False.
docstr_tok: ["Convert","a","4x4","matrix","describing","a","rigid","transform","into","a","12-sized","vector","of","natural","affine","parameters",":","translation",",","rotation",",","log-scale",",","pre-rotation","(","to","allow","for","pre-rotation","when","combined","with","non-unitary","scales",")",".","In","case","the","transform","has","a","negative","determinant",",","set","the","`","_direct","`","attribute","to","False","."]
code: def from_matrix44(self, aff):
      """
      Convert a 4x4 matrix describing a rigid transform into a
      12-sized vector of natural affine parameters: translation,
      rotation, log-scale, pre-rotation (to allow for pre-rotation
      when combined with non-unitary scales). In case the transform
      has a negative determinant, set the `_direct` attribute to
      False.
      """
      vec12 = np.zeros((12,))
      vec12[:3] = aff[:3, 3]
      R = aff[:3, :3]
      if spl.det(R) < 0:
          R = -R
          self._direct = False
      vec12[3:6] = rotation_mat2vec(R)
      vec12[6:9] = 0.0
      self._vec12 = vec12
  
imports: import numpy
  import scipy.linalg
  from nibabel.affines import apply_affine
  from transforms3d.quaternions import mat2quat, quat2axangle
  from .transform import Transform
label_desc: Use image node_id 1 for calling the Rigid obj's underlying member method code with example usage: obj.from_matrix44(aff) without return types