Commit 97e8c85a authored by David Frank's avatar David Frank
Browse files

Replace if over dimension with eigen block operation

parent 7b977fbd
Pipeline #652472 passed with stages
in 23 minutes and 53 seconds
...@@ -40,13 +40,12 @@ namespace elsa ...@@ -40,13 +40,12 @@ namespace elsa
const auto spacingPerDim = volumeDescriptor.getSpacingPerDimension(); const auto spacingPerDim = volumeDescriptor.getSpacingPerDimension();
if (dim == 2) { coeffs.head(dim - 1) = coeffsPerDimSclaed.head(dim - 1);
coeffs << coeffsPerDimSclaed[0], numberOfPoses; coeffs[dim - 1] = numberOfPoses; // TODO: with eigen 3.4: `coeffs(Eigen::last) = 1`
spacing << spacingPerDim[0], 1;
} else { spacing.head(dim - 1) = spacingPerDim.head(dim - 1);
coeffs << coeffsPerDimSclaed[0], coeffsPerDimSclaed[1], numberOfPoses; spacing[dim - 1] = 1; // TODO: same as coeffs
spacing << spacingPerDim[0], spacingPerDim[1], 1;
}
// Return a pair, then split it using structured bindings // Return a pair, then split it using structured bindings
return std::pair{coeffs, spacing}; return std::pair{coeffs, spacing};
}(); }();
......
Supports Markdown
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