-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Labels
invalidThis doesn't seem rightThis doesn't seem right
Description
ImageSource.filter_indices is a 1D Numpy array of length ImageSource.n indexing which CTF filter corresponds to which particle.
Currently the setter and getter decorators block this from being partially updated:
ASPIRE-Python/src/aspire/source/image.py
Lines 107 to 114 in 1bff8d3
| @property | |
| def filter_indices(self): | |
| return np.atleast_1d(self.get_metadata("__filter_indices")) | |
| @filter_indices.setter | |
| def filter_indices(self, indices): | |
| # create metadata of filters for all images | |
| return self.set_metadata(["__filter_indices"], indices) |
Example behavior
from aspire.source import ArrayImageSource
import numpy as np
src = ArrayImageSource(np.empty((5,5,5)))
src.filter_indices
>>> array([0, 0, 0, 0, 0])
src.filter_indices[0:3] = 1
src.filter_indices
>>> array([0, 0, 0, 0, 0])
src.filter_indices = np.array([1,1,1,0,0])
src.filter_indices
>>> array([1,1,1,0,0], dtype=object)I think this should be changed to allow partial update
Metadata
Metadata
Assignees
Labels
invalidThis doesn't seem rightThis doesn't seem right