Press QWERTY to rotate 10 deg on x/y axis on each view
Press ASDFGH to increase MIP thickness 10 px on x/y axis on each view
+ shift to decrease rotation / thickness
Press any other key to reset
// =====================
// Define viewports ====
// =====================
const targetElements = {
top: {
element: document.getElementById("viewer-1"),
key: "top"
},
left: {
element: document.getElementById("viewer-2"),
key: "left"
},
front: {
element: document.getElementById("viewer-3"),
key: "front"
}
};
// =============================
// Build volume and load mpr ===
// =============================
/**
* Header must be in the form:
* {
* volume: {
* rows: number,
* cols: number.
* imageIds: [],
* imagePosition: [number, number, number],
* sliceThickness: number
* }
* }
*
* Data is a TypedArray
*/
// build vtk volume with larvitar
const image = diglettk.buildVtkVolume(header, data);
// run mpr
mpr = new diglettk.MPRManager(targetElements);
// get initial state obj
state = mpr.getInitialState();
console.log("state", state);
// set image
mpr.setImage(state, image);
// set active tool ("level" or "crosshair")
mpr.setTool("level", state);
// add keyoboard events to interact with mpr
addEvents(mpr, state);