T O P I C R E V I E W |
carsten |
Posted - 02/15/2011 : 08:26:13 AM Origin Ver.8 and Service Release 5 (Select Help-->About Origin): Operating System: XP
Is it possible to evaluate the size distribution of areas of a mosaic image which consist of irregular curved areas (e.g. blue) with surrounded by white lines? The result should be displayed as a histogram of different area sizes vs counts (for a given bin).
If yes how can I do this?
Thanks in advance
|
1 L A T E S T R E P L I E S (Newest First) |
greg |
Posted - 02/16/2011 : 3:28:36 PM There are some additions in 8.1 and 8.5 that make this type of analysis possible. Specifically, contour plots in 8.1 added a context menu to extract contour lines as data, and 8.5 added a polyarea function.
So to do this in 8.5 ... (1) Import the image. (2) Use the Image : Conversion : Threshold function to clean up the image a bit(an Upper Bound of 160 seemed to work well). (3) Plot the image as a Color Contour. (4) Set the color Levels to 1 and adjust the Z value to get a clean separation of image and background (4.2E4 seemed to work well). (5) Right-click on the plot and choose Extract Contours.
The first two columns are just the boundary of the contour plot while the next two columns contains the contour data which will be separated by missing values for each contour set which in this case means each 'blob' in the image.
The above can be done in 8.1. The rest requires 8.5:
(6) Run this script // BEGIN SCRIPT double MyArea; int iStart = 1; int iRow = 1; wks.Addcol(Area); range ra = col(4); loop(idx,1,ra.GetSize()) { if(ra[idx] == 0/0) { iEnd = idx - 1; polyarea iy:=(3,4)[iStart:iEnd] type:=1 area:=MyArea; col(Area)[iRow] = MyArea; iStart = idx + 1; iRow++; } } range raO = col(Area); ty $(rao.GetSize()) objects found with total area $(total(raO)); // END SCRIPT (7) Plot a Histogram of the Area column
|
|
|