News:

:) To protect your privacy, you must first log in before you can view forum statistics and user profiles

Main Menu

New Remote Server functions for imaging

Started by John Donovan, June 11, 2016, 08:39:30 AM

Previous topic - Next topic

John Donovan

The Remote Server app allows one to write their own scripts or macros for custom EPMA application development. Scripts can be written for any OLE (Active-X) container such as Excel, MatLab, LabView, etc.  See here for more information:

http://smf.probesoftware.com/index.php?topic=88.msg315#msg315

I have recently added several new functions to enable custom imaging app development as listed here:

Public Property Get RemoteInterfaceType() As Integer
Public Property Get RemoteImageInterfaceType() As Integer
Public Property Get RemoteJEOLEOSInterfaceType() As Long
Public Property Get RemoteImageInterfaceImageIxIy() As Single

Public Sub RemoteImageGetBeamMode(beammode As Integer)
Public Sub RemoteImageSetBeamMode(beammode As Integer)
Public Sub RemoteImageBeamDeflection2(xoffset As Single, yoffset As Single)
Public Sub RemoteImageGetImageShift(ix As Single, iy As Single)
Public Sub RemoteImageSetImageShift(ix As Single, iy As Single)
Public Sub RemoteSetReflectedLight(lightonoff As Integer, lightintensity As Integer)
Public Sub RemoteSetTransmittedLight(lightonoff As Integer, lightintensity As Integer)

See the Remote Server documentation for more details.
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

#1
As an aid to developing your own custom imaging applications using the Probe for EPMA Remote Server interface, I have attached below a zip file with a very simple but powerful example of a Remote Server imaging application (remember to login to see attachments). This application and the Remote interface are of course free to all PFE customers. Please let us know if you have any questions on using this for your own custom applications.

To demonstrate how simple it is to develop a custom imaging application for your EPMA instrument, see the "get image" routine code inserted below which was written in VB6.  The complete VB6 project is in the attached zip file.


Sub TestRemoteImageGet()
' Get analog signal image

ierror = False
On Error GoTo TestRemoteImageGetError

' Send the image channel
Remote.RemoteImageSetImageMode ImageChannel%

Dim done%                               ' returned, true (-1) if image complete
Dim ntype As Integer                    ' passed (1 = analog signal, 2 = x-ray)

Dim sxmin As Single, symin As Single    ' returned (stage coordinates of corners)
Dim sxmax As Single, symax As Single  ' returned (stage ccordinates of corners)
Dim zmin As Long, zmax As Long          ' returned (intensity min/max)

ReDim iarray(1 To ImageIx%, 1 To ImageIy%) As Byte  ' returned (0-255 normalized intensity data)
ReDim darray(1 To ImageIx%, 1 To ImageIy%) As Long  ' returned (raw intensity data)

' Set beam mode to analog or digital spot (comment out other line)
'Remote.RemoteImageSetBeamMode 1                           ' set to analog scan mode for SX100 mapping or SX100 video or Bruker or Thermo imaging
Remote.RemoteImageSetBeamMode 2                           ' set to digital spot mode for JEOL 8200/8900/8500

' Remove faraday cup
Remote.RemoteFaraday 2

' Start the acquisition
Remote.RemoteImageStart

' Call image get in a loop until complete
Do Until done
Remote.RemoteImageGet done%, ntype%, ImageChannel%, AnalogAverages%, ImageIx%, ImageIy%, sxmin!, symin!, sxmax!, symax!, iarray(), darray&(), zmin&, zmax&

Sleep 100
DoEvents
If ierror Then Exit Do
Loop

' Convert long values to byte array
ReDim barray(1 To ImageIx%, 1 To ImageIy%) As Byte
Screen.MousePointer = vbHourglass
Call BMPConvertLongArrayToByteArray(ImageIx%, ImageIy%, darray&(), barray())
Screen.MousePointer = vbDefault
If ierror Then Exit Sub

' Display intensity data
Call TestRemoteImagingConvertImage(ImageIx%, ImageIy%, barray(), FormMAIN)
If ierror Then Exit Sub

msg$ = "Sxmin=" & Format$(sxmin!) & ", Sxmax=" & Format$(sxmax!) & vbCrLf
msg$ = msg$ & "Symin=" & Format$(symin!) & ", Symax=" & Format$(symax!)
FormMAIN.TextLog.Text = msg$

' Insert faraday cup
Remote.RemoteFaraday 1

' Set beam mode to analog scan mode
'Remote.RemoteImageSetBeamMode 1                           ' set to analog scan mode for SX100 mapping or SX100 video or Bruker or Thermo imaging

Exit Sub

' Errors
TestRemoteImageGetError:
MsgBox Error$, vbOKOnly + vbCritical, "TestRemoteImageGet"
ierror = True
Exit Sub

End Sub


Note that your custom code can be developed in any application development environment which supports the active-X interface. This also includes Excel, Matlab, LabView and many other environments that support OLE containers.
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Dan R

#2
Hi John-
So these commands would work regardless of the ImageInterfaceType-- e.g., no EDS, JEOL EDS, Thermo EDS, Bruker EDS?

e.g.,
[Image]
ImageInterfacePresent=1
ImageInterfaceType=7         ;JEOL video

or
ImageInterfacePresent=1
ImageInterfaceType=4   

in the probewin.ini file

John Donovan

#3
Quote from: Dan R on August 26, 2024, 12:35:58 PM
Hi John-
So these commands would work regardless of the ImageInterfaceType-- e.g., no EDS, JEOL EDS, Thermo EDS, Bruker EDS?

e.g.,
[Image]
ImageInterfacePresent=1
ImageInterfaceType=7         ;JEOL video

or
ImageInterfacePresent=1
ImageInterfaceType=4   

in the probewin.ini file

Almost.

ImageInterfaceType=4 will work on any JEOL instrument with (or without) any EDS interface because it calls the JEOL WDS mapping interface directly. The minimum pixel dwell time for the WDS scan generator is 100 microsec, so a large images takes a minute or so.

ImageInterfaceType=7 only works with the JEOL 8230/8530 EDS but it can acquire down to a 1 microsec pixel dwell time so it's a little faster.
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"