Karsten Goemann recently noticed that if one performs a slice script operation from CalcImage in the Surfer Scripter app, on a polygon (free shape) defined x-ray map acquisition, and the user digitizes slice points that lie outside the actual map acquisition region, the script will create Z values of -8888 or -9999 for those areas outside the map area.
This was because Julie Chouinard's original Surfer slice scripts had this line of code:
SurferApp.GridSlice(InGrid:=FileGridMap$,BlankFile:=FileBoundaryLine$,OutDataFile:=FileDataOutput$,
OutsideVal:=-8888, BlankVal:=-9999)
The -8888 value is returned if the position is outside the map extents, and it returns -9999 if the position is a blanked value. Which is basically the same thing for our purposes.
I think Julie was planning on utilizing these values as "special" values for some other operations, but in the meantime these negative values just caused problems if someone accidentally digitized slice points outside the actual map area. So I edited the line like this:
SurferApp.GridSlice(InGrid:=FileGridMap$,BlankFile:=FileBoundaryLine$,OutDataFile:=FileDataOutput$,
OutsideVal:=0, BlankVal:=0)
So now if one "slices" outside the actual mapped area, the script returns zero values rather than -9999 values, as seen here:
![](https://probesoftware.com/smf/gallery/1_01_12_18_9_36_44.jpeg)
So if you update to the latest Probe for EPMA v. 12.5.3, you will be updated for this new script code.
And finally, if you have customized slice scripts that you have edited for your own purposes, you will need to edit them yourself as I did above. However, if you haven't customized your "custom" scripts, you can just grab them below where I have attached them for download.
Remember, the installer will not overwrite custom scripts because it doesn't know if you edited them or not, so one needs to copy the attached scripts to the ProgramData folder manually if desired. Of course if you never utilize the customized slice scripts in CalcImage, it's a "don't care".