Hello,
I’m playing with the scratch wound assay pipeline and thought it would be neat to make a movie with the Tissue objects overlayed as filled objects rather than outlines.
At the bottom, I provide a dropbox link to my quick attempt at modifying overlayoutlines.py
Where I’m stumped is that there is a OULTINE_COLOR attribute for outlines but not for the fill color. Specifying CPLD_MODE: CPLDM_ALPHA colours each object according to the CPLD_ALPHA_COLORMAP.
Could you add a FILL_COLOR property? Or am I missing something and there is a way round? This is the bit of code I added (for the display, I haven’t altered the code for the image returned yet):
if self.wants_filled.value == WANTS_FILLED:
d = { CPLD_NAME:name,
CPLD_LABELS:ldict[name],
CPLD_OUTLINE_COLOR: color,
CPLD_MODE: CPLDM_ALPHA,
CPLD_LINE_WIDTH: 0, #self.line_width.value,
CPLD_ALPHA_VALUE: self.object_opacity.value/100.}
else:
d = { CPLD_NAME:name,
CPLD_LABELS:ldict[name],
CPLD_OUTLINE_COLOR: color,
CPLD_MODE: CPLDM_OUTLINES,
CPLD_LINE_WIDTH: self.line_width.value }
cplabels.append(d)
Problems attaching files, must me my first post.
The code:
https://www.dropbox.com/s/r5sxvnuqd6lmk6u/ezoverlayoutlines.py?dl=0
The result so far (would like both sides to be overlayed in red):
https://www.dropbox.com/s/akl2cze3lcjxx5n/overlay.png?dl=0
EDIT OK, looking further into the get_outline() method, and if I understand this correctly, I need test the values returned by distance_transform_edt to basically say “any pixel within the objects” rather than “pixels within a width distance from the border”. Then there’s the alpha value to take care of for the overlay. Complicated!
Kind regards,
Egor