docs: def _create_affine_siemens_mosaic(dicom_input):
      """
      Function to create the affine matrix for a siemens mosaic dataset
      This will work for siemens dti and 4d if in mosaic format
      """
      # read dicom series with pds
      dicom_header = dicom_input[0]
  
      # Create affine matrix (http://nipy.sourceforge.net/nibabel/dicom/dicom_orientation.html#dicom-slice-affine)
      image_orient1 = numpy.array(dicom_header.ImageOrientationPatient)[0:3]
      image_orient2 = numpy.array(dicom_header.ImageOrientationPatient)[3:6]
  
      normal = numpy.cross(image_orient1, image_orient2)
  
      delta_r = float(dicom_header.PixelSpacing[0])
      delta_c = float(dicom_header.PixelSpacing[1])
  
      image_pos = dicom_header.ImagePositionPatient
  
      delta_s = dicom_header.SpacingBetweenSlices
      return numpy.array(
          [[-image_orient1[0] * delta_c, -image_orient2[0] * delta_r, -delta_s * normal[0], -image_pos[0]],
           [-image_orient1[1] * delta_c, -image_orient2[1] * delta_r, -delta_s * normal[1], -image_pos[1]],
           [image_orient1[2] * delta_c, image_orient2[2] * delta_r, delta_s * normal[2], image_pos[2]],
           [0, 0, 0, 1]])