class_docstr: This class defines an application for image-level classification
  problems mapping from images to scalar labels.
  
  This is the application class to be instantiated by the driver
  and referred to in configuration files.
  
  Although structurally similar to segmentation, this application
  supports different samplers/aggregators (because patch-based
  processing is not appropriate), and monitoring metrics.
class_docstr_tok: ["This","class","defines","an","application","for","image-level","classification","problems","mapping","from","images","to","scalar","labels",".","This","is","the","application","class","to","be","instantiated","by","the","driver","and","referred","to","in","configuration","files",".","Although","structurally","similar","to","segmentation",",","this","application","supports","different","samplers\/aggregators","(","because","patch-based","processing","is","not","appropriate",")",",","and","monitoring","metrics","."]
docstr: Initialise the data loader both csv readers and image readers and
  specify preprocessing layers
  :param data_param:
  :param task_param:
  :param data_partitioner:
  :return:
code: def initialise_dataset_loader(
      self, data_param=None, task_param=None, data_partitioner=None
  ):
      """
      Initialise the data loader both csv readers and image readers and
      specify preprocessing layers
      :param data_param:
      :param task_param:
      :param data_partitioner:
      :return:
      """
  
      self.data_param = data_param
      self.segmentation_param = task_param
  
      if self.is_training:
          image_reader_names = ("image", "sampler", "label")
          csv_reader_names = ("value",)
      elif self.is_inference:
          image_reader_names = ("image",)
          csv_reader_names = ()
      elif self.is_evaluation:
          image_reader_names = ("image", "inferred", "label")
          csv_reader_names = ("value",)
      else:
          tf.logging.fatal(
              "Action `%s` not supported. Expected one of %s",
              self.action,
              self.SUPPORTED_PHASES,
          )
          raise ValueError
      try:
          reader_phase = self.action_param.dataset_to_infer
      except AttributeError:
          reader_phase = None
      file_lists = data_partitioner.get_file_lists_by(
          phase=reader_phase, action=self.action
      )
      self.readers = [
          ImageReader(image_reader_names).initialise(
              data_param, task_param, file_list
          )
          for file_list in file_lists
      ]
      if self.is_inference:
          self.action_param.sample_per_volume = 1
      if csv_reader_names is not None and list(csv_reader_names):
          self.csv_readers = [
              CSVReader(csv_reader_names).initialise(
                  data_param,
                  task_param,
                  file_list,
                  sample_per_volume=self.action_param.sample_per_volume,
              )
              for file_list in file_lists
          ]
      else:
          self.csv_readers = [None for file_list in file_lists]
  
      foreground_masking_layer = (
          BinaryMaskingLayer(
              type_str=self.net_param.foreground_type,
              multimod_fusion=self.net_param.multimod_foreground_type,
              threshold=0.0,
          )
          if self.net_param.normalise_foreground_only
          else None
      )
  
      mean_var_normaliser = (
          MeanVarNormalisationLayer(
              image_name="image",
              binary_masking_func=foreground_masking_layer,
          )
          if self.net_param.whitening
          else None
      )
      histogram_normaliser = (
          HistogramNormalisationLayer(
              image_name="image",
              modalities=vars(task_param).get("image"),
              model_filename=self.net_param.histogram_ref_file,
              binary_masking_func=foreground_masking_layer,
              norm_type=self.net_param.norm_type,
              cutoff=self.net_param.cutoff,
              name="hist_norm_layer",
          )
          if (
              self.net_param.histogram_ref_file
              and self.net_param.normalisation
          )
          else None
      )
  
      label_normaliser = (
          DiscreteLabelNormalisationLayer(
              image_name="label",
              modalities=vars(task_param).get("label"),
              model_filename=self.net_param.histogram_ref_file,
          )
          if (
              self.net_param.histogram_ref_file
              and task_param.label_normalisation
          )
          else None
      )
  
      normalisation_layers = []
      if histogram_normaliser is not None:
          normalisation_layers.append(histogram_normaliser)
      if mean_var_normaliser is not None:
          normalisation_layers.append(mean_var_normaliser)
      if label_normaliser is not None:
          normalisation_layers.append(label_normaliser)
  
      augmentation_layers = []
      if self.is_training:
          train_param = self.action_param
          if train_param.random_flipping_axes != -1:
              augmentation_layers.append(
                  RandomFlipLayer(
                      flip_axes=train_param.random_flipping_axes
                  )
              )
          if train_param.scaling_percentage:
              augmentation_layers.append(
                  RandomSpatialScalingLayer(
                      min_percentage=train_param.scaling_percentage[0],
                      max_percentage=train_param.scaling_percentage[1],
                  )
              )
          if (
              train_param.rotation_angle
              or self.action_param.rotation_angle_x
              or self.action_param.rotation_angle_y
              or self.action_param.rotation_angle_z
          ):
              rotation_layer = RandomRotationLayer()
              if train_param.rotation_angle:
                  rotation_layer.init_uniform_angle(
                      train_param.rotation_angle
                  )
              else:
                  rotation_layer.init_non_uniform_angle(
                      self.action_param.rotation_angle_x,
                      self.action_param.rotation_angle_y,
                      self.action_param.rotation_angle_z,
                  )
              augmentation_layers.append(rotation_layer)
  
      # only add augmentation to first reader (not validation reader)
      self.readers[0].add_preprocessing_layers(
          normalisation_layers + augmentation_layers
      )
      for reader in self.readers[1:]:
          reader.add_preprocessing_layers(normalisation_layers)
  
imports: import tensorflow
  from niftynet.application.base_application import BaseApplication
  from niftynet.engine.application_factory import ApplicationNetFactory, InitializerFactory, OptimiserFactory
  from niftynet.engine.application_variables import CONSOLE, NETWORK_OUTPUT, TF_SUMMARIES
  from niftynet.contrib.csv_reader.sampler_resize_v2_csv import ResizeSamplerCSV
  from niftynet.contrib.csv_reader.sampler_uniform_v2_csv import UniformSamplerCSV
  from niftynet.contrib.csv_reader.sampler_weighted_v2_csv import WeightedSamplerCSV
  from niftynet.contrib.csv_reader.sampler_balanced_v2_csv import BalancedSamplerCSV
  from niftynet.contrib.csv_reader.sampler_grid_v2_csv import GridSamplerCSV
  from niftynet.engine.windows_aggregator_grid import GridSamplesAggregator
  from niftynet.engine.windows_aggregator_resize import ResizeSamplesAggregator
  from niftynet.io.image_reader import ImageReader
  from niftynet.contrib.csv_reader.csv_reader import CSVReader
  from niftynet.layer.discrete_label_normalisation import DiscreteLabelNormalisationLayer
  from niftynet.layer.histogram_normalisation import HistogramNormalisationLayer
  from niftynet.layer.binary_masking import BinaryMaskingLayer
  from niftynet.layer.post_processing import PostProcessingLayer
  from niftynet.layer.loss_classification import LossFunction
  from niftynet.layer.loss_segmentation import LossFunction
  from niftynet.layer.mean_variance_normalisation import MeanVarNormalisationLayer
  from niftynet.layer.rand_flip import RandomFlipLayer
  from niftynet.layer.rand_rotation import RandomRotationLayer
  from niftynet.layer.rand_spatial_scaling import RandomSpatialScalingLayer
  from niftynet.evaluation.classification_evaluator import ClassificationEvaluator
label_desc: Use image node_id 2 for calling the MultiClassifSegApplication obj's underlying member method code with example usage: obj.initialise_dataset_loader(data_param, task_param, data_partitioner) without return types