core_match_template
Pure PyTorch implementation of whole orientation search backend.
construct_multi_gpu_match_template_kwargs(image_dft, template_dft, euler_angles, projective_filters, defocus_values, pixel_values, orientation_batch_size, devices)
Split orientations between requested devices.
See the core_match_template
function for further descriptions of the
input parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_dft
|
Tensor
|
dft of image |
required |
template_dft
|
Tensor
|
dft of template |
required |
euler_angles
|
Tensor
|
euler angles to search |
required |
projective_filters
|
Tensor
|
filters to apply to each projection |
required |
defocus_values
|
Tensor
|
corresponding defocus values for each filter |
required |
pixel_values
|
Tensor
|
corresponding pixel size values for each filter |
required |
orientation_batch_size
|
int
|
number of projections to calculate at once |
required |
devices
|
list[device]
|
list of devices to split the orientations across |
required |
Returns:
Type | Description |
---|---|
list[dict[str, Tensor | int]]
|
List of dictionaries containing the kwargs to call the single-GPU function. Each index in the list corresponds to a different device, and all tensors in the dictionary have been allocated to that device. |
Source code in src/leopard_em/backend/core_match_template.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
core_match_template(image_dft, template_dft, ctf_filters, whitening_filter_template, defocus_values, pixel_values, euler_angles, device, orientation_batch_size=1)
Core function for performing the whole-orientation search.
With the RFFT, the last dimension (fastest dimension) is half the width of the input, hence the shape of W // 2 + 1 instead of W for some of the input parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_dft
|
Tensor
|
Real-fourier transform (RFFT) of the image with large image filters already applied. Has shape (H, W // 2 + 1). |
required |
template_dft
|
Tensor
|
Real-fourier transform (RFFT) of the template volume to take Fourier slices from. Has shape (l, h, w // 2 + 1). where l is the number of slices. |
required |
ctf_filters
|
Tensor
|
Stack of CTF filters at different defocus values to use in the search. Has shape (defocus_batch, h, w // 2 + 1). |
required |
whitening_filter_template
|
Tensor
|
Whitening filter for the template volume. Has shape (h, w // 2 + 1). Gets multiplied with the ctf filters to create a filter stack. |
required |
euler_angles
|
Tensor
|
Euler angles (in 'ZYZ' convention) to search over. Has shape (orientations, 3). |
required |
defocus_values
|
Tensor
|
What defoucs values correspond with the CTF filters. Has shape (defocus_batch,). |
required |
pixel_values
|
Tensor
|
What pixel size values correspond with the CTF filters. Has shape (pixel_size_batch,). |
required |
device
|
device | list[device]
|
Device or devices to split computation across. |
required |
orientation_batch_size
|
int
|
Number of projections to calculate at once, on each device |
1
|
Returns:
Type | Description |
---|---|
dict[str, Tensor]
|
Dictionary containing the following key, value pairs:
|
Source code in src/leopard_em/backend/core_match_template.py
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 91 92 93 94 95 96 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 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 167 168 169 170 171 172 173 174 175 |
|