Commit 1c32377a authored by Carsten Richter's avatar Carsten Richter

fixed calculation of center of mass in the presence of ROIs

parent d9c0fd18
Pipeline #6774 passed with stages
in 4 minutes and 33 seconds
......@@ -367,18 +367,18 @@ def _fit_process(index,
qspace_h5, axes, hits = _per_process_cache
# Load qspace
qspace = qspace_h5.qspace_slice(index)
# apply Qspace ROI
if roi_indices is not None:
dim0_slice = slice(roi_indices[0][0], roi_indices[0][1], 1)
dim1_slice = slice(roi_indices[1][0], roi_indices[1][1], 1)
dim2_slice = slice(roi_indices[2][0], roi_indices[2][1], 1)
axes = [axis[roi] for axis, roi in
zip(axes, (dim0_slice, dim1_slice, dim2_slice))]
hits = hits[dim0_slice, dim1_slice, dim2_slice]
qspace = qspace[dim0_slice, dim1_slice, dim2_slice]
qslice = numpy.s_[roi_indices[0][0]:roi_indices[0][1],
axes = [axis[roi] for axis, roi in zip(axes, qslice)]
qspace = qspace_h5.qspace_slice((index,) + qslice)
hits = hits[qslice]
qspace = qspace_h5.qspace_slice(index)
# Normalize with hits and project to axes
projections = project(qspace, hits)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment