Hi there, I was hoping to implement something similar to the rigid rotation/translation optimization within fitmap due to its efficiency. I have some code which appears to implement the same logic as locate_maximum from your github, but is returning wildly different affine matrices than I expect. I just had a couple of questions regarding the logic: 1) locate_maximum receives an conversion matrix from world to voxel space (xyz to ijk) as one of its parameters from volume's matrix_and_transform function. I was wondering what this matrix actually is? I was tracing through the matrix_and_transform function and I couldn't really figure this out. I am currently assuming that the transform matrix is a 3 x 4 affine matrix: 1/v * (I | -O). Where v is the isotropic voxel size, I is a 3 x 3 identity matrix and O is a 3 x 1 vector representing the origin of the map. 2) Within each step of a segment, the following is done (from steps_to_maximum): ``` if step_types: for step in range(steps): calculate_step = step_types[step % len(step_types)] xyz_to_ijk_tf = xyz_to_ijk_transform * move_tf step_tf = calculate_step(points, point_weights, rotation_center, data_array, xyz_to_ijk_tf, ijk_step_size, metric, syminv = syminv, values = values, gradients = gradients) move_tf = move_tf * step_tf ``` In this loop, xyz_to_ijk_transform looks like the full conversion matrix from world to voxel space. But each iteration also multiplies it by move_tf before applying the step calculation, and then updates move_tf again with step_tf. At first glance, it seems like we’re reapplying the same full transform at every step... so why not just apply it once, instead of multiplying it repeatedly inside the loop? And then when we return to locate_maximum, move_tf is once again applied to the full conversion matrix. before continuing the iteration. I apologize if this is nitty gritty detail, but I would really like to make sure my logic is sound when I am implementing my version of this algorithm. Thank you for your time, Nikhil Rajan