pigeon-tem-comms 2.0.0__py3-none-any.whl → 2.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
TEM_comms/camera.py CHANGED
@@ -1,27 +1,14 @@
1
1
  from pigeon import BaseMessage
2
- from .tile.metadata import TileMetadata
2
+ from .tile.metadata import TileMetadata, ProcessingOptions
3
3
  from typing import Optional
4
4
  from pydantic import Field
5
5
 
6
6
 
7
- class Command(TileMetadata):
7
+ class Command(TileMetadata, ProcessingOptions):
8
8
  """
9
9
  This message is used to instruct the camera to capture an image.
10
10
  """
11
11
 
12
- brightfield: Optional[bool] = Field(
13
- default=False,
14
- description="If true, this tile should be used in creating the brightfield image.",
15
- )
16
- darkfield: Optional[bool] = Field(
17
- default=False,
18
- description="If true, this tile should be used in creating the darkfield image.",
19
- )
20
- lens_correction: Optional[bool] = Field(
21
- default=True,
22
- description="If true, this tile is part of a lens correction montage.",
23
- )
24
-
25
12
 
26
13
  class Image(BaseMessage):
27
14
  """
@@ -1,7 +1,7 @@
1
- from .metadata import TileMetadata
1
+ from .metadata import TileMetadata, ProcessingOptions
2
2
  from . import statistics
3
3
  from pydantic import BaseModel, Field
4
- from typing import Literal, List, Tuple
4
+ from typing import Literal, List, Tuple, Optional
5
5
 
6
6
 
7
7
  class Preview(TileMetadata):
@@ -20,7 +20,7 @@ class Mini(TileMetadata):
20
20
  image: str = Field(description="The downsampled tile as a base 64 encoded string.")
21
21
 
22
22
 
23
- class Raw(TileMetadata):
23
+ class Raw(TileMetadata, ProcessingOptions):
24
24
  """
25
25
  This message is sent whenever a new tile is stored on the filesystem and is ready for processing.
26
26
  """
@@ -74,37 +74,42 @@ class Matches(TileMetadata):
74
74
  class TemplateMatch(BaseModel):
75
75
  model_config = {"extra": "forbid"}
76
76
 
77
- row: int = Field(description="The row of the neighboring tile.")
78
- column: int = Field(description="The column of the neighboring tile.")
79
- position: Literal["top", "bottom", "left", "right"] = Field(
80
- description="The position of matched tile relative to the captured tile."
77
+ offset: Tuple[float, float] = Field(
78
+ description="The offset between the expected and actual template positions."
81
79
  )
82
-
83
- offsets: List[Tuple[float, float]] = Field(
84
- description="The offsets between expected and actual template positions."
80
+ distance: float = Field(description="The distance of the offset.")
81
+ rotation: float = Field(description="The angle of the offset.")
82
+ maxVal: float = Field(
83
+ description="The maximum value of the template match."
85
84
  )
86
- distance: List[float] = Field(description="The distance of each offset.")
87
- rotation: List[float] = Field(description="The angle of each offset.")
88
- maxVal: List[float] = Field(
89
- description="The maximum value from each of the template matches."
85
+ minVal: float = Field(
86
+ description="The minimum value of the template match."
90
87
  )
91
- minVal: List[float] = Field(
92
- description="The minimum value from each of the template matches."
88
+ expected_offset_in_crop: Tuple[int, int] = Field(description="")
89
+ maxLoc: Tuple[int, int] = Field(
90
+ description="The maximum location of the template match."
93
91
  )
94
- expected_offset_in_crop: List[Tuple[int, int]] = Field(description="")
95
- maxLoc: List[Tuple[int, int]] = Field(
96
- description="The maximum location of each template match."
92
+ matched_pos_img2: Tuple[int, int] = Field(
93
+ description="The template top left corner absolute location."
97
94
  )
98
- matched_pos_img2: List[Tuple[int, int]] = Field(
99
- description="Each of the template top left corner absolute locations."
95
+ matched_center_img2: Tuple[int, int] = Field(
96
+ description="The template center absolute location."
100
97
  )
101
- matched_center_img2: List[Tuple[int, int]] = Field(
102
- description="Each of the template center absolute locations."
98
+ good: bool = Field(description="True if the match is good.")
99
+ reject_reason: Optional[str] = Field(
100
+ default="", description="The reason why the match is not good."
103
101
  )
104
- good: List[bool] = Field(description="True if an individual match is good.")
105
- reject_reason: List[str] = Field(
106
- description="The reason why an individual match is not good."
102
+
103
+
104
+ class TemplateMatchContainer(BaseModel):
105
+ model_config = {"extra": "forbid"}
106
+
107
+ row: int = Field(description="The row of the neighboring tile.")
108
+ column: int = Field(description="The column of the neighboring tile.")
109
+ position: Literal["top", "bottom", "left", "right"] = Field(
110
+ description="The position of matched tile relative to the captured tile."
107
111
  )
112
+ matches: List[TemplateMatch] = Field(description="A list of data structures containing the information about each individual match.")
108
113
 
109
114
 
110
115
  class TemplateMatches(TileMetadata):
@@ -112,7 +117,7 @@ class TemplateMatches(TileMetadata):
112
117
  This message contains data reltaing to template matches used for calculating the lens correction transform.
113
118
  """
114
119
 
115
- matches: List[TemplateMatch] = Field(
120
+ matches: List[TemplateMatchContainer] = Field(
116
121
  description="Information about how the captured tile matches to each of its available neighbors."
117
122
  )
118
123
 
@@ -1,5 +1,6 @@
1
1
  from pigeon import BaseMessage
2
2
  from pydantic import Field
3
+ from typing import Optional
3
4
 
4
5
 
5
6
  class TileMetadata(BaseMessage):
@@ -20,3 +21,18 @@ class TileMetadata(BaseMessage):
20
21
  overlap: int = Field(
21
22
  description="The number of pixels of overlap between tiles.", examples=[512]
22
23
  )
24
+
25
+
26
+ class ProcessingOptions(BaseMessage):
27
+ brightfield: Optional[bool] = Field(
28
+ default=False,
29
+ description="If true, this tile should be used in creating the brightfield image.",
30
+ )
31
+ darkfield: Optional[bool] = Field(
32
+ default=False,
33
+ description="If true, this tile should be used in creating the darkfield image.",
34
+ )
35
+ lens_correction: Optional[bool] = Field(
36
+ default=False,
37
+ description="If true, this tile is part of a lens correction montage.",
38
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pigeon-tem-comms
3
- Version: 2.0.0
3
+ Version: 2.1.1
4
4
  Summary: Pigeon messages for the next generation TEM imaging system.
5
5
  Author-email: Cameron Devine <cameron.devine@alleninstitute.org>
6
6
  License: BSD 3 Clause
@@ -1,7 +1,7 @@
1
1
  TEM_comms/__init__.py,sha256=c2UGXOvlwg_Xy5WTQBaIS2ebmgEtJIbIwyoh7AzDjDk,1850
2
2
  TEM_comms/buffer.py,sha256=bQiYDQDOMDBEfx6QKWFKUJE14z-xn8SqwnqE1LqL5Io,546
3
3
  TEM_comms/calibration.py,sha256=Nd5u1HA5qwA_04pOeyklVLZkdV06e9y0kS2Gv9qvJNg,1383
4
- TEM_comms/camera.py,sha256=nUIL7nW2u7BNtA-96cHL2NSwH8kJ_5AgkWmspGjItEs,2600
4
+ TEM_comms/camera.py,sha256=XrRVU-4hAGHJEbfvoj3b7359NEuTuRyqtMLL9e0V3xI,2164
5
5
  TEM_comms/lens_correction.py,sha256=KCsI1jMuPwHTxfHzx4_MP7VXdgcq6DpESQOYXV4NVqQ,290
6
6
  TEM_comms/montage.py,sha256=GevXbNdf8NGmvxR-2RPEK4JeSGtNdTXpNE_I2PSjTZ8,2157
7
7
  TEM_comms/qc.py,sha256=sFUTBjroGZrKjuL9u0LO6DT9mn10IEQsfuMv1QjgiLU,627
@@ -14,12 +14,12 @@ TEM_comms/stage/__init__.py,sha256=UVtYKzMBI01FUADS24xSItNIjhqdZtlDeJdqsDJNVIc,6
14
14
  TEM_comms/stage/aperture.py,sha256=RoZjwmUMsgZcFTW6OYasK7g9pbz5hE0fUAOvWqVPZeA,1029
15
15
  TEM_comms/stage/motion.py,sha256=Ox_WIdhKxhkr7Q9QxbdKRKx-84az5tT_L1yUlxxNrXo,1730
16
16
  TEM_comms/stage/rotation.py,sha256=_rMk9ES7_ivMZ1AypqFVdvcuTbTQ32g9La2L1ZLdMTE,1476
17
- TEM_comms/tile/__init__.py,sha256=KHzx0GHWiIggphOkUq4bHRBrKCLYrW_VKf49lqbpTfY,4725
18
- TEM_comms/tile/metadata.py,sha256=k5YYn5UDTNcIDw0Cjm1nrajd6BGAvctOUwEWn2ZJ9O4,790
17
+ TEM_comms/tile/__init__.py,sha256=_SN7yS_rbosNsZ0n9M62WOlD_WSHnjaLoeg-vvdDeEY,4895
18
+ TEM_comms/tile/metadata.py,sha256=iLKEmi-ocC0I_LU4YVk0AymL5zxSmmquk-fKDiKyUg0,1332
19
19
  TEM_comms/tile/statistics.py,sha256=hinAROuYdL4l0SNAdvndqetbWhDiF1ANjMoLJoPubpM,976
20
- pigeon_tem_comms-2.0.0.dist-info/licenses/LICENSE,sha256=tZfQIUX7uNGacTb751ZWInVenJl6OwYQihcGbYrKSts,1463
21
- pigeon_tem_comms-2.0.0.dist-info/METADATA,sha256=kdfkvH5q1KSRMhMm8IooD1tlAeqaeWhKFTgzZf_3ao4,1575
22
- pigeon_tem_comms-2.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- pigeon_tem_comms-2.0.0.dist-info/entry_points.txt,sha256=X2WfBCDgfH9XVVqiI4rLu7BLyMNuLW6WWckqXxfbrgk,38
24
- pigeon_tem_comms-2.0.0.dist-info/top_level.txt,sha256=3_1RcQ7xvS2dJEYnPIigo9snoKcSXSNJzPqunY0qydI,10
25
- pigeon_tem_comms-2.0.0.dist-info/RECORD,,
20
+ pigeon_tem_comms-2.1.1.dist-info/licenses/LICENSE,sha256=tZfQIUX7uNGacTb751ZWInVenJl6OwYQihcGbYrKSts,1463
21
+ pigeon_tem_comms-2.1.1.dist-info/METADATA,sha256=3WsqVZnGiI0xuEf3dUnyXqg0aeS65lRNpWkADV6xzkU,1575
22
+ pigeon_tem_comms-2.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ pigeon_tem_comms-2.1.1.dist-info/entry_points.txt,sha256=X2WfBCDgfH9XVVqiI4rLu7BLyMNuLW6WWckqXxfbrgk,38
24
+ pigeon_tem_comms-2.1.1.dist-info/top_level.txt,sha256=3_1RcQ7xvS2dJEYnPIigo9snoKcSXSNJzPqunY0qydI,10
25
+ pigeon_tem_comms-2.1.1.dist-info/RECORD,,