Author Topic: New Features in CalcImage  (Read 34129 times)

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2632
  • Other duties as assigned...
    • Probe Software
Re: New Features in CalcImage
« Reply #45 on: June 06, 2019, 08:50:18 am »
Back in January starting with the release of Surfer v16 from Golden Software, we had to modify where the x-ray mapping output scripts looked for the default "rainbow.clr" file that is distributed with Surfer.  Every few years it seems they change the location of this file!   >:(

After this last change we edited the various default output scripts to use the following code:

' Load color spectrum depending on version number
If Val(Left$(SurferApp.Version, 2)) <= Val("8.") Then
   SurferColorMap.LoadFile(SurferApp.Path & "\Samples\Rainbow2.clr")
ElseIf Val(Left$(SurferApp.Version, 2)) <= Val("15.") Then
       SurferColorMap.LoadFile(SurferApp.Path & "\ColorScales\Rainbow2.clr")
Else
   SurferColorMap.LoadFile(SurferApp.Path & "\Samples\Rainbow.clr")
End If

Unfortunately when we edited the default slice, polygon and strip output scripts to deal with the new location of the rainbow.clr file in Surfer v.16, we did not notice that the color map object was named differently from the default x-ray map output script.  So these slice, polygon and strip output scripts have now been re-edited and are available in the current 12.6.3 version of Probe for EPMA.  Just update from the Help menu.

However, the "customizable" scripts provided in Probe for EPMA are not automatically updated because that would overwrite any user customizations. If you haven't edited the custom scripts you can simply grab the latest custom scripts zip file (in case you'd like to start customizing them yourself), in the zip file attached to this post:

http://probesoftware.com/smf/index.php?topic=41.msg6488#msg6488

If you have modified your custom scripts for the slice, polygon or strip output, you'll need to edit the color map object in these scripts yourself. The point is simply that the color map object needs to match the object name it is declared with.  So in the default x-ray map output scripts the object is declared like this and utilized to load the rainbow color map as seen here:

' Assigns the color spectrum properties to the variable named
Set SurferColorMap = SurferImageMap.ColorMap

' Set color scale significant digits
SurferImageMap.ColorScale.LabelFormat.NumDigits = 3
SurferImageMap.ColorScale.LabelFormat.Type = 3      ' 1 = Fixed, 2 = Exponential, 3 = Compact

Debug.Print "Surfer Version Number " & SurferApp.Version

' Load color spectrum depending on version number
If Val(Left$(SurferApp.Version, 2)) <= Val("8.") Then
   SurferColorMap.LoadFile(SurferApp.Path & "\Samples\Rainbow2.clr")
ElseIf Val(Left$(SurferApp.Version, 2)) <= Val("15.") Then
       SurferColorMap.LoadFile(SurferApp.Path & "\ColorScales\Rainbow2.clr")
Else
   SurferColorMap.LoadFile(SurferApp.Path & "\Samples\Rainbow.clr")
End If

Note color map object name highlighted in red. What we didn't notice was that the object name in the slice, polygon and strip scripts was named ColorImageMap instead of SurferColorMap!

So the correct code in your custom slice, polygon and strip output scripts should be edited like this:

      'Assigns the color spectrum properties to the variable named
         Set ColorImageMap = ImageMap.ColorMap
      'Set color scale significant digits
         ImageMap.ColorScale.LabelFormat.NumDigits = 1
         ImageMap.ColorScale.LabelFormat.Type = 1      ' 1 = Fixed, 2 = Exponential, 3 = Compact
      'Format text in color scale
         ImageMap.ColorScale.LabelFont.Size = 14

      ' Load color spectrum depending on version number
      If Val(Left$(SurferApp.Version, 2)) <= Val("8.") Then
         ColorImageMap.LoadFile(SurferApp.Path & "\Samples\Rainbow2.clr")
      ElseIf Val(Left$(SurferApp.Version, 2)) <= Val("15.") Then
             ColorImageMap.LoadFile(SurferApp.Path & "\ColorScales\Rainbow2.clr")
      Else
         ColorImageMap.LoadFile(SurferApp.Path & "\Samples\Rainbow.clr")
      End If

Again, if you haven't edited the custom scripts for the slice, polygon or strip output methods in CalcImage, you don't need to do anything except update Probe for EPMA.

If you want the latest custom scripts and you haven't edited them yourself, you can download the attached ZIP file in the linked post above.

If you have customized these slice, polygon or strip scripts you'll need to manually make the changes above to your custom scripts as described above.

I'm sure I did not explain this very well, so if you have any questions at all, just let us know.  Of course I think most users, especially students are simply utilizing the built in output in CalcImage for slice and polygon extractions of quantitative maps as described here:

https://probesoftware.com/smf/index.php?topic=1151.0

Quick note: if the in-line images in any posts don't show up as expected, just click your refresh button on your browser and they should show up properly.
« Last Edit: June 06, 2019, 08:58:52 am by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2632
  • Other duties as assigned...
    • Probe Software
Re: New Features in CalcImage
« Reply #46 on: June 30, 2019, 02:43:41 pm »
This isn't really a new feature, but we changed the default error bar display mode from standard deviation to standard error, in the extract shape, profile and polygon pixels window as seen here:



When averaging pixels it is more important to accurately reflect the error on the average, as opposed to the average variation of each pixel! Think of it this way: in the above example we specified a 10 pixel wide square, so that's 100 pixels averaged together. If counting only 100 msec for each pixel, that still 10 seconds of total integration time for the average, which is fairly similar to what we utilize for point analyses!

 8)
« Last Edit: June 30, 2019, 06:37:42 pm by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2632
  • Other duties as assigned...
    • Probe Software
Re: New Features in CalcImage
« Reply #47 on: March 07, 2020, 09:12:11 am »
Julien Allaz recently suggested that when a user selects the Output Sample Parameters menu to check that all the quantitative mapping options are properly set as seen here:



That rather than analyzing the *first* pixel, that we instead analyze the "middle" pixel. The idea being that in the mapped area, the first pixel might not be within the actual material of interest. But the middle pixel probably will.

So now, the Output Sample Parameters menu will calculate the middle pixel as seen below, with one small twist: what if the middle pixel is for whatever reason (e.g., a very complex polygon acquisition), is outside the mapped area and is therefore "blanked"?  Some polygon quant maps by Karsten Goemann are shown here (note the blanked pixels outside the acquisition area):

https://probesoftware.com/smf/index.php?topic=73.msg7840#msg7840

So then, after calculating the middle pixel, the program will also check that this pixel is not "blanked", and will loop towards the first pixel until it finds an unblanked pixel.

Anyway, here is an example of the middle pixel output from a quantitative x-ray map:

« Last Edit: March 07, 2020, 09:58:48 am by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2632
  • Other duties as assigned...
    • Probe Software
Re: New Features in CalcImage
« Reply #48 on: July 15, 2020, 01:09:25 pm »
This is a feature which has been around for a while but worth mentioning as it's not exactly obvious what is going on. Check out this image and notice the horizontal strip of gray pixels near the top of the image:



Now where is this gray color coming from? The Surfer color scale being utilized does not contain gray, so what does this indicate?

By viewing the same image in the CalcImage app and hovering the cursor over these pixels one can see they have values of "---"as seen here:



The "---" display means these pixels have no value. More specifically the values have been set to an arbitrary large number which is in fact the so called "blanking value" utilized by Golden Software's Surfer app to indicate missing data.

The actual value is defined here in our code:

Global Const BLANKINGVALUE! = 1.70141E+38   ' Surfer blanking grid value

So why are these values missing? Well sometimes we have pits, crack and other topography on our samples and when the quantitative analytical solution will not converge to a solution, the software specifies the pixel value as blanked.

In the case of this horizontal strip of gray pixels on this sample, we can confirm that there is a deep crack in this area of the sample surface.
« Last Edit: July 15, 2020, 02:57:21 pm by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"