class_docstr: Global configuration settings
class_docstr_tok: ["Global","configuration","settings"]
docstr: Read variables from system environment and make directories.
  
  :return:
docstr_tok: ["Read","variables","from","system","environment","and","make","directories",".",":","return",":"]
code: def setup(self):
      """
      Read variables from system environment and make directories.
  
      :return:
      """
      config_opts = NiftyNetGlobalConfig.__load_or_create(
          self._config_file
      )
      self._niftynet_home = expanduser(
          config_opts[NiftyNetGlobalConfig.global_section][
              NiftyNetGlobalConfig.home_key
          ]
      )
  
      if not isdir(self._niftynet_home):
          os.makedirs(self._niftynet_home)
  
          # create folders for user-defined extensions such as new networks
          for ext in list(NiftyNetGlobalConfig.niftynet_exts):
              extension_subfolder = join(self._niftynet_home, ext)
              NiftyNetGlobalConfig.__create_module(extension_subfolder)
              for mod in NiftyNetGlobalConfig.niftynet_exts[ext]:
                  extension_subsubfolder = join(
                      self._niftynet_home, ext, mod
                  )
                  NiftyNetGlobalConfig.__create_module(
                      extension_subsubfolder
                  )
  
      for ext in list(NiftyNetGlobalConfig.niftynet_exts):
          extension_subfolder = join(self._niftynet_home, ext)
          sys.path.insert(1, extension_subfolder)
      sys.path.insert(1, self._niftynet_home)
      return self
  
file_path: NiftyNet/niftynet/utilities/niftynet_global_config.py
imports: import sys
  from random import choice
  from string import ascii_lowercase
  from time import strftime
  import os
  from os.path import expanduser, join, split, isdir, isfile, splitext
  from niftynet.utilities.decorators import singleton
label_desc: Use image node_id 2 for calling the NiftyNetGlobalConfig obj's underlying member method code with example usage: obj.setup() and returns: self