riCOM_cpp
This repository contains the C++ implementation of the riCOM (Real Time Centre Of Mass) algorithm for 4D Scanning electron microscopy.
Loading...
Searching...
No Matches
Enumerations | Functions
RICOM Namespace Reference

Enumerations

enum  modes { FILE , TCP }
 

Functions

void run_ricom (Ricom *r, RICOM::modes mode)
 
void run_connection_script (Ricom *r, MerlinSettings *merlin, const std::string &python_path)
 

Enumeration Type Documentation

◆ modes

Enumerator
FILE 
TCP 

Definition at line 142 of file Ricom.h.

143 {
144 FILE,
145 TCP
146 };
@ TCP
Definition Ricom.h:145
@ FILE
Definition Ricom.h:144

Function Documentation

◆ run_connection_script()

void RICOM::run_connection_script ( Ricom r,
MerlinSettings *  merlin,
const std::string &  python_path 
)

Definition at line 1104 of file Ricom.cpp.

1105{
1106
1107 int m_fr_total = ((ricom->nx + ricom->skip_row) * ricom->ny + ricom->skip_img) * ricom->rep;
1108
1109 std::ofstream run_script("run_script.py");
1110 run_script << "from merlin_interface.merlin_interface import MerlinInterface" << std::endl;
1111 run_script << "m = MerlinInterface(tcp_ip = \"" << ricom->socket.ip << "\" , tcp_port=" << merlin->com_port << ")" << std::endl;
1112 run_script << "m.hvbias = " << merlin->hvbias << std::endl;
1113 run_script << "m.threshold0 = " << merlin->threshold0 << std::endl;
1114 run_script << "m.threshold1 = " << merlin->threshold1 << std::endl;
1115 run_script << "m.continuousrw = " << (int)merlin->continuousrw << std::endl;
1116 run_script << "m.counterdepth = " << ricom->camera.depth << std::endl;
1117 run_script << "m.acquisitiontime = " << merlin->dwell_time << std::endl;
1118 run_script << "m.acquisitionperiod = " << merlin->dwell_time << std::endl;
1119 run_script << "m.numframestoacquire = " << m_fr_total + 1 << std::endl; // Ich verstehe nicht warum, aber er werkt.
1120 run_script << "m.fileenable = " << (int)merlin->save << std::endl;
1121 run_script << "m.runheadless = " << (int)merlin->headless << std::endl;
1122 run_script << "m.fileformat = " << (int)merlin->raw * 2 << std::endl;
1123 run_script << "m.triggerstart = " << merlin->trigger << std::endl;
1124 run_script << "m.startacquisition()";
1125 run_script.close();
1126
1127 std::string command = python_path + " run_script.py";
1128 int r = std::system(command.c_str());
1129 if (r != 0)
1130 {
1131 std::cout << "main::run_connection_script: Cannot execute python run_script. Shell exited with code " << r << std::endl;
1132 }
1133}

◆ run_ricom()

void RICOM::run_ricom ( Ricom r,
RICOM::modes  mode 
)

Definition at line 1089 of file Ricom.cpp.

1090{
1091 switch (r->camera.model)
1092 {
1093 case CAMERA::MERLIN:
1094 r->run_reconstruction<MerlinInterface>(mode);
1095 break;
1096 case CAMERA::TIMEPIX:
1097 r->run_reconstruction<TimepixInterface>(mode);
1098 break;
1099 default:
1100 break;
1101 }
1102}
Camera_model model
Definition Camera.h:43
void run_reconstruction(RICOM::modes mode)
Definition Ricom.cpp:985
CAMERA::Camera_BASE camera
Definition Ricom.h:218
@ TIMEPIX
Definition Camera.h:30
@ MERLIN
Definition Camera.h:29