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

John Donovan

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

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2669
  • Other duties as assigned...
    • Probe Software
Re: New Features in CalcImage
« Reply #49 on: February 21, 2021, 03:13:01 PM »
Andrew Locock recently asked if we could have a field created in the PrbImg files (which are the mapping intensity files created by Probe Image during map acquisition), that specifies the image stage extents for the map.

Note that the PrbImg file already contains all the information but the user would need to perform a subtraction of the following fields:

[Registration]
X1Pixel=319
Y1Pixel=164
X2Pixel=0
Y2Pixel=0
X3Pixel=319
Y3Pixel=0
X1Real=-35.2848
Y1Real=-33.312
Z1Real=9.6945
X2Real=-35.0304
Y2Real=-33.4432
Z2Real=9.6945
Z3Real=9.6945

In the meantime it is worth noting that the stage extents of the map (stage scan or beam scan) can be obtained also by simply opening the PrbImg (click on the corresponding Tif file), from the Probe Image File | Open menu. Once the PrbImg file is opened, simply click on the Conditions tab to see the following information, including the horizontal and vertical field widths:



In addition, one can also simply open the PrbImg file in CalcImage, and by "hovering" the mouse cursor over the image, the following information will pop up:



Note however that the field width and height are displayed in stage units. In this case the stage units are in mms since the software is in a JEOL configuration.

Finally we recently added a new feature that displays additional stage extents information in the CalcImage Project | Specify Quantitative Parameters menu dialog as seen here:



Remember, anyone (faculty, student, client or customer) that uses our software on your microprobe can receive a free copy of the software for reprocessing of point or map data.  You can get the latest distribution files by updating both CalcZAF and Probe for EPMA from their respective Help menus. Then simply go to the C:\ProgramData\Probe Software\Probe for EPMA folder and grab these two files:

ProbeForEPMA.msi
CalcZAF.msi

Installing these two packages will allow anyone to reprocess their point or map data on any Windows computer (and Apple computers using the Parallels virtual Windows product).  Of course they will also need their data files, which for Probe for EPMA are the .MDB files (and .BIM files if present).

For CalcImage they will need the PrbImg map files.  However, if the PrbImg map files have already been added to a CalcImage project, they will only need the files in the UserData folder, since the PrbImg files are converted to .GRD files during that process.

Please let us know if you have any questions about this.
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2669
  • Other duties as assigned...
    • Probe Software
Re: New Features in CalcImage
« Reply #50 on: February 22, 2021, 06:08:21 PM »
Finally we recently added a new feature that displays additional stage extents information in the CalcImage Project | Specify Quantitative Parameters menu dialog as seen here:



Remember, anyone (faculty, student, client or customer) that uses our software on your microprobe can receive a free copy of the software for reprocessing of point or map data.  You can get the latest distribution files by updating both CalcZAF and Probe for EPMA from their respective Help menus. Then simply go to the C:\ProgramData\Probe Software\Probe for EPMA folder and grab these two files:

ProbeForEPMA.msi
CalcZAF.msi

Installing these two packages will allow anyone to reprocess their point or map data on any Windows computer (and Apple computers using the Parallels virtual Windows product).  Of course they will also need their data files, which for Probe for EPMA are the .MDB files (and .BIM files if present).

For CalcImage they will need the PrbImg map files.  However, if the PrbImg map files have already been added to a CalcImage project, they will only need the files in the UserData folder, since the PrbImg files are converted to .GRD files during that process.

Please let us know if you have any questions about this.

Just a quick note that we noticed that this stage extents display feature in CalcImage was not working properly when creating a new project (as opposed to opening an existing project), so we just uploaded a new PFE update today to fix that.  Update from the Probe for EPMA Help menu and you will get this latest update.
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"