code: def display_3d_data(
      input_data,
      color_range,
      viz_mode_3d="2d_slice",
      label=None,
      input_dict=None,
      viz_rows=2,
      viz_columns=2,
      slice_index=None,
      mosaic_rows=4,
      mosaic_columns=4,
      subplot_titles=None,
      **kwargs,
  ):
      if input_dict is None:
          input_dict = {}
  
      if label is None:
          label = "input_data"
  
      for i in range(input_data.shape[-1]):
          if viz_mode_3d == "2d_slice":
              if slice_index is None:
                  input_data_slice = input_data[
                      ..., int(input_data.shape[-2] / 2), i
                  ][..., np.newaxis]
              else:
                  input_data_slice = input_data[..., slice_index, i][
                      ..., np.newaxis
                  ]
              input_data_slice = merge_data(
                  input_data_slice, [viz_rows, viz_columns], 1
              )
  
          elif viz_mode_3d == "mosaic":
              input_data_slice = np.zeros(
                  (
                      input_data.shape[0],
                      mosaic_rows * input_data.shape[1],
                      mosaic_columns * input_data.shape[2],
                      1,
                  ),
                  dtype=input_data.dtype,
              )
  
              image_idx = 0
              slice_gap = input_data.shape[3] // (
                  mosaic_rows * mosaic_columns
              )
              for m_row in range(mosaic_rows):
                  for m_col in range(mosaic_columns):
                      input_data_slice[
                          :,
                          m_row
                          * input_data.shape[1] : (m_row + 1)
                          * input_data.shape[1],
                          m_col
                          * input_data.shape[2] : (m_col + 1)
                          * input_data.shape[2],
                      ] = input_data[:, ..., slice_gap * image_idx, i][
                          ..., np.newaxis
                      ]
                      image_idx += 1
  
              input_data_slice = merge_data(
                  input_data_slice, [viz_rows, viz_columns], 1
              )
  
          else:
              raise NotImplementedError
  
          if input_dict is not None:
              if subplot_titles is None:
                  if input_data.shape[-1] == 1:
                      subplot_title = label
                  else:
                      subplot_title = label + "_" + str(i)
              else:
                  subplot_title = subplot_titles[label][i]
  
              input_dict[subplot_title] = input_data_slice
              color_range[subplot_title] = [
                  np.min(input_data[..., i]),
                  np.max(input_data[..., i]),
              ]
  
      return input_dict, color_range
  
file_path: DeepNeuro/deepneuro/utilities/visualize.py
imports: import numpy
  import matplotlib.pyplot
  import os
  from collections import OrderedDict
  from deepneuro.utilities.conversion import save_data, read_image_files
  from deepneuro.utilities.util import replace_suffix, nifti_splitext
label_desc: Use image node_id 6 for calling a global function with example usage: display_3d_data(input_data, color_range, viz_mode_3d, label, input_dict, viz_rows, viz_columns, slice_index, mosaic_rows, mosaic_columns, subplot_titles) and returns: input_dict,  color_range