A template-to-slice block matching approach for automatic localization of brain in fetal MRI