use contour to define region of interest

Hi All,


I would like to make isolines of an intensity 2D map using contour, and define ROI between two contour lines. anybody has succeed on this?

THX.

rainbowincloud
Here are some suggestions to get you started. First, in your procedure file include the WaveMetrics utility ipf
#include <Extract Contours As Waves>

At the bottom of the 'Graph' menu, using the above function's GUI, extract an (x,y) pair of waves for each contour you want.

Then use the operation 'ImageBoundaryToMask' to create a 2D ROI wave with a contour's x,y wave pair. See that operation's help file for details of its usage.

Normally, such ROIs don't have holes in them, so you ought to be able to create two separate ROIs, and subtract one from the other to get the "doughnut" shape you want.
Hey chinn,

Thank you very much. I will try this way.

s.r.chinn wrote:
Here are some suggestions to get you started. First, in your procedure file include the WaveMetrics utility ipf
#include <Extract Contours As Waves>

At the bottom of the 'Graph' menu, using the above function's GUI, extract an (x,y) pair of waves for each contour you want.

Then use the operation 'ImageBoundaryToMask' to create a 2D ROI wave with a contour's x,y wave pair. See that operation's help file for details of its usage.

Normally, such ROIs don't have holes in them, so you ought to be able to create two separate ROIs, and subtract one from the other to get the "doughnut" shape you want.

Here is another interesting alternative that I just tested to generate an inter-contour ROI. I assume that you start with an image graph having your added contours.
#include <FillBetweenContours>

and use the added Graph menu item "Fill Between Contours..." with any convenient colorscale. Use the "Flat" option for Colors Between Contours. This overlays a color image that you can later remove. In my case, this color image wave was named "fillImgwave0Graph0". The next commands (with my added comments) were:
Display;AppendImage fillImgwave0Graph0 // show the color values in new graph
ShowInfo  //  to let you see the cursor (color wave amplitude) in your desired region
make/O/N=(1,1) wval =0.6  // create a 1x1 wave with your desired value ( here, 0.6)
MatrixOP/O wROI = equal(wval, fillImgwave0Graph0)  // new wave: 1 in the ROI, 0 outside.
Display;AppendImage wROI  // show the ROI image

Warnings:
(1) The ROI mask is floating point. Some uses may require converion to byte-type output using the Redimension operation.
(2) A "nice" appearance of the filled contour interval may call for over-sampling in the ROI wave. Processing of the original image must take this into account. It is probably best to use an interpolation value of 1 to match the original data.

With extra effort most of the above could be converted into a function.