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
Public Member Functions | Public Attributes | List of all members
Ricom_detector Class Reference

#include <Ricom.h>

Public Member Functions

void compute_detector (int nx_cam, int ny_cam, std::array< float, 2 > &offset)
 
 Ricom_detector ()
 
 ~Ricom_detector ()
 

Public Attributes

std::array< float, 2 > radius
 
std::array< float, 2 > radius2
 
std::vector< int > id_list
 

Detailed Description

Definition at line 124 of file Ricom.h.

Constructor & Destructor Documentation

◆ Ricom_detector()

Ricom_detector::Ricom_detector ( )
inline

Definition at line 135 of file Ricom.h.

135: radius{0, 0}, radius2{0, 0}, id_list(){};
std::array< float, 2 > radius2
Definition Ricom.h:129
std::array< float, 2 > radius
Definition Ricom.h:128
std::vector< int > id_list
Definition Ricom.h:130

◆ ~Ricom_detector()

Ricom_detector::~Ricom_detector ( )
inline

Definition at line 137 of file Ricom.h.

137{};

Member Function Documentation

◆ compute_detector()

void Ricom_detector::compute_detector ( int  nx_cam,
int  ny_cam,
std::array< float, 2 > &  offset 
)

Definition at line 159 of file Ricom.cpp.

160{
161
162 radius2[0] = pow(radius[0], 2);
163 radius2[1] = pow(radius[1], 2);
164 float d2;
165 id_list.clear();
166 id_list.reserve(nx_cam * ny_cam);
167
168 for (int iy = 0; iy < ny_cam; iy++)
169 {
170 for (int ix = 0; ix < nx_cam; ix++)
171 {
172 d2 = pow((float)ix - offset[0], 2) + pow((float)iy - offset[1], 2);
173 if (d2 > radius2[0] && d2 <= radius2[1])
174 {
175 id_list.push_back(iy * nx_cam + ix);
176 }
177 }
178 }
179}

Member Data Documentation

◆ id_list

std::vector<int> Ricom_detector::id_list

Definition at line 130 of file Ricom.h.

◆ radius

std::array<float, 2> Ricom_detector::radius

Definition at line 128 of file Ricom.h.

◆ radius2

std::array<float, 2> Ricom_detector::radius2

Definition at line 129 of file Ricom.h.


The documentation for this class was generated from the following files: