2ef5ed836cd243c17d8c302fb872029a0289b32f,bin/medpy_binary_resampling.py,,shape_based_slice_insertation,#,176

Before Change


        A binary image of size `sl1`.shape() extend by `nslices`+2 along the new
        dimension `dim`. The border slices are the original slices `sl1` and `sl2`.
    
    dt1 = distance_transform_edt(~sl1.astype(numpy.bool))
    dt2 = distance_transform_edt(~sl2.astype(numpy.bool))
    slicer = [slice(None)] * dt1.ndim
    slicer = slicer[:dim] + [numpy.newaxis] + slicer[dim:]
    out = numpy.concatenate((dt1[slicer], dt2[slicer]), axis=dim)
    zoom_factors = [1] * dt1.ndim
    zoom_factors = zoom_factors[:dim] + [(nslices + 2)/2.] + zoom_factors[dim:]
    out = zoom(out, zoom_factors, order=order)
    return out <= .5
    

After Change


        A binary image of size `sl1`.shape() extend by `nslices`+2 along the new
        dimension `dim`. The border slices are the original slices `sl1` and `sl2`.
    
    sl1 = sl1.astype(numpy.bool)
    sl2 = sl2.astype(numpy.bool)
    dt1 = distance_transform_edt(~sl1) - distance_transform_edt(sl1)
    dt2 = distance_transform_edt(~sl2) - distance_transform_edt(sl2)
    
    slicer = [slice(None)] * dt1.ndim
    slicer = slicer[:dim] + [numpy.newaxis] + slicer[dim:]
    out = numpy.concatenate((dt1[slicer], dt2[slicer]), axis=dim)
    zoom_factors = [1] * dt1.ndim
    zoom_factors = zoom_factors[:dim] + [(nslices + 2)/2.] + zoom_factors[dim:]
    out = zoom(out, zoom_factors, order=order)
    return out <= 0
    
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: loli/medpy
Commit Name: 2ef5ed836cd243c17d8c302fb872029a0289b32f
Time: 2014-11-27
Author: oskar.maier@googlemail.com
File Name: bin/medpy_binary_resampling.py
Class Name:
Method Name: shape_based_slice_insertation


Project Name: danforthcenter/plantcv
Commit Name: 5da63ca510a4ad8db232f493e562edc569331301
Time: 2020-02-10
Author: haleyschuhl@gmail.com
File Name: plantcv/plantcv/hyperspectral/analyze_index.py
Class Name:
Method Name: analyze_index


Project Name: Bihaqo/t3f
Commit Name: 5c2ce99827282c585b97e392cc5dcf251d753893
Time: 2020-02-23
Author: sasha.v.novikov@gmail.com
File Name: t3f/decompositions_no_eager_test.py
Class Name: _DecompositionsTest
Method Name: testTTTensor