code: def htfa2dict(htfa):
      """
      turn htfa object into a pickleable dictionary
      """
      return {
          "K": htfa.K,  # init params
          "n_subj": htfa.n_subj,
          "max_global_iter": htfa.max_global_iter,
          "max_local_iter": htfa.max_local_iter,
          "threshold": htfa.threshold,
          "nlss_method": htfa.nlss_method,
          "nlss_loss": htfa.nlss_loss,
          "jac": htfa.jac,
          "x_scale": htfa.x_scale,
          "tr_solver": htfa.tr_solver,
          "weight_method": htfa.weight_method,
          "upper_ratio": htfa.upper_ratio,
          "lower_ratio": htfa.lower_ratio,
          "tr_ratio": htfa.tr_ratio,
          "voxel_ratio": htfa.voxel_ratio,
          "max_voxel": htfa.max_voxel,
          "max_tr": htfa.max_tr,
          "verbose": htfa.verbose,
          "prior_bcast_size": htfa.prior_bcast_size,
          "prior_size": htfa.prior_size,
          "local_posterior_": htfa.local_posterior_,  # inferred params
          "local_weights_": htfa.local_weights_,
          "global_centers_cov_": htfa.global_centers_cov,
          "global_centers_cov_scaled": htfa.global_centers_cov_scaled,
          "global_posterior_": htfa.global_posterior_,
          "global_prior_": htfa.global_prior_,
          "global_widths_var": htfa.global_widths_var,
          "global_widths_var_scaled": htfa.global_widths_var_scaled,
          "map_offset": htfa.map_offset,
          "n_dim": htfa.n_dim,
      }
  
imports: import numpy
  import pandas
  import nibabel
  import nilearn
  from nilearn.input_data import NiftiMasker
  import nilearn.plotting
  import matplotlib
  import matplotlib.pyplot
  import holoviews
  import timecorr
  import os
  from brainiak.factoranalysis.htfa import HTFA
  import warnings
  import seaborn
label_desc: Use image node_id 3 for calling a global function with example usage: htfa2dict(htfa) and returns: dict