Skip to content

Commit fd0ea73

Browse files
authored
Merge pull request #111 from Lucaslab-Berkeley/jd_update_extract
fix: Update breaking change in torch-fourier-slice
2 parents f857e6a + 3d874f4 commit fd0ea73

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dependencies = [
4848
"types-PyYAML",
4949
"roma",
5050
"tqdm",
51-
"torch-fourier-slice>=v0.2.0",
51+
"torch-fourier-slice>=v0.4.0",
5252
"torch-fourier-filter>=v0.2.6",
5353
"torch-so3>=v0.2.0",
5454
"ttsim3d>=v0.4.0",
@@ -153,7 +153,10 @@ pretty = true
153153
[tool.pytest.ini_options]
154154
minversion = "7.0"
155155
testpaths = ["tests"]
156-
filterwarnings = ["error"]
156+
filterwarnings = [
157+
"error",
158+
"ignore::FutureWarning",
159+
]
157160
addopts = "-m 'not slow'" # Skip slow tests on default
158161
markers = ["slow: marks test as slow"]
159162

src/leopard_em/backend/core_refine_template.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,6 @@ def cross_correlate_particle_stack(
839839
# Extract the Fourier slice and apply the projective filters
840840
fourier_slice = extract_central_slices_rfft_3d(
841841
volume_rfft=template_dft,
842-
image_shape=(template_h,) * 3,
843842
rotation_matrices=batch_rotation_matrices,
844843
)
845844
fourier_slice = torch.fft.ifftshift(fourier_slice, dim=(-2,))

src/leopard_em/backend/cross_correlation.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def do_streamed_orientation_cross_correlate(
7171
# Do a batched Fourier slice extraction for all the orientations at once.
7272
fourier_slices = extract_central_slices_rfft_3d(
7373
volume_rfft=template_dft,
74-
image_shape=(projection_shape_real[0],) * 3,
7574
rotation_matrices=rotation_matrices,
7675
)
7776
fourier_slices = torch.fft.ifftshift(fourier_slices, dim=(-2,))
@@ -202,7 +201,6 @@ def do_batched_orientation_cross_correlate(
202201
# Extract central slice(s) from the template volume
203202
fourier_slice = extract_central_slices_rfft_3d(
204203
volume_rfft=template_dft,
205-
image_shape=(projection_shape_real[0],) * 3, # NOTE: requires cubic template
206204
rotation_matrices=rotation_matrices,
207205
)
208206
fourier_slice = torch.fft.ifftshift(fourier_slice, dim=(-2,))
@@ -279,7 +277,6 @@ def do_batched_orientation_cross_correlate_cpu(
279277
# Extract central slice(s) from the template volume
280278
fourier_slice = extract_central_slices_rfft_3d(
281279
volume_rfft=template_dft,
282-
image_shape=(projection_shape_real[0],) * 3, # NOTE: requires cubic template
283280
rotation_matrices=rotation_matrices,
284281
)
285282
fourier_slice = torch.fft.ifftshift(fourier_slice, dim=(-2,))

src/leopard_em/utils/fourier_slice.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def get_rfft_slices_from_volume(
7171
The Fourier slices of the volume.
7272
7373
"""
74-
shape = volume.shape
7574
volume_rfft = torch.fft.fftshift(volume, dim=(-3, -2, -1)) # pylint: disable=not-callable
7675
volume_rfft = torch.fft.fftn(volume_rfft, dim=(-3, -2, -1)) # pylint: disable=not-callable
7776
volume_rfft = torch.fft.fftshift(volume_rfft, dim=(-3, -2)) # pylint: disable=not-callable
@@ -82,7 +81,6 @@ def get_rfft_slices_from_volume(
8281
# Use torch_fourier_slice to take the Fourier slice
8382
fourier_slices = extract_central_slices_rfft_3d(
8483
volume_rfft=volume_rfft,
85-
image_shape=shape,
8684
rotation_matrices=rot_matrix,
8785
)
8886

0 commit comments

Comments
 (0)