himena.standards.roi
Standard ROI (Region of Interest) classes for images.
CircleRoi
ROI that represents a circle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
x
|
int | float
|
X-coordinate of the center. |
required |
y
|
int | float
|
Y-coordinate of the center. |
required |
radius
|
int | float
|
Radius of the circle. |
required |
Source code in src\himena\standards\roi\core.py
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
|
EllipseRoi
ROI that represents an ellipse.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
x
|
int | float
|
X-coordinate of the left boundary. |
required |
y
|
int | float
|
Y-coordinate of the top boundary. |
required |
width
|
int | float
|
Diameter along the x-axis. |
required |
height
|
int | float
|
Diameter along the y-axis. |
required |
Source code in src\himena\standards\roi\core.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
|
eccentricity()
Eccentricity of the ellipse.
Source code in src\himena\standards\roi\core.py
164 165 166 167 168 169 |
|
LineRoi
A 2D line ROI.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
start
|
tuple[float, float]
|
(X, Y) coordinate of the start point. |
required |
end
|
tuple[float, float]
|
(X, Y) coordinate of the end point. |
required |
Source code in src\himena\standards\roi\core.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
|
angle()
Angle in degrees.
Source code in src\himena\standards\roi\core.py
325 326 327 |
|
arange(step=1.0)
Return a tuple of x and y coordinates of np.arange along the line.
Source code in src\himena\standards\roi\core.py
338 339 340 341 342 343 344 345 346 347 348 349 |
|
length()
Length of the line.
Source code in src\himena\standards\roi\core.py
319 320 321 322 323 |
|
linspace(num)
Return a tuple of x and y coordinates of np.linspace along the line.
Source code in src\himena\standards\roi\core.py
334 335 336 |
|
shifted(dx, dy)
Shift the line by the given amount.
Source code in src\himena\standards\roi\core.py
312 313 314 315 316 317 |
|
PointRoi1D
ROI that represents a point in 1D space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
x
|
float
|
X-coordinate of the point. |
required |
Source code in src\himena\standards\roi\core.py
28 29 30 31 32 33 34 |
|
PointRoi2D
ROI that represents a single point.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
x
|
float
|
X-coordinate of the point. |
required |
y
|
float
|
Y-coordinate of the point. |
required |
Source code in src\himena\standards\roi\core.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
|
PointsRoi1D
ROI that represents a set of points in 1D space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
xs
|
Any
|
List of x-coordinates. |
required |
Source code in src\himena\standards\roi\core.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
PointsRoi2D
ROI that represents a set of points.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
xs
|
Any
|
List of x-coordinates. |
required |
ys
|
Any
|
List of y-coordinates. |
required |
Source code in src\himena\standards\roi\core.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
|
PolygonRoi
ROI that represents a closed polygon.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
xs
|
Any
|
List of x-coordinates. |
required |
ys
|
Any
|
List of y-coordinates. |
required |
Source code in src\himena\standards\roi\core.py
402 403 404 405 406 407 408 409 410 411 |
|
RectangleRoi
ROI that represents a rectangle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
x
|
int | float
|
X-coordinate of the top-left corner. |
required |
y
|
int | float
|
Y-coordinate of the top-left corner. |
required |
width
|
int | float
|
Width of the rectangle. |
required |
height
|
int | float
|
Height of the rectangle. |
required |
Source code in src\himena\standards\roi\core.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
area()
Return the area of the rectangle.
Source code in src\himena\standards\roi\core.py
65 66 67 |
|
bbox()
Return the bounding box of the rectangle.
Source code in src\himena\standards\roi\core.py
69 70 71 |
|
shifted(dx, dy)
Return a new rectangle shifted by the given amount.
Source code in src\himena\standards\roi\core.py
61 62 63 |
|
Roi1D
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
Source code in src\himena\standards\roi\_base.py
56 57 58 59 |
|
shifted(dx)
Return a new 1D ROI translated by the given amount.
Source code in src\himena\standards\roi\_base.py
57 58 59 |
|
Roi2D
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
Source code in src\himena\standards\roi\_base.py
62 63 64 65 66 67 68 69 |
|
bbox()
Return the bounding box of the ROI.
Source code in src\himena\standards\roi\_base.py
63 64 65 |
|
shifted(dx, dy)
Return a new 2D ROI translated by the given amount.
Source code in src\himena\standards\roi\_base.py
67 68 69 |
|
Roi3D
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
Source code in src\himena\standards\roi\_base.py
72 73 74 75 |
|
shifted(dx, dy, dz)
Return a new 3D ROI translated by the given amount.
Source code in src\himena\standards\roi\_base.py
73 74 75 |
|
RoiListModel
dataclass
List of ROIs, with useful methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
items
|
str
|
|
array([], dtype=object)
|
indices
|
str
|
|
array([], shape=(0, 0), dtype=int32)
|
axis_names
|
str
|
Built-in mutable sequence. If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified. |
<dynamic>
|
Source code in src\himena\standards\roi\_list.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
construct(dict_)
classmethod
Construct an instance from a dictionary.
Source code in src\himena\standards\roi\_list.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
model_validate_json(text)
classmethod
Validate the json string and return an instance.
Source code in src\himena\standards\roi\_list.py
35 36 37 38 39 |
|
RoiModel
Base class for ROIs (Region of Interest) in images.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
Source code in src\himena\standards\roi\_base.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
construct(typ, dict_)
classmethod
Construct an instance from a dictionary.
Source code in src\himena\standards\roi\_base.py
26 27 28 29 30 |
|
RotatedEllipseRoi
ROI that represents a rotated ellipse.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
start
|
tuple[float, float]
|
(X, Y) coordinate of the start point. |
required |
end
|
tuple[float, float]
|
(X, Y) coordinate of the end point. |
required |
width
|
float
|
Width of the ROI. |
required |
Source code in src\himena\standards\roi\core.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
RotatedRectangleRoi
ROI that represents a rotated rectangle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
start
|
tuple[float, float]
|
(X, Y) coordinate of the start point. |
required |
end
|
tuple[float, float]
|
(X, Y) coordinate of the end point. |
required |
width
|
float
|
Width of the ROI. |
required |
Source code in src\himena\standards\roi\core.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
SegmentedLineRoi
ROI that represents a segmented line.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
xs
|
Any
|
List of x-coordinates. |
required |
ys
|
Any
|
List of y-coordinates. |
required |
Source code in src\himena\standards\roi\core.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 |
|
linspace(num)
Return a tuple of x and y coordinates of np.linspace along the line.
Source code in src\himena\standards\roi\core.py
374 375 376 377 378 379 380 |
|
SpanRoi
ROI that represents a span in 1D space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
start
|
float
|
Start of the span. |
required |
end
|
float
|
End of the span. |
required |
Source code in src\himena\standards\roi\core.py
15 16 17 18 19 20 21 22 23 24 25 |
|
SplineRoi
ROI that represents a spline curve.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
Name of the ROI. |
None
|
degree
|
int
|
Degree of the spline curve. |
3
|
Source code in src\himena\standards\roi\core.py
414 415 416 417 |
|
default_roi_label(nth)
Return a default label for the n-th ROI.
Source code in src\himena\standards\roi\_base.py
51 52 53 |
|
pick_roi_model(typ)
cached
Pick an ROI model class from the given type string
Source code in src\himena\standards\roi\_base.py
36 37 38 39 40 41 42 |
|