Shift+drag = freehand for ROI selection

I want to annotate the images to create a semantic segmentation dataset on an IPad. I have set up my server. I dont want to press and hold “Shift” on my ipad to annotate using a freehand drawing. Could you give an alternative idea here. Or, modifying the source code is the only way?

Also, I would like to add additional channels other than RGB to my whole slide images. I am not able to do this. Could you help out here with some relevant documentation. I searched a lot and could not find it.

1 Like

Hi @vigi04

I assume that you are using OMERO.iviewer to view your images and draw ROI.
To create ROI on an IPad, you will have to

  • open the image
  • select the ROI tab
  • select the shape you want to draw e.g. polyline
  • using one finger, tap on the screen where you want a point of the polyline to be. This is in a way similar to what you will do with a mouse click. Modifying the code will be required to offer another behaviour

By adding additional channels, do you mean changing the channel names? This is possible either via the UI or via scripting whatever is more suitable for you


Thank you for your reply.
I understand that I can use ROI feature using mouse-clicks. I would like to “click and drag”, as in the “Shift + Mouseclick” feature. If possible, could you point out where I would need to modify for this behaviour.

By adding additional channels, I mean adding additional channels other than RGB for a whole slide image. I would like to add channels for each ROI class. They serve as masks. For example, consider a whole slide image with a pathological slide.
I would like the “nucleus” to be on one channel, the “cell boundary” to be on another channel, etc.


I figured the answer for the first part of the question (“shift+Mouseclick” trick on ipad). I had to modify the arguments for the function “DrawWithPopup” in the file “omero-viewer/src/viewers/viewer/interaction/draw.js”. An additional argument “freehand: true,” was to be added along with the others.

Prev line:
this.ol_draw_ = new DrawWithPopup({
style: this.default_style_function_,
type: ol_shape,
condition: function(e) {
// ignore right clicks (from context)
return noModifierKeys(e) && primaryAction(e); },
freehand: true, // NEWLY ADDED LINE
typeof(geometryFunction) === ‘function’ ?
geometryFunction : null

Then, after compiling the project and installing it with omero-web, i could get the required functionality to avoid the “shift” . For more info, look at “” and “


great thanks for digging that. We can certainly add that option to the code.
Wrt to your ROI question, you can save the shape as masks and link the mask to a given channel.
Adding new channel will mean creating a new image in OMERO


Thanks. That would be great.
Regarding the ROI question, how would we need to differentiate two ROIs with different labels. Do we use the comment feature (not so friendly since i would need to enter the comment for every ROI)? or is there a simpler approach to automatically add a label for a particular ROI. Or is there another way to save the label?


You can modify ROI/shape programatically: add comment, change color for example, whatever you want to use to distinguish them could be adjusted via a script

Note that if your masks are very large, the current implementation will not work gracefully.


Thank you. Will try it out.