1

I am using papaya to view a DICOM image. I want to highlight a specific region of the image when a user drags over a region.

I was trying to use Jcrop plugin, but it does not seem to work. Is there a fix in doing that? Or does the papaya viewer have a built in function to capture the drag event?

martinez314
  • 12,162
  • 5
  • 36
  • 63
chrisrhyno2003
  • 3,906
  • 8
  • 53
  • 102
  • Do you have some existing code that you can show? Otherwise it will be difficult to answer the first part of your question, where you're asking about a fix. – Drew Gaynor Oct 14 '15 at 19:27

1 Answers1

0

I'm guessing JCrop is designed to work with <img> not <canvas>, but maybe this will be helpful: Cropping image drawn into canvas with JCrop

In Papaya, take a look at these in viewer.js:

papaya.viewer.Viewer.prototype.mouseDownEvent
papaya.viewer.Viewer.prototype.mouseMoveEvent (see isDragging)
papaya.viewer.Viewer.prototype.mouseUpEvent

// these might be useful to set a command-key to enable your feature
papaya.viewer.Viewer.prototype.keyDownEvent
papaya.viewer.Viewer.prototype.keyUpEvent

Note, there are already several features that listen to mouse moving and dragging, so you'd have to work around those (maybe add a new command-key for your action) or disable the existing behavior.

Community
  • 1
  • 1
martinez314
  • 12,162
  • 5
  • 36
  • 63