Skip to content

Commit

Permalink
Update femoral_cartilage.py
Browse files Browse the repository at this point in the history
fixed bug for split_regions method.
Center of mass was evaluated considering also the background causing severe errors for medial and lateral estimation.
  • Loading branch information
barma7 committed Oct 24, 2018
1 parent 550ab98 commit 3cfff7f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tissues/femoral_cartilage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])):]

Expand Down

0 comments on commit 3cfff7f

Please sign in to comment.