tomodrgn.commands.train_vae.preprocess_batch#
- preprocess_batch(*, lat: Lattice, batch_images: Tensor, batch_trans: Tensor, batch_ctf_params: Tensor, image_ctf_premultiplied: bool) tuple[Tensor, Tensor | None] [source]#
Center images via translation and phase flip for partial CTF correction, as needed
- Parameters:
lat – Hartley-transform lattice of points for voxel grid operations
batch_images – Batch of images to be used for training, shape (batchsize, ntilts, boxsize_ht, boxsize_ht)
batch_trans – Batch of 2-D translation matrices corresponding to batch_images known poses, shape (batchsize, ntilts, 2). May be torch.zeros((batchsize)) instead to indicate no translations should be applied to the input images.
batch_ctf_params – Batch of CTF parameters corresponding to batch_images known CTF parameters, shape (batchsize, ntilts, 9). May be torch.zeros((batchsize)) instead to indicate no CTF corruption should be applied to the reconstructed slice.
image_ctf_premultiplied – Whether images were multiplied by their CTF during particle extraction.
- Return batch_images:
translationally-centered and phase-flipped batch of images to be used for training, shape (batchsize, ntilts, boxsize_ht**2)
- Return batch_ctf_weights:
CTF evaluated at each spatial frequency corresponding to input images, shape (batchsize, ntilts, boxsize_ht**2) or None if no CTF should be applied