Cursors

By default, cursors are disabled. To enable them, set the `showSVGCursors` option to `true` when initializing `cornerstoneTools`.

cornerstoneTools.init({
  showSVGCursors: true,
});

Access Cursor Images

// Grab a cursor
const cursors = cornerstoneTools.import('tools/cursors');
const cursor = cursors.arrowAnnotateCursor; // `MouseCursor` class

// Create and display cursor image
const cursorImg = document.createElement('img');
const cursorImgUrl = window.URL.createObjectURL(cursor.iconSVG);

cursorImg.src = cursorImgUrl;
document.querySelector('body').appendChild(cursorImg);

// Create and display cursor image w/ pointer
const cursorImgPointer = document.createElement('img');
const cursorImgPointerUrl = window.URL.createObjectURL(cursor.blob);

cursorImgPointer.src = cursorImgPointerUrl;
document.querySelector('body').appendChild(cursorImgPointer);

Cursors w/o Pointers

Cursors w/ Pointers