class_docstr: This class decodes each item in a batch by resizing each image
  window and save as a new image volume. Multiple output image can be
  proposed and csv output can be performed as well
class_docstr_tok: ["This","class","decodes","each","item","in","a","batch","by","resizing","each","image","window","and","save","as","a","new","image","volume",".","Multiple","output","image","can","be","proposed","and","csv","output","can","be","performed","as","well"]
docstr: Loop through the dictionary of images output and resize and reverse
  the preprocessing prior to saving
  :return:
docstr_tok: ["Loop","through","the","dictionary","of","images","output","and","resize","and","reverse","the","preprocessing","prior","to","saving",":","return",":"]
code: def _save_current_image(self):
      """
      Loop through the dictionary of images output and resize and reverse
      the preprocessing prior to saving
      :return:
      """
      if self.input_image is None:
          return
  
      self.current_out = {}
      for i in self.image_out:
          resize_to_shape = self._initialise_image_shape(
              image_id=self.image_id,
              n_channels=self.image_out[i].shape[-1],
          )
          window_shape = resize_to_shape
          current_out = self.image_out[i]
          while current_out.ndim < 5:
              current_out = current_out[..., np.newaxis, :]
          if self.window_border and any(
              [b > 0 for b in self.window_border]
          ):
              np_border = self.window_border
              while len(np_border) < 5:
                  np_border = np_border + (0,)
              np_border = [(b,) for b in np_border]
              current_out = np.pad(current_out, np_border, mode="edge")
          image_shape = current_out.shape
          zoom_ratio = [
              float(p) / float(d)
              for p, d in zip(window_shape, image_shape)
          ]
          image_shape = list(image_shape[:3]) + [1, image_shape[-1]]
          current_out = np.reshape(current_out, image_shape)
          current_out = zoom_3d(
              image=current_out,
              ratio=zoom_ratio,
              interp_order=self.output_interp_order,
          )
          self.current_out[i] = current_out
  
      for layer in reversed(self.reader.preprocessors):
          if isinstance(layer, PadLayer):
              for i in self.image_out:
                  self.current_out[i], _ = layer.inverse_op(
                      self.current_out[i]
                  )
          if isinstance(layer, DiscreteLabelNormalisationLayer):
              for i in self.image_out:
                  self.image_out[i], _ = layer.inverse_op(
                      self.image_out[i]
                  )
      subject_name = self.reader.get_subject_id(self.image_id)
      for i in self.image_out:
          filename = "{}_{}_{}.nii.gz".format(
              i, subject_name, self.postfix
          )
          source_image_obj = self.input_image[self.name]
          misc_io.save_data_array(
              self.output_path,
              filename,
              self.current_out[i],
              source_image_obj,
              self.output_interp_order,
          )
          self.log_inferred(subject_name, filename)
      return
  
file_path: NiftyNet/niftynet/engine/windows_aggregator_resize.py
imports: from __future__ import absolute_import, division, print_function
  import os
  from collections import OrderedDict
  import numpy
  import pandas
  import niftynet.io.misc_io
  from niftynet.engine.sampler_resize_v2 import zoom_3d
  from niftynet.engine.windows_aggregator_base import ImageWindowsAggregator
  from niftynet.layer.discrete_label_normalisation import DiscreteLabelNormalisationLayer
  from niftynet.layer.pad import PadLayer
label_desc: Use image node_id 4 for calling the ResizeSamplesAggregator obj's underlying member method code with example usage: obj._save_current_image() without return types