WIP reorganization

This commit is contained in:
Erik Ziegler committed 2018-12-12 09:10:39 +01:00
1 parent 6706dfe634
commit 054e37dfb7
266 files changed
+98 -620

No files matched your search

@@ -0,0 +1,16 @@
export default function(handles, image={}) {
// Calculate the long axis length
const dx = (handles.start.x - handles.end.x) * (image.columnPixelSpacing || 1);
const dy = (handles.start.y - handles.end.y) * (image.rowPixelSpacing || 1);
const length = Math.sqrt(dx * dx + dy * dy) || 0;
// Calculate the short axis length
const wx = (handles.perpendicularStart.x - handles.perpendicularEnd.x) * (image.columnPixelSpacing || 1);
const wy = (handles.perpendicularStart.y - handles.perpendicularEnd.y) * (image.rowPixelSpacing || 1);
const width = Math.sqrt(wx * wx + wy * wy) || 0;
return {
longestDiameter: length.toFixed(1),
shortestDiameter: width.toFixed(1)
};
}