Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions menus/Grain-Segment/Segmentation/segmentation_plgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class FilterImage(Median):
def load(self, ips):
super().load(ips)
ips.data = DuplicateNoGUI.copy(ips, ips.title) # create a copy from the original image
ips.title = ips.title + '-filtered' # rename original image
ips.title = f'{ips.title}-filtered'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FilterImage.load refactored with the following changes:

This removes the following comments ( why? ):

# rename original image

return True

def run(self, ips, snap, img, para = None):
Expand All @@ -75,7 +75,10 @@ def run(self, ips, snap, img, para=None):
storage.segment_mask = segment_mask
print(np.amax(segment_mask))
# The final image is opened on a new tab
IPy.show_img([color.label2rgb(segment_mask, storage.original_image, kind='avg')], ips.title + '-segmented')
IPy.show_img(
[color.label2rgb(segment_mask, storage.original_image, kind='avg')],
f'{ips.title}-segmented',
)
Comment on lines -78 to +81
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function InitialSegmentation.run refactored with the following changes:



class MergeClusters(RagThreshold):
Expand Down
5 changes: 1 addition & 4 deletions src/grain_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ def initial_segmentation(self, *args):
Label image, output of the quick shift algorithm.
"""

if args:
image = args[0]
else:
image = self.original_image
image = args[0] if args else self.original_image
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function GrainSegmentation.initial_segmentation refactored with the following changes:

segment_mask = segmentation.quickshift(image)
if self.__interactive_mode:
io.imshow(color.label2rgb(segment_mask, self.original_image, kind='avg'))
Expand Down