riCOM_cpp
This repository contains the C++ implementation of the riCOM (Real Time Centre Of Mass) algorithm for 4D Scanning electron microscopy.
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 127 of file Ricom.h.

Constructor & Destructor Documentation

◆ Ricom_detector()

Ricom_detector::Ricom_detector ( )
inline

Definition at line 138 of file Ricom.h.

138 : radius{0, 0}, radius2{0, 0}, id_list(){};
std::array< float, 2 > radius2
Definition: Ricom.h:132
std::array< float, 2 > radius
Definition: Ricom.h:131
std::vector< int > id_list
Definition: Ricom.h:133

◆ ~Ricom_detector()

Ricom_detector::~Ricom_detector ( )
inline

Definition at line 140 of file Ricom.h.

140 {};

Member Function Documentation

◆ compute_detector()

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

Definition at line 160 of file Ricom.cpp.

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

Member Data Documentation

◆ id_list

std::vector<int> Ricom_detector::id_list

Definition at line 133 of file Ricom.h.

◆ radius

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

Definition at line 131 of file Ricom.h.

◆ radius2

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

Definition at line 132 of file Ricom.h.


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