ccb227291ac951205df5fdf5812298606e0aa26f,lazyflow/operators/classifierOperators.py,OpTrainPixelwiseClassifierBlocked,execute,#OpTrainPixelwiseClassifierBlocked#Any#Any#Any#Any#,133

Before Change


                assert halo_shape[-1] == 0, "Didn"t expect a non-zero halo for channel dimension."

                // Expand block by halo, then clip to image bounds
                block_label_roi = numpy.array( block_label_roi )
                block_label_roi[0] -= halo_shape
                block_label_roi[1] += halo_shape
                block_label_roi = getIntersection( block_label_roi, roiFromShape(image_slot.meta.shape) )

                block_image_roi = numpy.array( block_label_roi )
                assert (block_image_roi[:, -1] == [0,1]).all()
                num_channels = image_slot.meta.shape[-1]

After Change


                block_label_bb_roi = bb_roi_within_block + block_label_roi[0]

                // Double-check that there is at least 1 non-zero label in the block.
                if (block_label_bb_roi[1] > block_label_bb_roi[0]).all():
                    // Ask for the halo needed by the classifier
                    axiskeys = image_slot.meta.getAxisKeys()
                    halo_shape = classifier_factory.get_halo_shape(axiskeys)
                    assert len(halo_shape) == len( block_label_roi[0] )
                    assert halo_shape[-1] == 0, "Didn"t expect a non-zero halo for channel dimension."
    
                    // Expand block by halo, but keep clipped to image bounds
                    padded_label_roi, bb_roi_within_padded = enlargeRoiForHalo( *block_label_bb_roi, 
                                                                                shape=label_slot.meta.shape,
                                                                                sigma=halo_shape,
                                                                                window=1,
                                                                                return_result_roi=True )
                    
                    // Copy labels to new array, which has size == bounding-box + halo
                    padded_label_data = numpy.zeros( padded_label_roi[1] - padded_label_roi[0], label_slot.meta.dtype )                
                    padded_label_data[roiToSlice(*bb_roi_within_padded)] = block_label_data[roiToSlice(*bb_roi_within_block)]
    
                    padded_image_roi = numpy.array( padded_label_roi )
                    assert (padded_image_roi[:, -1] == [0,1]).all()
                    num_channels = image_slot.meta.shape[-1]
                    padded_image_roi[:, -1] = [0, num_channels]
    
                    // Ensure the results are plain ndarray, not VigraArray, 
                    //  which some classifiers might have trouble with.
                    padded_image_data = numpy.asarray( image_slot(*padded_image_roi).wait() )
                    
                    label_data_blocks.append( padded_label_data )
                    image_data_blocks.append( padded_image_data )

        if len(image_data_blocks) == 0:
            result[0] = None
        else:
            axistags = self.Images[0].meta.axistags
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: ilastik/ilastik
Commit Name: ccb227291ac951205df5fdf5812298606e0aa26f
Time: 2015-03-19
Author: bergs@janelia.hhmi.org
File Name: lazyflow/operators/classifierOperators.py
Class Name: OpTrainPixelwiseClassifierBlocked
Method Name: execute


Project Name: HazyResearch/fonduer
Commit Name: 1d6771befb95f4ae94f308899633294a003dcfd6
Time: 2020-07-24
Author: hiromu.hota@hal.hitachi.com
File Name: src/fonduer/utils/data_model_utils/structural.py
Class Name:
Method Name: common_ancestor


Project Name: ilastik/ilastik
Commit Name: ccb227291ac951205df5fdf5812298606e0aa26f
Time: 2015-03-19
Author: bergs@janelia.hhmi.org
File Name: lazyflow/operators/classifierOperators.py
Class Name: OpTrainPixelwiseClassifierBlocked
Method Name: execute


Project Name: HazyResearch/fonduer
Commit Name: 1d6771befb95f4ae94f308899633294a003dcfd6
Time: 2020-07-24
Author: hiromu.hota@hal.hitachi.com
File Name: src/fonduer/utils/data_model_utils/structural.py
Class Name:
Method Name: lowest_common_ancestor_depth