6d854ec8c54e0eb0a73635f41b0598f2d2231069,niftynet/engine/windows_aggregator_base.py,ImageWindowsAggregator,crop_batch,#Any#Any#Any#,71

Before Change


        spatial_shape = window_shape[1:-1]
        n_spatial = len(spatial_shape)
        // import pdb; pdb.set_trace()
        assert all([win_size > 2 * border_size
                    for (win_size, border_size)
                    in zip(spatial_shape, border[:n_spatial])]), \
            "window sizes should be larger than inference border size * 2" \
            " received: {}: {}".format(spatial_shape, border[:n_spatial])
        if n_spatial == 1:
            window = window[:,
                            border[0]:spatial_shape[0] - border[0],
                            np.newaxis, np.newaxis, ...]

After Change


        if np.any(location < 0):
            return window, location

        cropped_shape = np.max(location[:, 4:7] - location[:, 1:4], axis=0)
        left = np.floor(
            (spatial_shape - cropped_shape[:n_spatial])/2.0).astype(np.int)
        if np.any(left < 0):
            tf.logging.fatal(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: NifTK/NiftyNet
Commit Name: 6d854ec8c54e0eb0a73635f41b0598f2d2231069
Time: 2017-09-01
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/engine/windows_aggregator_base.py
Class Name: ImageWindowsAggregator
Method Name: crop_batch


Project Name: NifTK/NiftyNet
Commit Name: 3162e475ad96caa7e62a6351544fac23e148ab30
Time: 2017-09-16
Author: carole.sudre.12@ucl.ac.uk
File Name: niftynet/engine/sampler_selective.py
Class Name:
Method Name: rand_choice_coordinates


Project Name: chainer/chainercv
Commit Name: f922a9824d2ecd781666a594d941f4a60d9a79a1
Time: 2017-09-28
Author: yuyuniitani@gmail.com
File Name: tests/transforms_tests/image_tests/test_random_sized_crop.py
Class Name: TestRandomSizedCrop
Method Name: test_random_sized_crop