Strategy for User Input in ROI Creation

HI,

Working on an image analysis project to quantify the textures in am image (TEM image).  Making progress and the client is asking about refinements. The sample support membrane is visible and does interfere occasionally with the analysis, often times I can detect algorithmically and discard it, but not always.  The ask from the client is to allow a user to circle the region of the sample, in essence an ROI.

My rule of thumb with interfaces is "It needs to easy enough for manager to use." And in that vein, I was thinking of having a premade polygon with ~12 vertices that the user would drag to encircle the sample and click done.  The issue is that the endpoints of a polygon are not joined and if moved the polygon is open.  Workarounds?

 

Also are there other approaches I should consider?

Andy

if you draw a polygon as a wave (that can be edited using GraphWaveEdit) so that the last point sits above the first, you could use a dependency to ensure that the first point always moves with the last.

Would an oval or a rectangle shape cover most if not all cases in selecting the RoI? These (closed) shapes are simpler to manage than a (12 point) polygon.

Users can add points to a closed polygon shape while edit mode is active. Why not start with a (simpler) 4 point polygon (rectangle)? Alternatively, offer a freehand polygon with fewer points  (e.g. 6 not 12).

I wonder if the appearance of being open can be "fixed" by converting the drawing to a wave, adding one point to the wave that returns the line segment to the starting point, and then redrawing the shape using the new wave.

Hi,

The use case is to quantify TEM images and there will be a large number and with different users. I would like to minimize the variance introduced by different techniques and make it as fast as possible.  Each physical sample could have 20 TEM images. So the first question is how do approach the task from a user perspective with two basic options:

1. Modify an existing boundary with some handles and I started with ~12 as tradeoff of between a flexible boundary to handle irregular shapes and having to touch too many handles.

2. Have them draw a shape with a mouse to encircle the region of interest. The temptation might have them focus too much on this and spend outsized effort here.

At present I am leaning toward having a premade wave with a boundary and to use the edit wave function.

The texture analysis technique requires me to divide the image into sections and at present 64x64 pixel regions.  My initial idea is to create an ROI mask from the curve and then quantify the grid value of the ROI to decide to include or not.

Andy

Using a window hook function you can register mouse clicks on an image. You could do like almost any drawing program. First mouse click in the image creates the first corner of the polygon. Additional clicks creates further corners until the user clicks close enough to the first corner at which point the polygon completes.

If a simple left mouse click is too aggressive you could use a shift left click.

> At present I am leaning toward having a premade wave with a boundary and to use the edit wave function.

A drawn object can be reselected with the drawing tools more easily than a wave object. A drawn object can also be resized and rotated more easily than a wave object.

Hi Andy,

In general, I like the approach of @olelytken.  When I tried to implement it in the past I found that it was difficult for me to control the mouse to generate a nice & smooth boundary (your mileage may vary).  If I had to implement this I'd consider collecting the mouse coordinates from the hook function but passing the data to an algorithm similar to the one used in ImageSnake which can modify the path to a smoother representation.

AG