def test_synthetic_spot_creation_raises_error_with_coords_too_small( synthetic_intensity_table): num_z = 0 height = 40 width = 50 with pytest.raises(ValueError): ImageStack.synthetic_spots(synthetic_intensity_table, num_z, height, width)
def test_synthetic_spot_creation_produces_an_imagestack( synthetic_intensity_table): num_z = 12 height = 50 width = 40 image = ImageStack.synthetic_spots(synthetic_intensity_table, num_z, height, width) assert isinstance(image, ImageStack)
def synthetic_spot_pass_through_stack(synthetic_dataset_with_truth_values): codebook, true_intensities, _ = synthetic_dataset_with_truth_values true_intensities = true_intensities[:2] # transfer the intensities to the stack but don't do anything to them. img_stack = ImageStack.synthetic_spots( true_intensities, num_z=12, height=50, width=45, n_photons_background=0, point_spread_function=(0, 0, 0), camera_detection_efficiency=1.0, background_electrons=0, graylevel=1) return codebook, true_intensities, img_stack
def spots(self, intensities=None) -> ImageStack: if intensities is None: intensities = self.intensities() stack = ImageStack.synthetic_spots( intensities, self.n_z, self.height, self.width, self.n_photons_background, self.point_spread_function, self.camera_detection_efficiency, self.background_electrons, self.gray_level, self.ad_coversion_bits) assert stack.xarray.dtype == np.float32 return stack