@@ -338,10 +338,21 @@ def _images(self, start=0, num=np.inf, indices=None):
338338 "Subclasses should implement this and return an Image object"
339339 )
340340
341- def eval_filters (self , im_orig , start = 0 , num = np .inf , indices = None ):
341+ def _apply_filters (self , im_orig , start = 0 , num = np .inf , indices = None ):
342+ """
343+ For each image in `im_orig` specified by start, num, or indices,
344+ the unique_filters associated with the corresponding index in the
345+ `ImageSource` are applied. The images are then returned as an `Image`
346+ stack.
347+ :param im_orig: An `Image` object
348+ :param start: Starting index of images in `im_orig`.
349+ :param num: Number of images to work on, starting at `start`.
350+ :param indices: A numpy array of image indices. If specified,`start` and `num` are ignored.
351+ :return: An `Image` instance with the unique filters of the source applied at the given indices.
352+ """
342353 if not isinstance (im_orig , Image ):
343354 logger .warning (
344- f"eval_filters passed { type (im_orig )} instead of Image instance"
355+ f"_apply_filters() passed { type (im_orig )} instead of Image instance"
345356 )
346357 # for now just convert it
347358 im = Image (im_orig )
@@ -530,7 +541,7 @@ def im_backward(self, im, start):
530541 all_idx = np .arange (start , min (start + num , self .n ))
531542 im *= self .amplitudes [all_idx , np .newaxis , np .newaxis ]
532543 im = im .shift (- self .offsets [all_idx , :])
533- im = self .eval_filters (im , start = start , num = num )
544+ im = self ._apply_filters (im , start = start , num = num )
534545
535546 vol = im .backproject (self .rots [start : start + num , :, :])[0 ]
536547
@@ -552,7 +563,7 @@ def vol_forward(self, vol, start, num):
552563 logger .warning (f"Volume.dtype { vol .dtype } inconsistent with { self .dtype } " )
553564
554565 im = vol .project (0 , self .rots [all_idx , :, :])
555- im = self .eval_filters (im , start , num )
566+ im = self ._apply_filters (im , start , num )
556567 im = im .shift (self .offsets [all_idx , :])
557568 im *= self .amplitudes [all_idx , np .newaxis , np .newaxis ]
558569 return im
0 commit comments