Skip to content

Commit ebd7b0f

Browse files
committed
self review cleanup
1 parent 7113061 commit ebd7b0f

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

src/aspire/image/image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ def load_tiff(filepath):
130130

131131
# Future todo, extract `voxel_size` if available in TIFF tags (custom tag?)
132132
# For now, default to `None`.
133-
voxel_size = None
133+
pixel_size = None
134134

135135
# Cast image data as numpy array
136-
return np.array(img), voxel_size
136+
return np.array(img), pixel_size
137137

138138

139139
class Image:
@@ -160,7 +160,7 @@ def __init__(self, data, pixel_size=None, dtype=None):
160160
161161
:param data: Numpy array containing image data with shape
162162
`(..., resolution, resolution)`.
163-
:param pixel_size: Optional pixel size in Angstroms.
163+
:param pixel_size: Optional pixel size in angstroms.
164164
When provided will be saved with `mrc` metadata.
165165
Default of `None` will not write to file,
166166
but will be considered unit pixels (1) for FSC.

src/aspire/source/image.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def __init__(
170170
The path of the base directory to use as a data store or None. If None is given, no caching is performed.
171171
:param symmetry_group: A SymmetryGroup instance or string indicating the underlying symmetry of the molecule.
172172
Defaults to the `IdentitySymmetryGroup`, which represents an asymmetric particle, if none provided.
173-
:param pixel_size: Pixel size of the images in Angstroms, default `None`.
173+
:param pixel_size: Pixel size of the images in angstroms, default `None`.
174174
"""
175175

176176
# Instantiate the accessor for the `images` property
@@ -1673,6 +1673,7 @@ def __init__(
16731673
:param metadata: A Dataframe of metadata information corresponding to this ImageSource's images
16741674
:param angles: Optional n-by-3 array of rotation angles corresponding to `im`.
16751675
:param symmetry_group: A SymmetryGroup instance or string indicating the underlying symmetry of the molecule.
1676+
:param pixel_size: Pixel size of the images in angstroms, default `None`.
16761677
"""
16771678

16781679
if not isinstance(im, Image):

src/aspire/source/micrograph.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def __init__(self, micrographs, dtype=None, pixel_size=None):
122122
Currently only `float32` and `float64` are supported.
123123
Note, due to limitations of common MRC implementations,
124124
saving is limited to single precision.
125+
:param pixel_size: Pixel size of the images in angstroms, default `None`.
125126
"""
126127

127128
# Check micrographs is an array

src/aspire/source/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def __init__(
8080
:param noise_adder: Optionally append instance of `NoiseAdder`
8181
to generation pipeline.
8282
:param symmetry_group: A SymmetryGroup instance or string indicating symmetry of the molecule.
83-
:param pixel_size: Pixel size of the images in Angstroms, default `None`.
83+
:param pixel_size: Pixel size of the images in angstroms, default `None`.
8484
8585
:return: A Simulation object.
8686
"""

src/aspire/volume/volume.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __init__(self, data, dtype=None, pixel_size=None, symmetry_group=None):
7676
`(..., resolution, resolution, resolution)`.
7777
:param dtype: Optionally cast `data` to this dtype.
7878
Defaults to `data.dtype`.
79-
:param pixel_size: Optional voxel_size in Angstroms.
79+
:param pixel_size: Optional voxel_size in angstroms.
8080
When provided will be saved with `map`/`mrc` metadata.
8181
Default of `None` will not write to file,
8282
but will be considered unit pixels (1) for FSC.
@@ -262,7 +262,7 @@ def stack_reshape(self, *args):
262262
def __repr__(self):
263263
px_msg = "."
264264
if self.pixel_size is not None:
265-
px_msg = f" with pixel_size={self.pixel_size} Angstroms."
265+
px_msg = f" with pixel_size={self.pixel_size} angstroms."
266266

267267
msg = (
268268
f"{self.n_vols} {self.dtype} volumes arranged as a {self.stack_shape} stack"
@@ -420,7 +420,6 @@ def project(self, rot_matrices):
420420
im_f[:, :, 0] = 0
421421

422422
im_f = fft.centered_ifft2(im_f)
423-
# todo add pixel_size to Image
424423
return aspire.image.Image(xp.asnumpy(im_f.real), pixel_size=self.pixel_size)
425424

426425
def to_vec(self):

src/aspire/volume/volume_synthesis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848
:param C: Number of Volumes to generate.
4949
:param K: Number of Gaussian blobs used to construct the Volume(s).
5050
:param alpha: Scaling factor for variance of Gaussian blobs. Default=1.
51-
:param pixel_size: Optional voxel_size in Angstroms. Default=1.
51+
:param pixel_size: Optional voxel_size in angstroms. Default=1.
5252
:param seed: Random seed for generating random Gaussian blobs.
5353
:param dtype: dtype for Volume(s)
5454
"""
@@ -184,7 +184,7 @@ def __init__(
184184
:param C: Number of Volumes to generate.
185185
:param order: An integer representing the cyclic order of the Volume(s).
186186
:param K: Number of Gaussian blobs used to construct the Volume(s).
187-
:param pixel_size: Optional voxel_size in Angstroms. Default=1.
187+
:param pixel_size: Optional voxel_size in angstroms. Default=1.
188188
:param seed: Random seed for generating random Gaussian blobs.
189189
:param dtype: dtype for Volume(s)
190190
"""

0 commit comments

Comments
 (0)