smlm_locs/
allocated_localisation.rs1use crate::{Localisation, FitLocalisation, UncertainLocalisation};
2
3#[derive(Debug, Clone, Copy, PartialEq)]
4pub struct AllocatedLocalisation
5{
6 frame_number: u32,
7 x: f64,
8 y: f64,
9 sigma: f64,
10 intensity: f64,
11 uncertainty: f64
12}
13
14impl AllocatedLocalisation
15{
16 pub fn new(frame_number: u32, x: f64, y: f64, sigma: f64, intensity: f64, uncertainty: f64) -> Self
17 {
18 Self{frame_number, x, y, sigma, intensity, uncertainty}
19 }
20}
21
22impl AllocatedLocalisation
23{
24 pub fn frame_number(&self) -> u32
25 {
26 self.frame_number
27 }
28
29 pub fn x(&self) -> f64
30 {
31 self.x
32 }
33
34 pub fn y(&self) -> f64
35 {
36 self.y
37 }
38
39 pub fn sigma(&self) -> f64
40 {
41 self.sigma
42 }
43
44 pub fn intensity(&self) -> f64
45 {
46 self.intensity
47 }
48
49 pub fn uncertainty(&self) -> f64
50 {
51 self.uncertainty
52 }
53}
54
55impl Localisation for AllocatedLocalisation
56{
57 fn x(&self) -> f64
58 {
59 self.x
60 }
61
62 fn y(&self) -> f64
63 {
64 self.y
65 }
66}
67
68impl FitLocalisation for AllocatedLocalisation
69{
70 fn psf_sigma(&self) -> f64
71 {
72 self.sigma()
73 }
74}
75
76impl UncertainLocalisation for AllocatedLocalisation
77{
78 fn uncertainty(&self) -> f64
79 {
80 self.uncertainty
81 }
82}