|
23 | 23 | check_excitation_lambda_in_nm, |
24 | 24 | check_emission_lambda_in_nm, |
25 | 25 | check_plane_segmentation_image_mask_shape_against_ref_images, |
| 26 | + check_image_series_data_size, # Technically an ImageSeries check, but test is more convenient here |
26 | 27 | ) |
27 | 28 |
|
28 | 29 |
|
@@ -327,3 +328,37 @@ def test_fail_check_plane_segmentation_image_mask_dims_against_imageseries(): |
327 | 328 | location="/", |
328 | 329 | ) |
329 | 330 | ] |
| 331 | + |
| 332 | + |
| 333 | +def test_false_positive_skip_check_image_series_data_size(): |
| 334 | + |
| 335 | + device = Device( |
| 336 | + name="Microscope", description="My two-photon microscope", manufacturer="The best microscope manufacturer" |
| 337 | + ) |
| 338 | + optical_channel = OpticalChannel(name="OpticalChannel", description="an optical channel", emission_lambda=500.0) |
| 339 | + imaging_plane = ImagingPlane( |
| 340 | + name="ImagingPlane", |
| 341 | + optical_channel=optical_channel, |
| 342 | + imaging_rate=30.0, |
| 343 | + description="a very interesting part of the brain", |
| 344 | + device=device, |
| 345 | + excitation_lambda=300.0, |
| 346 | + indicator="GFP", |
| 347 | + location="V1", |
| 348 | + grid_spacing=[0.01, 0.01], |
| 349 | + grid_spacing_unit="meters", |
| 350 | + origin_coords=[1.0, 2.0, 3.0], |
| 351 | + origin_coords_unit="meters", |
| 352 | + ) |
| 353 | + |
| 354 | + two_photon_series = TwoPhotonSeries( |
| 355 | + name="TwoPhotonSeries", |
| 356 | + imaging_plane=imaging_plane, |
| 357 | + data=np.empty( |
| 358 | + shape=(110 * 10**6, 1, 1), dtype="uint8" |
| 359 | + ), # Empty data, but of shape+dtype that would be more than default GB threshold |
| 360 | + unit="n.a.", |
| 361 | + rate=30.0, |
| 362 | + ) |
| 363 | + |
| 364 | + assert check_image_series_data_size(image_series=two_photon_series, gb_lower_bound=0.1) is None |
0 commit comments