class_docstr: For a concrete example::
  
      _input_sources define multiple modality mappings, e.g.,
      _input_sources {'image': ('T1', 'T2'), 'label': ('manual_map',)}
  
  means:
  
  'image' consists of two components, formed by
  concatenating 'T1' and 'T2' input source images.
  'label' consists of one component, loading from 'manual_map'
  
  :param self._names: a tuple of the output names of this reader.
      ``('image', 'labels')``
  
  :param self._shapes: the shapes after combining input sources
      ``{'image': (192, 160, 192, 1, 2), 'label': (192, 160, 192, 1, 1)}``
  
  :param self._dtypes: store the dictionary of tensorflow shapes
      ``{'image': tf.float32, 'label': tf.float32}``
  
  :param self.output_list: a list of dictionaries, with each item::
  
      {'image': <niftynet.io.image_type.SpatialImage4D object>,
      'label': <niftynet.io.image_type.SpatialImage3D object>}
docstr: ``task_param`` specifies how to combine user input modalities.
  e.g., for multimodal segmentation 'image' corresponds to multiple
  modality sections, 'label' corresponds to one modality section
  
  This function converts elements of ``file_list`` into
  dictionaries of image objects, and save them to ``self.output_list``.
  e.g.::
  
       data_param = {'T1': {'path_to_search': 'path/to/t1'}
                     'T2': {'path_to_search': 'path/to/t2'}}
  
  loads pairs of T1 and T1 images (grouped by matching the filename).
  The reader's output is in the form of
  ``{'T1': np.array, 'T2': np.array}``.
  If the (optional) ``task_param`` is specified::
  
       task_param = {'image': ('T1', 'T2')}
  
  the reader loads pairs of T1 and T2 and returns the concatenated
  image (both modalities should have the same spatial dimensions).
  The reader's output is in the form of ``{'image': np.array}``.
  
  
  :param data_param: dictionary of input sections
  :param task_param: dictionary of grouping
  :param file_list: a dataframe generated by ImagePartitioner
      for cross validation, so
      that the reader only loads files in training/inference phases.
  :return: the initialised reader instance
docstr_tok: ["``","task_param","``","specifies","how","to","combine","user","input","modalities",".","e.g.",",","for","multimodal","segmentation","'image","'","corresponds","to","multiple","modality","sections",",","'label","'","corresponds","to","one","modality","section","This","function","converts","elements","of","``","file_list","``","into","dictionaries","of","image","objects",",","and","save","them","to","``","self.output_list","``",".","e.g",".",":",":","data_param","=","{","'T1","'",":","{","'path_to_search","'",":","'path\/to\/t1","'","}","'T2","'",":","{","'path_to_search","'",":","'path\/to\/t2","'","}","}","loads","pairs","of","T1","and","T1","images","(","grouped","by","matching","the","filename",")",".","The","reader","'s","output","is","in","the","form","of","``","{","'T1","'",":","np.array",",","'T2","'",":","np.array","}","``",".","If","the","(","optional",")","``","task_param","``","is","specified",":",":","task_param","=","{","'image","'",":","(","'T1","'",",","'T2","'",")","}","the","reader","loads","pairs","of","T1","and","T2","and","returns","the","concatenated","image","(","both","modalities","should","have","the","same","spatial","dimensions",")",".","The","reader","'s","output","is","in","the","form","of","``","{","'image","'",":","np.array","}","``",".",":","param","data_param",":","dictionary","of","input","sections",":","param","task_param",":","dictionary","of","grouping",":","param","file_list",":","a","dataframe","generated","by","ImagePartitioner","for","cross","validation",",","so","that","the","reader","only","loads","files","in","training\/inference","phases",".",":","return",":","the","initialised","reader","instance"]
code: def initialise(self, data_param, task_param=None, file_list=None):
      """
      ``task_param`` specifies how to combine user input modalities.
      e.g., for multimodal segmentation 'image' corresponds to multiple
      modality sections, 'label' corresponds to one modality section
  
      This function converts elements of ``file_list`` into
      dictionaries of image objects, and save them to ``self.output_list``.
      e.g.::
  
           data_param = {'T1': {'path_to_search': 'path/to/t1'}
                         'T2': {'path_to_search': 'path/to/t2'}}
  
      loads pairs of T1 and T1 images (grouped by matching the filename).
      The reader's output is in the form of
      ``{'T1': np.array, 'T2': np.array}``.
      If the (optional) ``task_param`` is specified::
  
           task_param = {'image': ('T1', 'T2')}
  
      the reader loads pairs of T1 and T2 and returns the concatenated
      image (both modalities should have the same spatial dimensions).
      The reader's output is in the form of ``{'image': np.array}``.
  
  
      :param data_param: dictionary of input sections
      :param task_param: dictionary of grouping
      :param file_list: a dataframe generated by ImagePartitioner
          for cross validation, so
          that the reader only loads files in training/inference phases.
      :return: the initialised reader instance
      """
      data_param = param_to_dict(data_param)
  
      if not task_param:
          task_param = {mod: (mod,) for mod in list(data_param)}
      try:
          if not isinstance(task_param, dict):
              task_param = vars(task_param)
      except ValueError:
          tf.logging.fatal(
              "To concatenate multiple input data arrays,\n"
              "task_param should be a dictionary in the form:\n"
              "{'new_modality_name': ['modality_1', 'modality_2',...]}."
          )
          raise
      if file_list is None:
          # defaulting to all files detected by the input specification
          file_list = (
              ImageSetsPartitioner().initialise(data_param).all_files
          )
      if not self.names:
          # defaulting to load all sections defined in the task_param
          self.names = list(task_param)
      valid_names = [
          name for name in self.names if task_param.get(name, None)
      ]
      if not valid_names:
          tf.logging.fatal(
              "Reader requires task input keywords %s, but "
              "not exist in the config file.\n"
              "Available task keywords: %s",
              self.names,
              list(task_param),
          )
          raise ValueError
      self.names = valid_names
  
      self._input_sources = dict(
          (name, task_param.get(name)) for name in self.names
      )
      required_sections = sum(
          [list(task_param.get(name)) for name in self.names], []
      )
  
      for required in required_sections:
          try:
              if (
                  (file_list is None)
                  or (required not in list(file_list))
                  or (file_list[required].isnull().all())
              ):
                  tf.logging.fatal(
                      "Reader required input section "
                      "name [%s], but in the filename list "
                      "the column is empty.",
                      required,
                  )
                  raise ValueError
          except (AttributeError, TypeError, ValueError):
              tf.logging.fatal(
                  "file_list parameter should be a "
                  "pandas.DataFrame instance and has input "
                  "section name [%s] as a column name.",
                  required,
              )
              if required_sections:
                  tf.logging.fatal(
                      "Reader requires section(s): %s",
                      required_sections,
                  )
              if file_list is not None:
                  tf.logging.fatal(
                      "Configuration input sections are: %s",
                      list(file_list),
                  )
              raise
  
      self.output_list, self._file_list = _filename_to_image_list(
          file_list, self._input_sources, data_param
      )
      for name in self.names:
          tf.logging.info(
              "Image reader: loading %d subjects "
              "from sections %s as input [%s]",
              len(self.output_list),
              self.input_sources[name],
              name,
          )
      return self
  
imports: from __future__ import absolute_import, division, print_function
  from copy import deepcopy
  import argparse
  import numpy
  import pandas
  import tensorflow
  from six import string_types
  from niftynet.io.misc_io import dtype_casting
  from niftynet.io.image_sets_partitioner import COLUMN_UNIQ_ID
  from niftynet.io.image_type import ImageFactory
  from niftynet.layer.base_layer import Layer, DataDependentLayer, RandomisedLayer
  from niftynet.utilities.user_parameters_helper import make_input_tuple
  from niftynet.utilities.util_common import print_progress_bar, ParserNamespace
  from niftynet.io.image_sets_partitioner import ImageSetsPartitioner
  from niftynet.utilities.util_common import look_up_operations
label_desc: Use image node_id 2 for calling the ImageReader obj's underlying member method code with example usage: obj.initialise(data_param, task_param, file_list) and returns: self