コード例 #1
0
    def create_settings(self):
        super(ErodeObjects, self).create_settings()

        self.structuring_element = StructuringElement(
            allow_planewise=True, doc=HELP_FOR_STREL
        )

        self.preserve_midpoints = Binary(
            "Prevent object removal",
            True,
            doc="""
If set to "Yes", the central pixels for each object will not be eroded. This ensures that 
objects are not lost. The preserved pixels are those furtherst from the object's edge, so 
in some objects this may be a cluster of pixels with equal distance to the edge.
If set to "No", erosion can completely remove smaller objects.""",
        )

        self.relabel_objects = Binary(
            "Relabel resulting objects",
            False,
            doc="""
Large erosion filters can sometimes remove a small object or cause an irregularly shaped object 
to be split into two. This can cause problems in some other modules. Selecting "Yes" will assign 
new label numbers to resulting objects. This will ensure that there are no 'missing' labels 
(if object '3' is gone, object '4' will be reassigned to that number). However, this also means 
that parts of objects which were split and are no longer touching will be given new, individual 
label numbers.""",
        )
コード例 #2
0
    def create_settings(self):
        super(Closing, self).create_settings()

        self.structuring_element = StructuringElement(
            allow_planewise=True, doc=HELP_FOR_STREL
        )