load_file("create_Cells.hoc")

// intracellular stimulus
/* objref stim
proc iIntraStim() {
     cell.soma[0]{stim=new IClamp(0.5)}
   // stim = new IClamp(0.5)
    stim.del = 50
    stim.dur = 1300
    stim.amp = 60 //-0.2 //-1
    printf("INFO: Using intracellular stimulation\n")
} */





// extracellular stimulation
GLOBAL_XTRA_STIM = 0
proc iExtraStim() {
  forall {
    insert extracellular
    insert xtra
  }

  for i = 0, PR_total_upper_cells - 1 {
    PR_upper[i].soma {
      uninsert extracellular
      uninsert xtra
    }
  }

  for i = 0, PR_total_lower_cells - 1 {
    PR_lower[i].soma {
      uninsert extracellular
      uninsert xtra
    }
  }

  for i = 0, HZ_total_upper_cells - 1 {
    HZ_upper[i].soma {
      uninsert extracellular
      uninsert xtra
    }
  }
  for i = 0, HZ_total_lower_cells - 1 {
    HZ_lower[i].soma {
      uninsert extracellular
      uninsert xtra
    }
  }

  {load_file("interpxyz.hoc")}
  {load_file("stimHexMono_biphasic.hoc")} 
  //  {load_file("stimHex.hoc")}
  GLOBAL_XTRA_STIM = 1  // note extracellular stim
  printf("INFO: Using extracellular stimulation\n")

}


/////////////////////////////////////////////////////////////////////
iExtraStim()
//iIntraStim() 
//iIntraStim1() 
//iIntraStim2() 
//iIntraStim3()