Reconstructing holograms with shape that is non-square yields a ValueError from the Hologram.apodize method.
import numpy as np
import os.path
from shampoo import Hologram
FILEPATH = 'USAF_test.tif'
if __name__ == '__main__':
hologram = Hologram.from_tif(FILEPATH)
original_shape = hologram.hologram.shape
print('Image shape is square: {}'.format(original_shape))
reshaped_data = np.resize(hologram.hologram, new_shape = (original_shape[0], original_shape[1] - 10))
reshaped_hologram = Hologram(reshaped_data)
print('New shape is not square: {}'.format(reshaped_data.shape))
reconstructed = reshaped_hologram.reconstruct(propagation_distance = 0.03865)
This is a problem because some Allied Vision cameras have a resolution of 2550 x 2548