047cedb17ee34680910e4270cc338d4f961b545b,cellprofiler/modules/rescaleintensity.py,RescaleIntensity,stretch,#RescaleIntensity#Any#,331

Before Change


        if input_image.has_mask:
            return centrosome.filter.stretch(input_image.pixel_data, input_image.mask)
        else:
            return centrosome.filter.stretch(input_image.pixel_data)

    def manual_input_range(self, input_image, workspace):
        """Stretch the input image from the requested range to 0:1"""

After Change


    def stretch(self, input_image):
        data = input_image.pixel_data

        mask = numpy.ones_like(data, dtype=numpy.bool)

        if input_image.has_mask:
            mask = input_image.mask

        in_range = (min(data[mask]), max(data[mask]))

        out_range = (0.0, 1.0)

        data[~mask] = 0

        rescaled = skimage.exposure.rescale_intensity(data, in_range=in_range, out_range=out_range)

        rescaled[~mask] = input_image.pixel_data[~mask]

        return rescaled

    def manual_input_range(self, input_image, workspace):
        """Stretch the input image from the requested range to 0:1"""
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: CellProfiler/CellProfiler
Commit Name: 047cedb17ee34680910e4270cc338d4f961b545b
Time: 2016-12-01
Author: mcquin@broadinstitute.org
File Name: cellprofiler/modules/rescaleintensity.py
Class Name: RescaleIntensity
Method Name: stretch


Project Name: pytorch/pytorch
Commit Name: a347c747df8302acc0007a26f23ecf3355a5bef9
Time: 2021-01-25
Author: fritz.obermeyer@gmail.com
File Name: torch/distributions/transforms.py
Class Name: ComposeTransform
Method Name: codomain


Project Name: pytorch/pytorch
Commit Name: a347c747df8302acc0007a26f23ecf3355a5bef9
Time: 2021-01-25
Author: fritz.obermeyer@gmail.com
File Name: torch/distributions/transforms.py
Class Name: ComposeTransform
Method Name: domain