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

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2443
  • 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: 2443
  • 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"