File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
src/leopard_em/pydantic_models Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ dependencies = [
4949 " roma" ,
5050 " tqdm" ,
5151 " torch-fourier-slice>=v0.2.0" ,
52- " torch-fourier-filter>=v0.2.3 " ,
52+ " torch-fourier-filter>=v0.2.6 " ,
5353 " torch-so3>=v0.2.0" ,
5454 " ttsim3d>=v0.4.0" ,
5555 " lmfit" ,
Original file line number Diff line number Diff line change 55
66import torch
77from torch_fourier_filter .ctf import calculate_ctf_2d
8+ from torch_fourier_filter .envelopes import b_envelope
89
910# Using the TYPE_CHECKING statement to avoid circular imports
1011if TYPE_CHECKING :
@@ -166,13 +167,22 @@ def calculate_ctf_filter_stack_full_args(
166167 voltage = kwargs ["voltage" ],
167168 spherical_aberration = cs_val ,
168169 amplitude_contrast = kwargs ["amplitude_contrast_ratio" ],
169- b_factor = kwargs ["ctf_B_factor" ],
170170 phase_shift = kwargs ["phase_shift" ],
171171 pixel_size = kwargs ["pixel_size" ],
172172 image_shape = template_shape ,
173173 rfft = True ,
174174 fftshift = False ,
175175 )
176+ # calc B-envelope and apply
177+ b_envelope_tmp = b_envelope (
178+ B = kwargs ["ctf_B_factor" ],
179+ image_shape = template_shape ,
180+ pixel_size = kwargs ["pixel_size" ],
181+ rfft = True ,
182+ fftshift = False ,
183+ device = tmp .device ,
184+ )
185+ tmp *= b_envelope_tmp
176186 ctf_list .append (tmp )
177187
178188 ctf = torch .stack (ctf_list , dim = 0 )
You can’t perform that action at this time.
0 commit comments