Commit 6a586fc72c48af4e4392c6b478be75b06a8889f8

Authored by Thiago Franco de Moraes
1 parent 33b14f6f

Fill, select and remove mask parts were not working with mask generated by watershed

Showing 1 changed file with 18 additions and 3 deletions   Show diff stats
invesalius/data/styles.py
@@ -1658,8 +1658,13 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): @@ -1658,8 +1658,13 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle):
1658 self.config = FFillConfig() 1658 self.config = FFillConfig()
1659 self.dlg_ffill = None 1659 self.dlg_ffill = None
1660 1660
  1661 + # InVesalius uses the following values to mark non selected parts in a
  1662 + # mask:
  1663 + # 0 - Threshold
  1664 + # 1 - Manual edition and floodfill
  1665 + # 2 - Watershed
1661 self.t0 = 0 1666 self.t0 = 0
1662 - self.t1 = 1 1667 + self.t1 = 2
1663 self.fill_value = 254 1668 self.fill_value = 254
1664 1669
1665 self._dlg_title = _(u"Fill holes") 1670 self._dlg_title = _(u"Fill holes")
@@ -1750,7 +1755,12 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): @@ -1750,7 +1755,12 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle):
1750 class RemoveMaskPartsInteractorStyle(FloodFillMaskInteractorStyle): 1755 class RemoveMaskPartsInteractorStyle(FloodFillMaskInteractorStyle):
1751 def __init__(self, viewer): 1756 def __init__(self, viewer):
1752 FloodFillMaskInteractorStyle.__init__(self, viewer) 1757 FloodFillMaskInteractorStyle.__init__(self, viewer)
1753 - self.t0 = 254 1758 + # InVesalius uses the following values to mark selected parts in a
  1759 + # mask:
  1760 + # 255 - Threshold
  1761 + # 254 - Manual edition and floodfill
  1762 + # 253 - Watershed
  1763 + self.t0 = 253
1754 self.t1 = 255 1764 self.t1 = 255
1755 self.fill_value = 1 1765 self.fill_value = 1
1756 1766
@@ -1886,7 +1896,12 @@ class SelectMaskPartsInteractorStyle(DefaultInteractorStyle): @@ -1886,7 +1896,12 @@ class SelectMaskPartsInteractorStyle(DefaultInteractorStyle):
1886 self.config = SelectPartConfig() 1896 self.config = SelectPartConfig()
1887 self.dlg = None 1897 self.dlg = None
1888 1898
1889 - self.t0 = 254 1899 + # InVesalius uses the following values to mark selected parts in a
  1900 + # mask:
  1901 + # 255 - Threshold
  1902 + # 254 - Manual edition and floodfill
  1903 + # 253 - Watershed
  1904 + self.t0 = 253
1890 self.t1 = 255 1905 self.t1 = 255
1891 self.fill_value = 254 1906 self.fill_value = 254
1892 1907