rg314 / pytraction

Bayesian Traction Force Microscopy
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

ValueError: operands could not be broadcast together with shapes (56,28) (28,56) #7

Open rg314 opened 3 years ago

rg314 commented 3 years ago

For non-square images the following exception is raised:

ValueError: operands could not be broadcast together with shapes (56,28) (28,56)

This is caused by the following lines

#pytraction\reg_fourier.py
        Ftfx = Ginv_xx*Ftux + Ginv_xy*Ftuy
        Ftfy = Ginv_xy*Ftux + Ginv_yy*Ftuy

It can be solved by

#pytraction\fourier.py
    # Fourier transform displacement field
    ftux = np.fft.fft2(u[:,:,0]).T
    ftuy = np.fft.fft2(u[:,:,1]).T

However, the final traction map needs to be transposed again.