Coverage for src/abm_initialization_collection/image/get_image_bounds.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.1.0, created at 2024-07-26 20:12 +0000

1from bioio import BioImage 

2 

3 

4def get_image_bounds(image: BioImage) -> tuple[int, int, int]: 

5 """ 

6 Extracts image bounds in the x, y, and z directions. 

7 

8 Parameters 

9 ---------- 

10 image 

11 Image object. 

12 

13 Returns 

14 ------- 

15 : 

16 Tuple of image bounds. 

17 """ 

18 

19 _, _, z_shape, y_shape, x_shape = image.shape 

20 bounds = (x_shape, y_shape, z_shape) 

21 return bounds