3df28dc6f0bb0704febd6bd1467bb728f4fbe771,cellprofiler/modules/measuretexture.py,MeasureTexture,run_one,#MeasureTexture#Any#Any#Any#Any#,490

Before Change


        features = numpy.empty((n_directions, 13, len(unique_labels)))

        for index, label in enumerate(unique_labels):
            label_data = numpy.zeros_like(pixel_data)
            label_data[labels == label] = pixel_data[labels == label]

            try:
                features[:, :, index] = mahotas.features.haralick(
                    label_data, distance=scale, ignore_zeros=True
                )
            except ValueError:
                features[:, :, index] = numpy.nan

        for direction, direction_features in enumerate(features):

After Change


        // mahotas.features.haralick bricks itself when provided a dtype larger than uint8 (version 1.4.3)
        pixel_data = skimage.exposure.rescale_intensity(pixel_data,out_range=(0,gray_levels-1)).astype(numpy.uint8)
        props = skimage.measure.regionprops(labels, pixel_data)
        per_label = [self.run_mahotas(prop, scale, n_directions) for prop in props]
        features = dask.compute(per_label, scheduler="threads")
        features = numpy.array(features)[0].transpose(1,2,0)

        for direction, direction_features in enumerate(features):
            for feature_name, feature in zip(F_HARALICK, direction_features):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: CellProfiler/CellProfiler
Commit Name: 3df28dc6f0bb0704febd6bd1467bb728f4fbe771
Time: 2020-08-13
Author: beth.cimini@gmail.com
File Name: cellprofiler/modules/measuretexture.py
Class Name: MeasureTexture
Method Name: run_one


Project Name: tensorflow/models
Commit Name: 2de7692ddeffef0f0e965e1f8cca7463df19033a
Time: 2018-05-09
Author: mironov@gmail.com
File Name: research/differential_privacy/privacy_accountant/python/rdp_accountant.py
Class Name:
Method Name: compute_rdp


Project Name: HyperGAN/HyperGAN
Commit Name: 35d9aa8a6d11ac5c30d0be81ed3b1be9ce503ec1
Time: 2018-07-31
Author: mikkel@255bits.com
File Name: hypergan/trainers/fitness_trainer.py
Class Name: FitnessTrainer
Method Name: _create