From 3cfff7f76145747a40f51fe286fbd5006d24bcf6 Mon Sep 17 00:00:00 2001 From: Marco Barbieri <42785273+barma7@users.noreply.github.com> Date: Tue, 23 Oct 2018 17:32:54 -0700 Subject: [PATCH] Update femoral_cartilage.py fixed bug for split_regions method. Center of mass was evaluated considering also the background causing severe errors for medial and lateral estimation. --- tissues/femoral_cartilage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tissues/femoral_cartilage.py b/tissues/femoral_cartilage.py index fcd0a2e..88ae14c 100644 --- a/tissues/femoral_cartilage.py +++ b/tissues/femoral_cartilage.py @@ -174,11 +174,12 @@ def split_regions(self, unrolled_quantitative_map): unrolled_mask_indexes = np.nonzero(unrolled_quantitative_map) unrolled_mask = np.zeros((unrolled_quantitative_map.shape[0], unrolled_quantitative_map.shape[1])) unrolled_mask[unrolled_mask_indexes] = 1 - unrolled_mask[np.where(unrolled_mask < 1)] = 3 # find the center of mass of the unrolled mask center_of_mass = sni.measurements.center_of_mass(unrolled_mask) + unrolled_mask[np.where(unrolled_mask < 1)] = 3 + lateral_mask = np.copy(unrolled_mask)[:, 0:np.int(np.around(center_of_mass[1]))] medial_mask = np.copy(unrolled_mask)[:, np.int(np.around(center_of_mass[1])):]