Author Topic: Polygon Extraction and/or Pixel Filtering  (Read 11466 times)

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Polygon Extraction and/or Pixel Filtering
« Reply #15 on: December 11, 2018, 08:27:31 AM »
Hi John,

Thanks for fixing it, it all works well now.

I don't know if it be difficult but my ideal structure for the export file of averages - is shown below - where you export all the wt. % data together, and all the errors together so that its ready for plotting. You might want to flip rows and columns

Hi Ben,
OK, but I'm not sure I see how this makes it more "ready for plotting".   I may also just add some graphics to this feature as well.
john
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Polygon Extraction and/or Pixel Filtering
« Reply #16 on: December 14, 2018, 09:07:11 AM »
We added code to output the stage positions and relative distance for line profile extractions as seen here:



Here is another plot. Note that one can export the plot data to a file using the Export Data button.



If one looks at the average total (magenta circles), one can see that each pixel has low precision, but the average is quite accurate!

Please update using the Help menu in Probe for EPMA as usual.
« Last Edit: December 14, 2018, 09:08:54 AM by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Ben Buse

  • Professor
  • ****
  • Posts: 498
Re: Polygon Extraction and/or Pixel Filtering
« Reply #17 on: December 17, 2018, 03:04:02 AM »
Hi John,

I like the graphs you've added in - they are great!

I notice that you don't plot the average of the 10x10 (or whatever) pixel spot but plot each extracted pixel. This gives the large scatter. I think it would be good if you could plot the average value for each extracted spot instead or as an alternative.

The graphs are also good because I can export the data from the plot for plotting in Excel.

Thanks

Ben
« Last Edit: December 18, 2018, 08:22:52 AM by John Donovan »

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Polygon Extraction and/or Pixel Filtering
« Reply #18 on: December 20, 2018, 09:56:19 AM »
Hi John,

Thanks for fixing it, it all works well now.

I don't know if it be difficult but my ideal structure for the export file of averages - is shown below - where you export all the wt. % data together, and all the errors together so that its ready for plotting. You might want to flip rows and columns



Ben

So you would prefer the averages separate from the variances? Or would it be better to have the average and variance for each element in adjacent columns?

Come to think of it, I agree with you, I think it would it be better to have the elements as columns and the profiles listed as rows, right?

How do others feel about this format?    We're thinking about working on this average plot output over the weekend.
« Last Edit: December 20, 2018, 06:58:56 PM by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Polygon Extraction and/or Pixel Filtering
« Reply #19 on: December 21, 2018, 11:42:20 AM »
Hi Ben,
We think we have what you want for extraction of line profile averages from quantitative x-ray maps. 

Basically the plot line profile pixel code now checks the "Averages Only" checkbox, and if it is checked, the plot only displays the averages and variances as error bars in the line profile as seen here:



If the checkbox is unchecked you will get all the pixels plotted as before.  Also we modified the Export Data button code to export the averages and variances to a tab delimited ASCII file as seen here when imported into Excel:



We hope you will find this feature useful.
john
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Polygon Extraction and/or Pixel Filtering
« Reply #20 on: December 27, 2018, 06:23:43 PM »
We've released a new pixel extraction plotting feature in v. 12.5.6 of Probe for EPMA in the CalcImage image quantification and analysis application.

This is just an initial effort at this new feature, but we think it could be useful for quantitative image analysis. To utilize this feature simply check one of these two checkboxes for either the shape extraction or polygon extraction methods:



Because the polygon extraction method defaults to the entire image area, simply clicking the Perform Extraction/Filtering button will output the quantitative average and/or pixel results to the text windows or files. And if the Plot Polygon Histogram checkbox is checked, the application will also display a quantitative histogram, or as Ed Vicenzi suggests, a "Quantigram" plot.   We like it. 

Here is a quantigram of a full quantitative x-ray map of an Fe-Mo-Cr alloy diffusion zone:



And here is a quantigram of a polygon area in this x-ray map:



Finally, here is an example from a multiphase material showing the quantitative distribution of pixels:



Please update your Probe for EPMA and try out this latest pixel extraction plot feature in Calcimage and let us know what you think.
« Last Edit: December 28, 2018, 09:05:10 AM by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Ben Buse

  • Professor
  • ****
  • Posts: 498
Re: Polygon Extraction and/or Pixel Filtering
« Reply #21 on: January 07, 2019, 06:06:22 AM »
Hi Ben,
We think we have what you want for extraction of line profile averages from quantitative x-ray maps. 

Basically the plot line profile pixel code now checks the "Averages Only" checkbox, and if it is checked, the plot only displays the averages and variances as error bars in the line profile as seen here:



If the checkbox is unchecked you will get all the pixels plotted as before.  Also we modified the Export Data button code to export the averages and variances to a tab delimited ASCII file as seen here when imported into Excel:



We hope you will find this feature useful.
john

Thanks John, this is very good. Is the variance - the maximum variance in the pixels? Could we have standard deviation?

Thanks

Ben

Ben Buse

  • Professor
  • ****
  • Posts: 498
Re: Polygon Extraction and/or Pixel Filtering
« Reply #22 on: January 07, 2019, 06:11:46 AM »
We've released a new pixel extraction plotting feature in v. 12.5.6 of Probe for EPMA in the CalcImage image quantification and analysis application.

This is just an initial effort at this new feature, but we think it could be useful for quantitative image analysis. To utilize this feature simply check one of these two checkboxes for either the shape extraction or polygon extraction methods:

Finally, here is an example from a multiphase material showing the quantitative distribution of pixels:



Please update your Probe for EPMA and try out this latest pixel extraction plot feature in Calcimage and let us know what you think.

This looks interesting, might be more useful to show a single element per graph, otherwise a bit confusing.

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Polygon Extraction and/or Pixel Filtering
« Reply #23 on: January 07, 2019, 08:20:41 AM »
Hi Ben,
Yeah, at this point this is a completely new feature, so please play with it and see if you think it's useful for quant analysis.

I think it might possibly be useful for multi-phase x-ray maps, but you tell me.
john
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Polygon Extraction and/or Pixel Filtering
« Reply #24 on: January 07, 2019, 08:24:05 AM »
Hi Ben,
We think we have what you want for extraction of line profile averages from quantitative x-ray maps. 

Basically the plot line profile pixel code now checks the "Averages Only" checkbox, and if it is checked, the plot only displays the averages and variances as error bars in the line profile as seen here:



If the checkbox is unchecked you will get all the pixels plotted as before.  Also we modified the Export Data button code to export the averages and variances to a tab delimited ASCII file as seen here when imported into Excel:



We hope you will find this feature useful.
john

Thanks John, this is very good. Is the variance - the maximum variance in the pixels? Could we have standard deviation?

Thanks

Ben

Hi Ben,
The plotted +/- error bars are one standard deviation, the same as the +/- values printed to the text window.  The exported tab delimited data are also one standard deviation.

So, yes.
john
« Last Edit: January 07, 2019, 02:10:18 PM by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Ben Buse

  • Professor
  • ****
  • Posts: 498
Re: Polygon Extraction and/or Pixel Filtering
« Reply #25 on: January 09, 2019, 07:20:21 AM »


Hi Ben,
The plotted +/- error bars are one standard deviation, the same as the +/- values printed to the text window.  The exported tab delimited data are also one standard deviation.

So, yes.
john

Thanks for clarifying that. This will be a very useful feature - particularly for users who don't like imagej - plus its easier!

Ben
« Last Edit: January 09, 2019, 08:01:57 AM by Ben Buse »

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Polygon Extraction and/or Pixel Filtering
« Reply #26 on: January 09, 2019, 11:42:40 AM »


Hi Ben,
The plotted +/- error bars are one standard deviation, the same as the +/- values printed to the text window.  The exported tab delimited data are also one standard deviation.

So, yes.
john

Thanks for clarifying that. This will be a very useful feature - particularly for users who don't like imagej - plus its easier!

Ben

I like easy!    But some might ask if we are making it *too* easy.   :)
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Ben Buse

  • Professor
  • ****
  • Posts: 498
Re: Polygon Extraction and/or Pixel Filtering
« Reply #27 on: January 10, 2019, 01:08:56 AM »
Hi,

Here's a puzzle, why is standard deviation not a suitable measure of the error when averaging pixels?

Here's two line profiles extracted using calcimage line profile - for P in olivine. The error bars (which are standard deviation of 100 pixels - correctly calculated) are too large for the actual error - this can be seen by comparing the 'traverse' profile and 'along' profile. In the 'along' profile the error is seen to be very small - as given by the variation in average along the homogeneous zone and yet the error bars are large.

I wonder if its because the counts per pixel are very small? Would calculating the error (using the error formula) for the sum of the counts be more realistic?

Here's a way of conceptualizing the issue. Again along the homogeneous zone. I extract boxes of 10x10, 7x7 and 5x5 (without moving the positions). The std dev is the same for each, but the error on the analysis improves as the box size increases (assuming the composition within the box is homogeneous). This can be seen in the straighter line with less noise (points deviating away from the straight line)



Ben
« Last Edit: January 14, 2019, 04:29:26 AM by Ben Buse »

Ben Buse

  • Professor
  • ****
  • Posts: 498
Re: Polygon Extraction and/or Pixel Filtering
« Reply #28 on: January 10, 2019, 02:30:05 AM »
I've just done a quick approximate calculation



Extracting boxes of ca. 40 pixels using imagej, along the homogeneous band - shown above. Extract average and standard deviation for (1) raw counts and (2) quantified weight %). Then using the raw counts subtract the background which is constant (trace element variation in homogeneous olivine). Then using square root of total counts (avg counts*no. of pixels) to calculate the statistical error.

It can be seen that the statistic error based on the number of counts is the right order of magnitude (ca 1%). Whereas the standard deviation is much greater (ca. 20%). The average wt % data varies by 3.7%.



Can we calulate the improvement in std dev as the number of pixels increases. If we increase the number of pixels by 45x. An increase in counts by 45x should reduce the error by 0.149 (sqrt of cts), thus 20% multiplied by 0.149 gives 2.98.

If we apply this to the data in the previous post



 - it seems to work (not sure if its mathematically sound). This is actually the standard error (as John points out in later post) https://probesoftware.com/smf/index.php?topic=1144.msg7973#msg7973. Standard error is given by:



https://en.wikipedia.org/wiki/Standard_error



Ben
« Last Edit: January 14, 2019, 04:44:00 AM by Ben Buse »

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Polygon Extraction and/or Pixel Filtering
« Reply #29 on: January 10, 2019, 10:06:32 AM »
Hi Ben,
Interesting stuff.

But your first question has me confused.  What do you mean by "long concentrations"?  For example, when you say: "why is standard deviation not a suitable measure of the error at long concentrations?".

I'm guessing that you are trying to see the difference between the actual variance of the concentrations (what CalcImage is reporting as the error), and the actual counting statistics those concentrations are based on?
john
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"