Deconvolution
get_psf(spot_images, annulus_width)
This gets psf, which is average image of spot from individual images of spots. It is normalised so min value is 0 and max value is 1.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spot_images |
np.ndarray
|
|
required |
annulus_width |
float
|
Within each z-plane, this specifies how big an annulus to use, within which we expect all pixel values to be the same. |
required |
Returns:
Type | Description |
---|---|
np.ndarray
|
|
Source code in coppafish/extract/deconvolution.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
get_psf_spots(nbp_file, nbp_basic, round, use_tiles, channel, use_z, radius_xy, radius_z, min_spots, intensity_thresh, intensity_auto_param, isolation_dist, shape)
Finds spot_shapes about spots found in raw data, average of these then used for psf.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nbp_file |
NotebookPage
|
|
required |
nbp_basic |
NotebookPage
|
|
required |
round |
int
|
Reference round to get spots from to determine psf. This should be the anchor round (last round) if using. |
required |
use_tiles |
List[int]
|
|
required |
channel |
int
|
Reference channel to get spots from to determine psf. |
required |
use_z |
List[int]
|
|
required |
radius_xy |
int
|
Radius of dilation structuring element in xy plane (approximately spot radius). |
required |
radius_z |
int
|
Radius of dilation structuring element in z direction (approximately spot radius) |
required |
min_spots |
int
|
Minimum number of spots required to determine average shape from. Typical: 300 |
required |
intensity_thresh |
Optional[float]
|
Spots are local maxima in image with |
required |
intensity_auto_param |
float
|
If |
required |
isolation_dist |
float
|
Spots are isolated if nearest neighbour is further away than this. |
required |
shape |
List[int]
|
|
required |
Returns:
Type | Description |
---|---|
np.ndarray
|
|
float
|
|
List[int]
|
|
Source code in coppafish/extract/deconvolution.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 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 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
get_wiener_filter(psf, image_shape, constant)
This tapers the psf so goes to 0 at edges and then computes wiener filter from it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
psf |
np.ndarray
|
|
required |
image_shape |
Union[np.ndarray, List[int]]
|
|
required |
constant |
float
|
Constant used in wiener filter. |
required |
Returns:
Type | Description |
---|---|
np.ndarray
|
|
Source code in coppafish/extract/deconvolution.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
psf_pad(psf, image_shape)
Pads psf with zeros so has same dimensions as image
Parameters:
Name | Type | Description | Default |
---|---|---|---|
psf |
np.ndarray
|
|
required |
image_shape |
Union[np.ndarray, List[int]]
|
|
required |
Returns:
Type | Description |
---|---|
np.ndarray
|
|
np.ndarray
|
Array same size as image with psf centered on middle pixel. |
Source code in coppafish/extract/deconvolution.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
wiener_deconvolve(image, im_pad_shape, filter)
This pads image
so goes to median value of image
at each edge. Then deconvolves using wiener filter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
np.ndarray
|
|
required |
im_pad_shape |
List[int]
|
|
required |
filter |
np.ndarray
|
|
required |
Returns:
Type | Description |
---|---|
np.ndarray
|
|
Source code in coppafish/extract/deconvolution.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
|