123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import mr_epilepsy_fullrec
- import os
- def run_mr_regions():
- for rectype in ['preictal', 'interictal']:
- data_path = '../Data/{}/'.format(rectype)
- result_path = '../Results/{}/singleunits_regions/'.format(rectype)
- # -----------------------------------------------------------------------#
- # create result directories
- # -----------------------------------------------------------------------#
- recordings = [dI for dI in os.listdir(data_path) if os.path.isdir(
- os.path.join(data_path, dI))]
- if not os.path.exists(result_path):
- os.makedirs(result_path)
- for rec in recordings:
- if not os.path.exists(result_path + rec):
- os.makedirs(result_path + rec)
- # -----------------------------------------------------------------------#
- # run mr analysis
- # -----------------------------------------------------------------------#
- outputfilename = 'pkl/activity_brainregions_SU_4ms.pkl'
- mr_epilepsy_fullrec.mr_analysis_confint(data_path, result_path,
- outputfilename=outputfilename, recordings='all',
- binnings=[], ksteps=(1, 400), fit_method='offset')
- def run_mr_hemispheres():
- for rectype in ['preictal', 'interictal']:
- data_path = '../Data/{}/'.format(rectype)
- result_path = '../Results/{}/singleunits/'.format(rectype)
- # -----------------------------------------------------------------------#
- # create result directories
- # -----------------------------------------------------------------------#
- recordings = [dI for dI in os.listdir(data_path) if os.path.isdir(
- os.path.join(data_path, dI))]
- if not os.path.exists(result_path):
- os.makedirs(result_path)
- for rec in recordings:
- if not os.path.exists(result_path + rec):
- os.makedirs(result_path + rec)
- # -----------------------------------------------------------------------#
- # run mr analysis
- # -----------------------------------------------------------------------#
- outputfilename = 'pkl/activity_SU_4ms.pkl'
- mr_epilepsy_fullrec.mr_analysis_confint(data_path, result_path,
- outputfilename=outputfilename, recordings='all',
- binnings=['left', 'right'], ksteps=(1, 400),
- fit_method='offset')
- def main():
- run_mr_hemispheres()
- #run_mr_regions()
- if __name__ == '__main__':
- main()
|