Updated strain code

Updated strain code to make it more generic. Now it works for all
different image sizes, and tracked pixel densities.