A mathematical approach to automatic megakaryocyte classification