Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
8577e1d
Update FLE tests now that cufinufft improved
garrettwrong Oct 21, 2025
8df0fde
update test data files
j-c-c Oct 21, 2025
96d442f
save data files with npz format. Refactor tests to handle npz diction…
j-c-c Oct 22, 2025
5cc94ee
Adjust adjoint test rtol. cleanup test fixtures
j-c-c Oct 23, 2025
1d67fbb
move estimate_third_rows to util file
j-c-c Aug 22, 2025
451aeda
migrate estimate_inplane_rotations, complete_third_row_to_rot to comm…
j-c-c Aug 25, 2025
5562e23
migrate syncmatrix_ij_vote_3n to SyncVotingMixin. Remove C3C4 implime…
j-c-c Aug 25, 2025
34f82da
remove unused import
j-c-c Aug 26, 2025
56ecfc5
Nasty Nasty bug
garrettwrong Nov 11, 2025
fd71a0e
Checkpoint, shifts close to MATLAB
garrettwrong Nov 11, 2025
eee57a6
checkpoint before working backwards
garrettwrong Nov 12, 2025
e7bf5bd
initial cleanup
garrettwrong Nov 12, 2025
49e9a97
apply sign conventions
garrettwrong Nov 12, 2025
d949ca9
tox
garrettwrong Nov 12, 2025
410708f
resolve easy items
garrettwrong Nov 13, 2025
cea4ccc
move equations_factor and max_memory to CL init
garrettwrong Nov 13, 2025
6c3ee50
move equations_factor and max_memory to CL init
garrettwrong Nov 13, 2025
4244253
melding full MATLAB port backwards with py code
garrettwrong Nov 13, 2025
ace5c42
rm unused function from debugging
garrettwrong Nov 13, 2025
fdec58f
revert forcing the matlab offset search space
garrettwrong Nov 14, 2025
242ac70
pass through memory lim kwargs
garrettwrong Nov 14, 2025
efcd82f
update tests
garrettwrong Nov 17, 2025
1fb5306
pass through kwargs
garrettwrong Nov 17, 2025
80438d2
mark slow tests expensive
garrettwrong Nov 17, 2025
ff92643
add shift pass through test
garrettwrong Nov 17, 2025
c63b6ca
xfail another flaky shift test for 1340
garrettwrong Nov 19, 2025
e6dcc23
Revert MATLAB PFT freq grid convention
garrettwrong Nov 20, 2025
af19b1d
bump numpy>=1.25.0
j-c-c Nov 25, 2025
f35b65b
pin env*.yml np version
j-c-c Dec 1, 2025
c92fa17
bump scipy accel envs
j-c-c Dec 1, 2025
e77a68b
update class alignment attrs
garrettwrong Dec 4, 2025
d3145a8
leave progress False
garrettwrong Dec 4, 2025
9d4f8c0
add selection message
garrettwrong Dec 4, 2025
d7414d4
Update class avg tutorial documentation
garrettwrong Dec 5, 2025
a823331
override scikit inverse_transform to allow for complex values
j-c-c Dec 10, 2025
bcf06c2
update macos runner to 15
j-c-c Dec 10, 2025
8ccdbc3
macos 14
j-c-c Dec 11, 2025
12d94e8
CL reorg - squash
j-c-c Dec 1, 2025
efd6d4e
initial ImageSource.save with optics block
j-c-c Oct 16, 2025
0c16778
add _rlnImageSize column to metadata when saving.
j-c-c Oct 23, 2025
421fcf5
Add _rlnImageSize to coordinate source test.
j-c-c Oct 24, 2025
d89b033
use rlnImageName to get n_rows
j-c-c Oct 24, 2025
fc511a1
test for sim save with optics block
j-c-c Oct 24, 2025
d0c8c4a
add _rlnImageDimensionality
j-c-c Oct 27, 2025
2650d6b
test save/load roundtrip w/ phase_flip.
j-c-c Oct 27, 2025
fb74873
update coord source test
j-c-c Oct 27, 2025
7c6b7f9
cleanup
j-c-c Oct 27, 2025
f18f91e
remove unused var
j-c-c Oct 28, 2025
eaaad6c
missing optics fields warning. warning test. code comments.
j-c-c Oct 28, 2025
58d0f14
removed unused import.
j-c-c Oct 28, 2025
c0c89b9
deprecate _rlnAmplitude in favor of private __amplitude field.
j-c-c Oct 30, 2025
4e69109
use _aspireAmplitude to retain ampitudes for saved files
j-c-c Oct 31, 2025
3165bbc
ensure pixel size is added to mrc header
j-c-c Nov 3, 2025
c7338c9
test mrc pixel_size in header
j-c-c Nov 3, 2025
f709882
Use defaultdict
j-c-c Nov 5, 2025
d335d29
Remove old file compatibility
j-c-c Nov 5, 2025
79780d1
Remove _aspireAmplitude from relion_metadata_fields dict.
j-c-c Nov 5, 2025
6fd4a56
Test save on source slices
j-c-c Nov 7, 2025
47a5343
Always write an optics block
j-c-c Nov 13, 2025
d7d03c8
Gallery example simulation -> relion
j-c-c Nov 14, 2025
e18279a
clean up gallery
j-c-c Nov 14, 2025
ecce5a9
_aspireMetadata 'no_ctf' tag for missing optics fields. Detect ASPIRE…
j-c-c Nov 14, 2025
74fe99b
test cleanup
j-c-c Nov 14, 2025
5e21f68
optics group level not_ctf flag
j-c-c Nov 18, 2025
d4c2b4d
clean up gallery
j-c-c Nov 20, 2025
9bcba11
tox
j-c-c Nov 20, 2025
215204a
typo
j-c-c Nov 20, 2025
700cedf
gallery comment update
j-c-c Nov 20, 2025
8cb721c
float64 amplitude code comment
j-c-c Dec 12, 2025
333a608
init add faasrot
garrettwrong Nov 25, 2025
243358b
cp faasrot dbg code
garrettwrong Nov 25, 2025
77006f7
initial faasrot code/test add
garrettwrong Nov 25, 2025
9cc71a8
dbg
garrettwrong Nov 25, 2025
29ff4a1
add smoke test and xp
garrettwrong Nov 25, 2025
98a7101
xp cleanup
garrettwrong Nov 25, 2025
04efe75
cleanup and extension
garrettwrong Dec 4, 2025
ac9a445
polishing fastrotate
garrettwrong Dec 5, 2025
433f916
first pass polish Image.rotate
garrettwrong Dec 5, 2025
597e4ae
initial add scipy.ndimage.rotate
garrettwrong Dec 5, 2025
61ce391
extend test, but still need to improve it
garrettwrong Dec 5, 2025
d7c8194
rm unused import
garrettwrong Dec 8, 2025
a6bb281
more analytic image rot test
garrettwrong Dec 9, 2025
95b773b
comment cleanup
garrettwrong Dec 9, 2025
7b9700a
cleanup
garrettwrong Dec 9, 2025
d25a66a
more cleanup
garrettwrong Dec 9, 2025
e665023
attempt to fix theta bcast bug
garrettwrong Dec 10, 2025
59f8666
actually fix the bug this time
garrettwrong Dec 11, 2025
549746b
add tests for additional unsupported input cases
garrettwrong Dec 11, 2025
4c95c4a
tox doesn't like ##
garrettwrong Dec 11, 2025
55d7d92
Add M+theta arg error and test
garrettwrong Dec 12, 2025
6efd7b6
Bump version: 0.14.1 → 0.14.2
garrettwrong Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.14.1
current_version = 0.14.2
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jobs:
shell: bash -el {0}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-22.04, macOS-latest, macOS-13]
os: [ubuntu-latest, ubuntu-22.04, macOS-latest, macOS-14]
backend: [default, openblas]
python-version: ['3.9']
include:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5657281.svg)](https://doi.org/10.5281/zenodo.5657281)
[![Downloads](https://static.pepy.tech/badge/aspire/month)](https://pepy.tech/project/aspire)

# ASPIRE - Algorithms for Single Particle Reconstruction - v0.14.1
# ASPIRE - Algorithms for Single Particle Reconstruction - v0.14.2

The ASPIRE-Python project supersedes [Matlab ASPIRE](https://github.com/PrincetonUniversity/aspire).

Expand All @@ -20,7 +20,7 @@ For more information about the project, algorithms, and related publications ple
Please cite using the following DOI. This DOI represents all versions, and will always resolve to the latest one.

```
ComputationalCryoEM/ASPIRE-Python: v0.14.1 https://doi.org/10.5281/zenodo.5657281
ComputationalCryoEM/ASPIRE-Python: v0.14.2 https://doi.org/10.5281/zenodo.5657281

```

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = version = "0.14.1"
release = version = "0.14.2"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Aspire v0.14.1
Aspire v0.14.2
==============

Algorithms for Single Particle Reconstruction
Expand Down
4 changes: 2 additions & 2 deletions environment-accelerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ channels:
dependencies:
- pip
- python=3.9
- numpy=1.24.1
- scipy=1.10.1
- numpy=1.25.0
- scipy=1.13.1
- scikit-learn
- scikit-image
- libblas=*=*accelerate
4 changes: 2 additions & 2 deletions environment-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channels:
dependencies:
- pip
- python=3.9
- numpy=1.23.5
- scipy=1.9.3
- numpy=1.25.0
- scipy=1.13.1
- scikit-learn
- scikit-image
4 changes: 2 additions & 2 deletions environment-intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ channels:
dependencies:
- pip
- python=3.9
- numpy=1.23.5
- scipy=1.9.3
- numpy=1.25.0
- scipy=1.13.1
- scikit-learn
- scikit-image
- mkl_fft
Expand Down
4 changes: 2 additions & 2 deletions environment-openblas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ channels:
dependencies:
- pip
- python=3.9
- numpy=1.23.5
- scipy=1.9.3
- numpy=1.25.0
- scipy=1.13.1
- scikit-learn
- scikit-image
- libblas=*=*openblas
4 changes: 2 additions & 2 deletions environment-win64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ channels:
dependencies:
- pip
- python=3.9
- numpy=1.23.5
- scipy=1.9.3
- numpy=1.25.0
- scipy=1.13.1
- scikit-learn
- scikit-image
- mkl=2024.1.* # possible regression impacts eig solver in later versions up to 2025.0
80 changes: 80 additions & 0 deletions gallery/experiments/save_simulation_relion_reconstruct.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
"""
Simulated Stack to RELION Reconstruction
========================================

This experiment shows how to:

1. build a synthetic dataset with ASPIRE,
2. write the stack via ``ImageSource.save`` so RELION can consume it, and
3. call :code:`relion_reconstruct` on the saved STAR file.
"""

# %%
# Imports
# -------

import logging
from pathlib import Path

import numpy as np

from aspire.downloader import emdb_2660
from aspire.noise import WhiteNoiseAdder
from aspire.operators import RadialCTFFilter
from aspire.source import Simulation

logger = logging.getLogger(__name__)


# %%
# Configuration
# -------------
# We set a few parameters to initialize the Simulation.
# You can safely alter ``n_particles`` (or change the defocus values, etc.) when
# trying this interactively; the defaults here are chosen for demonstrative purposes.

output_dir = Path("relion_save_demo")
output_dir.mkdir(exist_ok=True)

n_particles = 512
snr = 0.5
defocus = np.linspace(
15000, 25000, 7
) # defocus values for the radial CTF filters (angstroms)
star_file = f"sim_n{n_particles}.star"
star_path = output_dir / star_file

# %%
# Volume and Filters
# ------------------
# Start from the EMDB-2660 ribosome map and build a small set of radial CTF filters
# that RELION will recover as optics groups.

vol = emdb_2660()
ctf_filters = [RadialCTFFilter(defocus=d) for d in defocus]


# %%
# Simulate, Add Noise, Save
# -------------------------
# Initialize the Simulation:
# mix the CTFs across the stack, add white noise at a target SNR,
# and write the particles and metadata to a RELION-compatible STAR/MRC stack.

sim = Simulation(
n=n_particles,
vols=vol,
unique_filters=ctf_filters,
noise_adder=WhiteNoiseAdder.from_snr(snr),
)
sim.save(star_path, overwrite=True)


# %%
# Running ``relion_reconstruct``
# ------------------------------
# ``relion_reconstruct`` is an external RELION command, so we just show the call.
# Run this, from the output directory, in a RELION-enabled shell after generating
# the STAR file above.

logger.info(f"relion_reconstruct --i {star_file} " f"--o 'relion_recon.mrc' --ctf")
8 changes: 7 additions & 1 deletion gallery/tutorials/tutorials/class_averaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
est_shifts = avgs.averager.shifts
est_dot_products = avgs.averager.dot_products

# These are dictionaries mapping each class to arrays of attributes.
print(f"Estimated Rotations: {est_rotations}")
print(f"Estimated Shifts: {est_shifts}")
print(f"Estimated Dot Products: {est_dot_products}")
Expand All @@ -241,7 +242,12 @@
original_img_nbr = noisy_src.images[original_img_nbr_idx].asnumpy()[0]

# Rotate using estimated rotations.
angle = est_rotations[0, nbr] * 180 / np.pi
# First retrieve all angles for the `review_class` (original_img_0_idx),
# then lookup the specific neighbor `nbr`
assert (
original_img_0_idx == review_class
), "DebugClassAvgSource should retain original source image ordering"
angle = est_rotations[original_img_0_idx][nbr] * 180 / np.pi
if reflections[nbr]:
print("Reflection reported.")
original_img_nbr = np.flipud(original_img_nbr)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "aspire"
version = "0.14.1"
version = "0.14.2"
description = "Algorithms for Single Particle Reconstruction"
readme = "README.md" # Optional
requires-python = ">=3.9"
Expand Down Expand Up @@ -37,7 +37,7 @@ dependencies = [
"joblib",
"matplotlib >= 3.2.0",
"mrcfile",
"numpy>=1.21.5",
"numpy>=1.25.0",
"packaging",
"pooch>=1.7.0",
"pillow",
Expand Down
2 changes: 1 addition & 1 deletion src/aspire/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from aspire.exceptions import handle_exception

# version in maj.min.bld format
__version__ = "0.14.1"
__version__ = "0.14.2"


# Setup `confuse` config
Expand Down
Loading
Loading