Skip to content

ImageSource.images() can only load sequential images #524

Closed
@chris-langfield

Description

@chris-langfield

ImageSource.images() takes mandatory start and num parameters.

However, after start and num are specified, an indices array is created via:

 indices = np.arange(start, min(start + num, self.n), dtype=int)

This is then passed as a kwarg to the subclass _images().

This makes it impossible to ask for specific, nonsequential indices when calling the public method:

>>> src = RelionSource("sample_relion_data.star")
>>> src.images(indices=[7,2,14,10])
TypeError: images() missing 2 required positional arguments: 'start' and 'num'
>>> src.images(0,17, indices=[7,2,14,10])
TypeError: _images() got multiple values for keyword argument 'indices'

The private _images methods of ImageSource subclasses, including RelionSource, are written in a way that allows for the indices to be nonsequential. The only way to ask for indices in this way is to call the private method, but we would like the public method to be able to do this.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions