def test_labels_to_matrix_example(self): fi = ants.image_read(ants.get_ants_data('r16')).resample_image( (60, 60), 1, 0) mask = fi > fi.mean() labs = ants.kmeans_segmentation(fi, 3)['segmentation'] labmat = ants.labels_to_matrix(labs, mask)
def test_labels_to_matrix_example(self): fi = ants.image_read(ants.get_ants_data("r16")).resample_image( (60, 60), 1, 0) mask = ants.get_mask(fi) labs = ants.kmeans_segmentation(fi, 3)["segmentation"] labmat = ants.labels_to_matrix(labs, mask)