use contour to define region of interest
rainbowincloud
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
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.
March 21, 2013 at 08:51 am - Permalink
Thank you very much. I will try this way.
March 21, 2013 at 02:27 pm - Permalink
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:
•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.
March 27, 2013 at 09:22 am - Permalink