bioscopelib/jsonb/
picture_data.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PictureData {
    pub recognized_areas: Option<Vec<RecognizedArea>>,
}

impl PictureData {
    pub fn default() -> PictureData {
        PictureData {
            recognized_areas: None,
        }
    }
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct RecognizedArea {
    pub x1: i32,
    pub x2: i32,
    pub y1: i32,
    pub y2: i32,
    pub organizm_variants: Vec<OrganizmVariant>,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct OrganizmVariant {
    pub name: String,
    pub probalitity: f32,
}