return
original_image = self.input_image["image"]
affine = original_image.original_affine[0]
image_pixdim = original_image.output_pixdim[0]
image_axcodes = original_image.output_axcodes[0]
dst_pixdim = original_image.original_pixdim[0]
dst_axcodes = original_image.original_axcodes[0]
interp_order = original_image.interp_order[0]
if len(self.image_out.shape) == 4:
// recover a time dimension for nifti format output
self.image_out = np.expand_dims(self.image_out, axis=3)
for layer in self.reader.preprocessors:
if isinstance(layer, PadLayer):
self.image_out, _ = layer.inverse_op(self.image_out)
if isinstance(layer, DiscreteLabelNormalisationLayer):
self.image_out, _ = layer.inverse_op(self.image_out)
if image_pixdim:
self.image_out = misc_io.do_resampling(
self.image_out, image_pixdim, dst_pixdim, interp_order)
if image_axcodes:
self.image_out = misc_io.do_reorientation(
self.image_out, image_axcodes, dst_axcodes)
After Change
if self.input_image is None:
return
for layer in reversed(self.reader.preprocessors):
if isinstance(layer, PadLayer):
self.image_out, _ = layer.inverse_op(self.image_out)
if isinstance(layer, DiscreteLabelNormalisationLayer):