docstr: Workflow of linear Mixed Models.
  
  Applies linear Mixed Models on bundles of subjects and saves the
  results in a directory specified by ``out_dir``.
  
  Parameters
  ----------
  
  h5_files : string
      Path to the input metric files. This path may
      contain wildcards to process multiple inputs at once.
  
  no_disks : integer, optional
      Number of disks used for dividing bundle into disks.
  
  out_dir : string, optional
      Output directory. (default current directory)
docstr_tok: ["Workflow","of","linear","Mixed","Models",".","Applies","linear","Mixed","Models","on","bundles","of","subjects","and","saves","the","results","in","a","directory","specified","by","``","out_dir","``",".","Parameters","--","--","--","--","--","h5_files",":","string","Path","to","the","input","metric","files",".","This","path","may","contain","wildcards","to","process","multiple","inputs","at","once",".","no_disks",":","integer",",","optional","Number","of","disks","used","for","dividing","bundle","into","disks",".","out_dir",":","string",",","optional","Output","directory",".","(","default","current","directory",")"]
code: def run(self, h5_files, no_disks=100, out_dir=""):
      """Workflow of linear Mixed Models.
  
      Applies linear Mixed Models on bundles of subjects and saves the
      results in a directory specified by ``out_dir``.
  
      Parameters
      ----------
  
      h5_files : string
          Path to the input metric files. This path may
          contain wildcards to process multiple inputs at once.
  
      no_disks : integer, optional
          Number of disks used for dividing bundle into disks.
  
      out_dir : string, optional
          Output directory. (default current directory)
  
      """
  
      io_it = self.get_io_iterator()
  
      for file_path in io_it:
          logging.info("Applying metric {0}".format(file_path))
  
          file_name, bundle_name, save_name = self.get_metric_name(
              file_path
          )
          logging.info(" file name = " + file_name)
          logging.info("file path = " + file_path)
  
          pvalues = np.zeros(no_disks)
          warnings.filterwarnings("ignore")
          # run mixed linear model for every disk
          for i in range(no_disks):
              disk_count = i + 1
              df = pd.read_hdf(file_path, where="disk=disk_count")
  
              logging.info(
                  "read the dataframe for disk number "
                  + str(disk_count)
              )
              # check if data has significant data to perform LMM
              if len(df) < 10:
                  raise ValueError(
                      "Dataset for Linear Mixed Model is too small"
                  )
  
              criteria = file_name + " ~ group"
              md = smf.mixedlm(criteria, df, groups=df["subject"])
  
              mdf = md.fit()
  
              pvalues[i] = mdf.pvalues[1]
  
          x = list(range(1, len(pvalues) + 1))
          y = -1 * np.log10(pvalues)
  
          save_file = os.path.join(out_dir, save_name + "_pvalues.npy")
          np.save(save_file, pvalues)
  
          save_file = os.path.join(
              out_dir, save_name + "_pvalues_log.npy"
          )
          np.save(save_file, y)
  
          save_file = os.path.join(out_dir, save_name + ".png")
          self.save_lmm_plot(save_file, file_name, bundle_name, x, y)
  
imports: import logging
  import numpy
  import os
  import json
  import warnings
  from time import time
  from scipy.ndimage import binary_dilation
  from dipy.utils.optpkg import optional_package
  from dipy.io import read_bvals_bvecs
  from dipy.io.image import load_nifti, save_nifti
  from dipy.core.gradients import gradient_table
  from dipy.reconst.dti import TensorModel
  from dipy.io.peaks import load_peaks
  from dipy.io.streamline import load_tractogram
  from dipy.segment.mask import segment_from_cfa
  from dipy.segment.mask import bounding_box
  from dipy.tracking.streamline import transform_streamlines
  from glob import glob
  from dipy.workflows.workflow import Workflow
  from dipy.segment.bundles import bundle_shape_similarity
  from dipy.stats.analysis import assignment_map
  from dipy.stats.analysis import anatomical_measures
  from dipy.stats.analysis import peak_values
label_desc: Use image node_id 4 for calling the LinearMixedModelsFlow obj's underlying member method code with example usage: obj.run(h5_files, no_disks, out_dir) without return types