mctOptics¶
Content¶
About¶
mctOptics is an EPICS IOC supporting the Optique Peter systen installed at beamline 2-BM of the Advanced Photon Source.

Instrument¶
Optique Peter¶
Triple Objective¶
At beamline 2-BM we use a Triple Objective Microscope produced by Optique Peter

Detailed information of the instruements are:
Lens |
Lens Mag |
motor position (specs) |
ref on lens 1 (specs) |
ref on lens 1 (aligned) |
0 |
10 x |
121.5942 |
59.6099 |
59.0151 |
1 |
5 x |
61.9841 |
0.0000 |
-0.3690 |
2 |
1.1 x |
2.3006 |
-59.6835 |
-59.6865 |
With FLIR Oryx ORX-10G-51S5M-C
Lens |
Lens Mag |
Pixel size (μm) (specs) |
Pixel size (μm) (meas.) |
Pixels (H) |
Pixels (V) |
Detector pixel size (μm) |
H filed of view (mm) |
V filed of view (mm) |
0 |
10 x |
0.35 |
0.350787 |
2448 |
2048 |
3.45 |
0.84 |
0.71 |
1 |
5 x |
0.69 |
0.699447 |
2448 |
2048 |
3.45 |
1.69 |
1.41 |
2 |
1.1 x |
3.14 |
3.125830 |
2448 |
2048 |
3.45 |
7.68 |
6.42 |
Scintillators:
Lens |
Lens Mag |
Scintillator material |
Scintillator thickness (μm) |
0 |
10 x |
LuAG |
25 |
1 |
5 x |
LuAG |
50 |
2 |
1.1 x |
LuAG |
100 |
Usage¶
Objective and camera change can be accomplished by simply selecting the desired magnification and the camera in the user interface selector of the main mctOptics control screen:

When changing lens/camera, mctOptics is also correcting for minor miss-alignment of the instrument visible light optics so that sample point of interest stays in the center of the image at each lens change. mctOptics also keeps the rotation axis aligned with the detector columns and each lens/camera change by rotating the camera.
This capability allows for step-zoom-in during a tomographic measurement and shown in this video
The required lens offset sample x, y, z and the lens offset camera rotation are very reproducible and can be determined once when the instrument is first installed.
Energy change¶
The beamline x-ray energy change is managed by the energy cli python library.
For user operation the energy cli is called from the mctOptics user interface:

The DMM energy change operates in two modes. The first uses pre-stored energy calibration files. To select this mode set to “No” the “Use File” button:

Then you can select any available energy from the drop down list:

Once the desired energy is selected press the “Set” button to move the DMM.
The second mode allows the use of arbitrary configuration files. You can enable this mode by selecting “Yes” in the “Use File” button:

In this example we are setting the DMM to 17.04 keV using the energy2bm_Mono_17.04.conf configuration file. Press the “Set” button to move the DMM to this energy.
You can create new configuration files with the energy cli by moving the DMM to a known energy, i.e. using calibration foils, and storing that DMM positions in a new config file with:
[user2bmb@arcturus,42,~]$ energy save --mode Mono --energy-value 27.00
in this case a new config file called energy2bm_Mono_27.0_2022-11-03_23_26_17.conf is automatically generated and it can be used by updating the “Folder” and “File” entries in the user iterface.
Finally, if you want to set the DMM to an arbitrary energy that is not a calibration point, let’s say 27.18, you can use the “interpolate” function. To do so, enter an abritrary energy within the energy calibrated range, in our case between 11.10 and 33.20 keV, in the user inteface.
The intepolation function will create a config file for 27.18 keV by intepolating linearly all DMM positions between the 2 closest calibrated energies. For 27.18 keV, the intepolation will occur using 25.51 and 30.00 keV. Once the new energy2bm_interp_27.18.conf is generated, its name will be automacally copied in the “File” entry of the user interface. To move the DMM to this energy press the “Set” button.

More information on how to operate the mctOptics user inteface is here.
Demo¶
mctOptics allows for step-zoom-in during a tomographic measurement and shown in this video.
Install directions¶
Build EPICS base¶
Warning
Make sure the disk partition hosting ~/epics is not larger than 2 TB. See tech talk and Diamond Data Storage document.
$ mkdir ~/epics
$ cd epics
Download EPICS base latest release, i.e. 7.0.3.1., from https://github.com/epics-base/epics-base:
$ git clone https://github.com/epics-base/epics-base.git $ cd epics-base $ make -sj
Build a minimal synApps¶
To build a minimal synApp:
$ cd ~/epics
Download in ~/epics assemble_synApps.sh
- Edit the assemble_synApps.sh script as follows:
Set FULL_CLONE=True
Set EPICS_BASE to point to the location of EPICS base. This could be on APSshare (the default), or a local version you built.
For mctoptics you need
ASYN=R4-37
AUTOSAVE=R5-10
BUSY=R1-7-2
XXX=R6-1
You can comment out all of the other modules (ALLENBRADLEY, ALIVE, etc.)
Run:
$ assemble_synApps.sh
This will create a synApps/support directory:
$ cd synApps/support/
Edit asyn-RX-YY/configure/RELEASE to comment out the lines starting with:
IPAC=$(SUPPORT)/ SNCSEQ=$(SUPPORT)/
Warning
If building for RedHat8 uncomment TIRPC=YES in asyn-RX-YY/configure/CONFIG_SITE
Clone the mctoptics module into synApps/support:
$ git clone https://github.com/tomography/mctoptics.git
Edit configure/RELEASE add this line to the end:
MCTOPTICS=$(SUPPORT)/mctoptics
Edit Makefile add this line to the end of the MODULE_LIST:
MODULE_LIST += MCTOPTICS
Run the following commands:
$ make release $ make -sj
Testing the installation¶
Edit /epics/synApps/support/mctoptics/configure to set EPICS_BASE to point to the location of EPICS base, i.e.:
EPICS_BASE=/APSshare/epics/base-3.15.6
Start the epics ioc and associated medm screen with:
$ cd ~/epics/synApps/support/mctoptics/iocBoot/iocMCTOptics $ start_IOC $ start_medm
mctOpticsApp EPICS application¶
mctOptics includes a complete example EPICS application, including:
A database file and corresponding autosave request file that contain the PVs required by the mctoptics.py base class.
OPI screens for medm
An example IOC application that can be used to run the above databases. The databases are loaded in the IOC with the example substitutions file, mctOptics.substitutions.
Base class files¶
The following tables list all of the records in the mctOptics.template file. These records are used by the mctoptics base class and so are required.
mctOptics.template¶
This is the database file that contains only the PVs required by the mctoptics.py base class mctOptics.template.
TomoScan and Camera PV Prefixes¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)Camera0PVPrefix |
stringout |
Contains the prefix for the detector 0, e.g. 2bmbSP1: |
$(P)$(R)Camera1PVPrefix |
stringout |
Contains the prefix for the detector 1, e.g. 2bmbSP2: |
$(P)$(R)OverlayPlugin0PVPrefix |
stringout |
Contains the prefix for OverlayPlugin 0, e.g. 2bmbSP1:Over1: |
$(P)$(R)OverlayPlugin0PVPrefix |
stringout |
Contains the prefix for OverlayPlugin 1, e.g. 2bmbSP2:Over1: |
$(P)$(R)OverlayPlugin1PVPrefix |
stringout |
Contains the prefix for FilePlugin 0, e.g. 2bmbSP1:HDF1: |
$(P)$(R)FilePlugin0PVPrefix |
stringout |
Contains the prefix for FilePlugin 1, e.g. 2bmbSP2:HDF1: |
Lens Sample X-Y-Z PV Names¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)LensSampleXPVName |
stringout |
Contains the prefix for LensSampleX , e.g. 2bmS1:m2 |
$(P)$(R)LensSampleYPVName |
stringout |
Contains the prefix for LensSampleY, e.g. 2bmb:25 |
$(P)$(R)LensSampleZPVName |
stringout |
Contains the prefix for LensSampleZ, e.g. 2bmS1:m1 |
Lens Focus PV Names¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)Lens0FocusPVName |
stringout |
Contains the prefix for Lens0Focus, e.g. 2bmb:m2 |
$(P)$(R)Lens1FocusPVName |
stringout |
Contains the prefix for Lens1FocusPVName, e.g. 2bmb:m3 |
$(P)$(R)Lens2FocusPVName |
stringout |
Contains the prefix for Lens2FocusPVName, e.g. 2bmb:m4 |
Camera rotation PV Names¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)Camera0RotationPVName |
stringout |
Contains the prefix for Camera0Rotation , e.g. 2bmb:m7 |
$(P)$(R)Camera1RotationPVName |
stringout |
Contains the prefix for Camera1Rotation , e.g. 2bmb:m8 |
Optique Peter camera selector¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)CameraSelect |
mbbo |
Camera selector for Pos0 and Pos1 position |
$(P)$(R)CameraSelected |
mbbo |
Camera selector status for Camera0 and Camera1 position |
$(P)$(R)CameraPos0 |
a0 |
Motor position for the Camera0 |
$(P)$(R)CameraPos1 |
a0 |
Motor position for the Camera1 |
$(P)$(R)CameraName0 |
a0 |
Camera label for Pos0, e.g. Adimec |
$(P)$(R)CameraName1 |
a0 |
Camera label for Pos1, e.g. Flir |
$(P)$(R)CameraMotorPVName |
stringout |
Contains the camera motor PV name, e.g. 2bmb:m5 |
Optique Peter camera rotation¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)Camera0Lens0Rotation |
a0 |
PV storing Camera 0 Lens 0 rotation value |
(P)$(R)Camera0Lens1Rotation |
a0 |
PV storing Camera 0 Lens 1 rotation value |
$(P)$(R)Camera0Lens2Rotation |
a0 |
PV storing Camera 0 Lens 1 rotation value |
$(P)$(R)Camera1Lens0Rotation |
a0 |
PV storing Camera 1 Lens 0 rotation value |
$(P)$(R)Camera1Lens1Rotation |
a0 |
PV storing Camera 1 Lens 1 rotation value |
$(P)$(R)Camera1Lens2Rotation |
a0 |
PV storing Camera 1 Lens 2 rotation value |
Optique Peter lens focus¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)Camera0Lens0Focus |
a0 |
PV storing Camera 0 Lens 0 focus value |
$(P)$(R)Camera0Lens1Focus |
a0 |
PV storing Camera 0 Lens 1 focus value |
$(P)$(R)Camera0Lens2Focus |
a0 |
PV storing Camera 0 Lens 2 focus value |
$(P)$(R)Camera1Lens0Focus |
a0 |
PV storing Camera 1 Lens 0 focus value |
$(P)$(R)Camera1Lens1Focus |
a0 |
PV storing Camera 1 Lens 1 focus value |
$(P)$(R)Camera1Lens2Focus |
a0 |
PV storing Camera 1 Lens 2 focus value |
Optique Peter lens selector¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)LensSelect |
mbbo |
Lens selector for Pos0 and Pos1 position |
$(P)$(R)Camera0LensPos0 |
a0 |
Motor position for the first lens |
$(P)$(R)Camera0LensPos1 |
a0 |
Motor position for the second lens |
$(P)$(R)Camera0LensPos2 |
a0 |
Motor position for the third lens |
$(P)$(R)LensName0 |
a0 |
Lens label for Pos0, e.g. Lens0 |
$(P)$(R)LensName1 |
a0 |
Lens label for Pos1, e.g. Lens1 |
$(P)$(R)LensName2 |
a0 |
Lens label for Pos2, e.g. lens2 |
$(P)$(R)LensMotorPVName |
stringout |
Contains the Lens motor PV name, e.g. 2bmb:m1 |
Detector image cross¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)CrossSelect |
mbbo |
Optique Peter lens 1 offsets¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)Camera0Lens1XOffset |
ao |
|
$(P)$(R)Camera0Lens1YOffset |
ao |
|
$(P)$(R)Camera0Lens1ZOffset |
ao |
|
$(P)$(R)Camera1Lens1XOffset |
ao |
|
$(P)$(R)Camera1Lens1YOffset |
ao |
|
$(P)$(R)Camera1Lens1ZOffset |
ao |
Optique Peter lens 2 offsets¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)Camera0Lens2XOffset |
ao |
|
$(P)$(R)Camera0Lens2YOffset |
ao |
|
$(P)$(R)Camera0Lens2ZOffset |
ao |
|
$(P)$(R)Camera1Lens2XOffset |
ao |
|
$(P)$(R)Camera1Lens2YOffset |
ao |
|
$(P)$(R)Camera1Lens2ZOffset |
ao |
MCT status via Channel Access¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)MCTStatus |
waveform |
|
$(P)$(R)Watchdog |
calcout |
|
$(P)$(R)ServerRunning |
bi |
Sync to motor¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)Sync |
busy |
Optics information¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)ScintillatorType |
stringout |
Contains the type of scintillator being used. |
$(P)$(R)ScintillatorThickness |
ao |
Contains the thickness of the scintillator in microns. |
$(P)$(R)ImagePixelSize |
ao |
Contains the pixel size on the sample in microns (i.e. includes objective magnification) |
$(P)$(R)DetectorPixelSize |
ao |
Contains the pixel size of the detector. |
$(P)$(R)CameraObjective |
stringout |
Description of the camera objective |
$(P)$(R)CameraTubeLength |
stringout |
Description of the camera objective |
Lens name¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)Lens0Name |
stringout |
Lens name for Lens0, e.g. 1.1x |
$(P)$(R)Lens1Name |
stringout |
Lens name for Lens1, e.g. 5x |
$(P)$(R)Lens2Name |
stringout |
Lens name for Lens2, e.g. 10x |
Camera names¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)Camera0Name |
stringout |
|
$(P)$(R)Camera1Name |
stringout |
Detector cropping¶
Record name |
Record type |
Description |
---|---|---|
$(P)$(R)CutLeft |
longout |
|
$(P)$(R)CutRight |
longout |
|
$(P)$(R)CutTop |
longout |
|
$(P)$(R)CutBottom |
longout |
|
$(P)$(R)Cut |
busy |
|
$(P)$(R)SuggestedAngles |
ao |
|
$(P)$(R)SuggestedAngleStep |
ao |
medm files¶
mctOptics.adl¶
The following is the MEDM screen mctOptics.adl
during a scan.
The status information is updating.

mctOpticsEPICS_PVs.adl¶
The following is the MEDM screen mctOpticsEPICS_PVs.adl
.
If these PVs are changed tomoscan must be restarted.
