09b2b1a7cab804077ad3bdaee2d86e6994ec8126,cellprofiler/modules/watershed.py,Watershed,run,#Watershed#Any#,107

Before Change


        if self.operation.value == "Distance":
            original_shape = x_data.shape

            if x.volumetric:
                x_data = skimage.transform.resize(x_data, (original_shape[0], 256, 256), order=0, mode="edge")

            distance = scipy.ndimage.distance_transform_edt(x_data)

            distance = mahotas.stretch(distance)

After Change


                    factors
                )

            threshold = skimage.filters.threshold_otsu(x_data)

            x_data = x_data > threshold

            distance = scipy.ndimage.distance_transform_edt(x_data)

            distance = mahotas.stretch(distance)

            surface = distance.max() - distance

            if x.volumetric:
                footprint = numpy.ones(
                    (
                        self.connectivity.value,
                        self.connectivity.value,
                        self.connectivity.value
                    )
                )
            else:
                footprint = numpy.ones(
                    (
                        self.connectivity.value,
                        self.connectivity.value
                    )
                )

            peaks = mahotas.regmax(distance, footprint)

            if x.volumetric:
                markers, _ = mahotas.label(peaks, numpy.ones((16, 16, 16)))
            else:
                markers, _ = mahotas.label(peaks, numpy.ones((16, 16)))

            y_data = mahotas.cwatershed(surface, markers)

            y_data = y_data * x_data

            if factor > 1:
                y_data = skimage.transform.resize(
                    y_data,
                    original_shape,
                    mode="edge",
                    order=0,
                    preserve_range=True
                )

                y_data = numpy.rint(y_data).astype(numpy.uint16)
        else:
            markers_name = self.markers_name.value

            markers = images.get_image(markers_name)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: CellProfiler/CellProfiler
Commit Name: 09b2b1a7cab804077ad3bdaee2d86e6994ec8126
Time: 2017-09-02
Author: allen.goodman@icloud.com
File Name: cellprofiler/modules/watershed.py
Class Name: Watershed
Method Name: run


Project Name: deepfakes/faceswap
Commit Name: d93e7b11140c11b43113686849a1c5c74d3a06f2
Time: 2019-10-18
Author: 36920800+torzdf@users.noreply.github.com
File Name: plugins/extract/align/_base.py
Class Name: Aligner
Method Name: finalize


Project Name: etal/cnvkit
Commit Name: cead97ee9d4855dce7f39fe1e828ce6dee88992e
Time: 2015-08-27
Author: eric.talevich@gmail.com
File Name: cnvlib/export.py
Class Name:
Method Name: segments2bed