6bbb1ad50fcf5e5f514de815b91ef63184dbe8db,pyCellProfiler/cellprofiler/modules/measureobjectintensity.py,MeasureObjectIntensity,run,#MeasureObjectIntensity#Any#,268

Before Change


                
                if nobjects > 0:
                    assert img.min() >= 0,"Algorithm requires image values between 0 and 1"
                    assert img.max() <= 1,"Algorithm requires image values between 0 and 1"
                    areas = fix(nd.sum(np.ones(labels.shape,int),
                                       labels, np.arange(nobjects+1)))
                    areas = areas.astype(int)
                    indices = np.cumsum(areas)[:-1]

After Change


                    indices = np.cumsum(areas)[:-1]
                    ordered_image = stretched_img + labels.astype(float)
                    ordered_image = ordered_image.flatten()
                    image_idx = np.argsort(ordered_image)
                    max_indices = (indices + areas[1:] - 1).astype(int)
                    indices_25  = indices+(areas[1:]+2)/4
                    indices_50  = indices+(areas[1:]+1)/2
                    indices_75  = indices+3*(areas[1:]+2) / 4
                    //
                    // Check for round-up overflow
                    //
                    for indices in (indices_25, indices_50, indices_75):
                        imask = indices > max_indices
                        indices[imask] = max_indices[imask]
                    lower_quartile_intensity = flat_img[image_idx[indices_25]]
                    median_intensity         = flat_img[image_idx[indices_50]]
                    upper_quartile_intensity = flat_img[image_idx[indices_75]]
                else:
                    lower_quartile_intensity = np.zeros((0,))
                    median_intensity = np.zeros((0,))
                    upper_quartile_intensity = np.zeros((0,))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: CellProfiler/CellProfiler
Commit Name: 6bbb1ad50fcf5e5f514de815b91ef63184dbe8db
Time: 2009-12-08
Author: leek@1fc53939-2000-0410-845c-e8453a809027
File Name: pyCellProfiler/cellprofiler/modules/measureobjectintensity.py
Class Name: MeasureObjectIntensity
Method Name: run


Project Name: pytorch/fairseq
Commit Name: 8f9dd964ca77ddbceafd1e1b74347d6781c096e1
Time: 2017-11-08
Author: myleott@fb.com
File Name: fairseq/data.py
Class Name:
Method Name: batches_by_size