6b48055fdfe3c628833ed26ca394ef2fb1d97f82,niftynet/layer/resampler.py,ResamplerLayer,_resample_nearest,#ResamplerLayer#Any#Any#,58

Before Change


        batch_size = in_size[0]
        in_spatial_size = in_size[1:-1]

        out_size = sample_coords.get_shape().as_list()
        out_spatial_size = out_size[1:-1]
        out_spatial_rank = infer_spatial_rank(sample_coords)

        spatial_coords = self.boundary_func(
            tf.round(sample_coords), in_spatial_size)
        batch_ids = tf.reshape(
            tf.range(batch_size), [batch_size] + [1] * (out_spatial_rank + 1))
        batch_ids = tf.tile(batch_ids, [1] + out_spatial_size + [1])
        output = tf.gather_nd(
            inputs, tf.concat([batch_ids, spatial_coords], -1))

        if self.boundary == "ZERO":
            scale = 1. / (tf.constant(in_spatial_size, dtype=tf.float32) - 1)
            mask = tf.logical_and(

After Change


        spatial_coords = self.boundary_func(
            tf.round(sample_coords), in_spatial_size)
        output = tf.stack([
            tf.gather_nd(img, coords) for (img, coords) in
            zip(tf.unstack(inputs), tf.unstack(spatial_coords))])

        if self.boundary == "ZERO":
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: NifTK/NiftyNet
Commit Name: 6b48055fdfe3c628833ed26ca394ef2fb1d97f82
Time: 2017-10-26
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/resampler.py
Class Name: ResamplerLayer
Method Name: _resample_nearest


Project Name: NifTK/NiftyNet
Commit Name: 5b5ea7b5d864e53894f5342f19becfba8f8035e5
Time: 2017-12-18
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/network/interventional_dense_net.py
Class Name: INetDense
Method Name: layer_op


Project Name: NifTK/NiftyNet
Commit Name: 6f405851fcb3be013441810be9a7edbbc04fd2a3
Time: 2018-05-15
Author: d.shakir@ucl.ac.uk
File Name: niftynet/layer/loss_segmentation.py
Class Name: LossFunction
Method Name: layer_op