Base
get_extract_info(image, auto_thresh_multiplier, hist_bin_edges, max_pixel_value, scale, z_info=None)
Gets information from filtered scaled images useful for later in the pipeline.
If 3D image, only z-plane used for auto_thresh
and hist_counts
calculation for speed and the that the
exact value of these is not that important, just want a rough idea.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
np.ndarray
|
|
required |
auto_thresh_multiplier |
float
|
|
required |
hist_bin_edges |
np.ndarray
|
|
required |
max_pixel_value |
int
|
Maximum pixel value that image can contain when saving as tiff file.
If no shift was applied, this would be |
required |
scale |
float
|
Factor by which, |
required |
z_info |
Optional[int]
|
z-plane to get |
None
|
Returns:
Type | Description |
---|---|
float
|
|
np.ndarray
|
|
int
|
|
float
|
|
Source code in coppafish/extract/base.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 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 |
|
get_pixel_length(length_microns, pixel_size)
Converts a length in units of microns into a length in units of pixels
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length_microns |
float
|
Length in units of microns (microns) |
required |
pixel_size |
float
|
Size of a pixel in microns (microns/pixels) |
required |
Returns:
Type | Description |
---|---|
int
|
Desired length in units of pixels (pixels) |
Source code in coppafish/extract/base.py
53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
strip_hack(image)
Finds all columns in image where each row is identical and then sets this column to the nearest normal column. Basically 'repeat padding'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
np.ndarray
|
|
required |
Returns:
Type | Description |
---|---|
np.ndarray
|
|
np.ndarray
|
|
Source code in coppafish/extract/base.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
wait_for_data(data_path, wait_time, dir=False)
Waits for wait_time seconds to see if file/directory at data_path becomes available in that time.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_path |
str
|
Path to file or directory of interest |
required |
wait_time |
int
|
Time to wait in seconds for file to become available. |
required |
dir |
bool
|
If True, assumes data_path points to a directory, otherwise assumes points to a file. |
False
|
Source code in coppafish/extract/base.py
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 40 41 42 43 44 45 46 47 48 49 50 |
|