code: def test_3d_init_mo_3out(self):
      reader = get_3d_reader()
      sampler = ResizeSampler(
          reader=reader,
          window_sizes=MULTI_MOD_DATA,
          batch_size=1,
          shuffle=False,
          queue_length=50,
      )
      aggregator = ResizeSamplesAggregator(
          image_reader=reader,
          name="image",
          output_path=os.path.join("testing_data", "aggregated"),
          interp_order=3,
      )
      more_batch = True
  
      with self.cached_session() as sess:
          sampler.set_num_threads(2)
          while more_batch:
              try:
                  out = sess.run(sampler.pop_batch_op())
              except tf.errors.OutOfRangeError:
                  break
              sum_val = np.sum(out["image"])
              stats_val = [
                  np.sum(out["image"]),
                  np.min(out["image"]),
                  np.max(out["image"]),
              ]
              more_batch = aggregator.decode_batch(
                  {
                      "window_image": out["image"],
                      "csv_sum": sum_val,
                      "csv_stats": stats_val,
                  },
                  out["image_location"],
              )
      output_filename = "window_image_{}_niftynet_out.nii.gz".format(
          sampler.reader.get_subject_id(0)
      )
      sum_filename = os.path.join(
          "testing_data",
          "aggregated",
          "csv_sum_{}_niftynet_out.csv".format(
              sampler.reader.get_subject_id(0)
          ),
      )
      stats_filename = os.path.join(
          "testing_data",
          "aggregated",
          "csv_stats_{}_niftynet_out.csv".format(
              sampler.reader.get_subject_id(0)
          ),
      )
      output_file = os.path.join(
          "testing_data", "aggregated", output_filename
      )
      self.assertAllClose(
          nib.load(output_file).shape, (256, 168, 256, 1, 2)
      )
      sum_pd = pd.read_csv(sum_filename)
      self.assertAllClose(sum_pd.shape, [1, 2])
      stats_pd = pd.read_csv(stats_filename)
      self.assertAllClose(stats_pd.shape, [1, 4])
      sampler.close_all()
  
imports: from __future__ import absolute_import, division, print_function
  import os
  import nibabel
  import numpy
  import pandas
  import tensorflow
  from niftynet.engine.sampler_resize_v2 import ResizeSampler
  from niftynet.engine.windows_aggregator_resize import ResizeSamplesAggregator
  from niftynet.io.image_reader import ImageReader
  from niftynet.io.image_sets_partitioner import ImageSetsPartitioner
  from niftynet.layer.discrete_label_normalisation import DiscreteLabelNormalisationLayer
  from niftynet.layer.pad import PadLayer
  from niftynet.utilities.util_common import ParserNamespace
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 4 for calling the ResizeSamplesAggregatorTest obj's underlying member method code with example usage: obj.test_3d_init_mo_3out() without return types