a72c75a971061f9fe1d02db80e49a4daba5966b3,niftynet/layer/pad.py,PadLayer,inverse_op,#PadLayer#Any#Any#,47

Before Change



    def inverse_op(self, input_image, mask=None):
        if not isinstance(input_image, dict):
            full_border = match_ndim(self.border, input_image.ndim)
            outputs = _crop_numpy_array(input_image, full_border)
            return outputs, mask

        for name, image in input_image.items():
            if name not in self.image_name:
                continue
            full_border = match_ndim(self.border, image.ndim)
            input_image[name] = _crop_numpy_array(image, full_border)
        return input_image, mask

After Change


            input_image[name] = np.pad(image, self.full_border, mode=self.mode)
        return input_image, mask

    def inverse_op(self, input_image, mask=None):
        if not isinstance(input_image, dict):
            // you can run the cropping op without running the padding op, but only if you
            // pad with a constant amount (not pad_to)
            if self.full_border is None and self.pad_to == (0,):
                self._set_full_border(input_image)

            outputs = self._crop_numpy_array(input_image, self.full_border)
            return outputs, mask

        for name, image in input_image.items():
            // you can run the cropping op without running the padding op, but only if you
            // pad with a constant amount (not pad_to)
            if self.full_border is None and self.pad_to == (0,):
                self._set_full_border(image)

            if name not in self.image_name:
                continue
            input_image[name] = self._crop_numpy_array(image, self.full_border)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 11

Instances


Project Name: NifTK/NiftyNet
Commit Name: a72c75a971061f9fe1d02db80e49a4daba5966b3
Time: 2019-06-04
Author: z.eaton-rosen@ucl.ac.uk
File Name: niftynet/layer/pad.py
Class Name: PadLayer
Method Name: inverse_op


Project Name: NifTK/NiftyNet
Commit Name: a72c75a971061f9fe1d02db80e49a4daba5966b3
Time: 2019-06-04
Author: z.eaton-rosen@ucl.ac.uk
File Name: niftynet/layer/pad.py
Class Name: PadLayer
Method Name: layer_op


Project Name: NifTK/NiftyNet
Commit Name: 2977ae9b14812a76b01caee5cc84c6cbc231b157
Time: 2019-06-04
Author: z.eaton-rosen@ucl.ac.uk
File Name: niftynet/layer/pad.py
Class Name: PadLayer
Method Name: inverse_op


Project Name: NifTK/NiftyNet
Commit Name: a72c75a971061f9fe1d02db80e49a4daba5966b3
Time: 2019-06-04
Author: z.eaton-rosen@ucl.ac.uk
File Name: niftynet/layer/pad.py
Class Name: PadLayer
Method Name: inverse_op


Project Name: NifTK/NiftyNet
Commit Name: 2977ae9b14812a76b01caee5cc84c6cbc231b157
Time: 2019-06-04
Author: z.eaton-rosen@ucl.ac.uk
File Name: niftynet/layer/pad.py
Class Name: PadLayer
Method Name: layer_op