Fixed bug with dialog box not working as expected
Adapted heterogeneity calculation to work with
GUI, streamlined many sections to avoid user interaction. Potentially removed edge artifacts. Some issues still exist and results not identical to original implementation