├── .gitignore ├── .gitmodules ├── AdvancedSettings.m ├── Functions ├── +NBP │ ├── SEM_calc.m │ ├── jitterExamples.m │ ├── lineExamples.m │ ├── linearModelExamples.m │ ├── showCase.m │ ├── simpleExamples.m │ ├── statsOptionsExample.m │ ├── tInterval_calc.m │ └── tableExamples.m ├── 2019_03_03_BCT │ ├── adjacency_plot_und.m │ ├── agreement.m │ ├── agreement_weighted.m │ ├── align_matrices.m │ ├── assortativity_bin.m │ ├── assortativity_wei.m │ ├── backbone_wu.m │ ├── betweenness_bin.m │ ├── betweenness_wei.m │ ├── breadth.m │ ├── breadthdist.m │ ├── charpath.m │ ├── clique_communities.m │ ├── clustering_coef_bd.m │ ├── clustering_coef_bu.m │ ├── clustering_coef_wd.m │ ├── clustering_coef_wu.m │ ├── clustering_coef_wu_sign.m │ ├── community_louvain.m │ ├── consensus_und.m │ ├── core_periphery_dir.m │ ├── cycprob.m │ ├── degrees_dir.m │ ├── degrees_und.m │ ├── density_dir.m │ ├── density_und.m │ ├── diffusion_efficiency.m │ ├── distance_bin.m │ ├── distance_wei.m │ ├── distance_wei_floyd.m │ ├── diversity_coef_sign.m │ ├── edge_betweenness_bin.m │ ├── edge_betweenness_wei.m │ ├── edge_nei_overlap_bd.m │ ├── edge_nei_overlap_bu.m │ ├── efficiency_bin.m │ ├── efficiency_wei.m │ ├── eigenvector_centrality_und.m │ ├── erange.m │ ├── evaluate_generative_model.m │ ├── find_motif34.m │ ├── findpaths.m │ ├── findwalks.m │ ├── flow_coef_bd.m │ ├── gateway_coef_sign.m │ ├── generate_fc.m │ ├── generative_model.m │ ├── get_components.m │ ├── grid_communities.m │ ├── gtom.m │ ├── jdegree.m │ ├── kcore_bd.m │ ├── kcore_bu.m │ ├── kcoreness_centrality_bd.m │ ├── kcoreness_centrality_bu.m │ ├── latmio_dir.m │ ├── latmio_dir_connected.m │ ├── latmio_und.m │ ├── latmio_und_connected.m │ ├── link_communities.m │ ├── local_assortativity_wu_sign.m │ ├── make_motif34lib.m │ ├── makeevenCIJ.m │ ├── makefractalCIJ.m │ ├── makelatticeCIJ.m │ ├── makerandCIJ_dir.m │ ├── makerandCIJ_und.m │ ├── makerandCIJdegreesfixed.m │ ├── makeringlatticeCIJ.m │ ├── maketoeplitzCIJ.m │ ├── matching_ind.m │ ├── matching_ind_und.m │ ├── mean_first_passage_time.m │ ├── mleme_constraint_model.m │ ├── modularity_dir.m │ ├── modularity_und.m │ ├── module_degree_zscore.m │ ├── motif3funct_bin.m │ ├── motif3funct_wei.m │ ├── motif3struct_bin.m │ ├── motif3struct_wei.m │ ├── motif4funct_bin.m │ ├── motif4funct_wei.m │ ├── motif4struct_bin.m │ ├── motif4struct_wei.m │ ├── navigation_wu.m │ ├── null_model_dir_sign.m │ ├── null_model_und_sign.m │ ├── pagerank_centrality.m │ ├── participation_coef.m │ ├── participation_coef_sign.m │ ├── partition_distance.m │ ├── path_transitivity.m │ ├── predict_fc.m │ ├── quasi_idempotence.m │ ├── randmio_dir.m │ ├── randmio_dir_connected.m │ ├── randmio_dir_signed.m │ ├── randmio_und.m │ ├── randmio_und_connected.m │ ├── randmio_und_signed.m │ ├── randomize_graph_partial_und.m │ ├── randomizer_bin_und.m │ ├── reachdist.m │ ├── rentian_scaling_2d.m │ ├── rentian_scaling_3d.m │ ├── reorderMAT.m │ ├── reorder_matrix.m │ ├── reorder_mod.m │ ├── resource_efficiency_bin.m │ ├── retrieve_shortest_path.m │ ├── rich_club_bd.m │ ├── rich_club_bu.m │ ├── rich_club_wd.m │ ├── rich_club_wu.m │ ├── rout_efficiency.m │ ├── score_wu.m │ ├── search_information.m │ ├── strengths_dir.m │ ├── strengths_und.m │ ├── strengths_und_sign.m │ ├── subgraph_centrality.m │ ├── threshold_absolute.m │ ├── threshold_proportional.m │ ├── transitivity_bd.m │ ├── transitivity_bu.m │ ├── transitivity_wd.m │ ├── transitivity_wu.m │ ├── weight_conversion.m │ └── writetoPAJ.m ├── AxionFileLoader │ ├── AxionFileLoader │ │ ├── Annotation.m │ │ ├── AxisFile.m │ │ ├── BasicChannelArray.m │ │ ├── BlockVectorData.m │ │ ├── BlockVectorDataType.m │ │ ├── BlockVectorHeader.m │ │ ├── BlockVectorHeaderExtension.m │ │ ├── BlockVectorSampleType.m │ │ ├── BlockVectorSet.m │ │ ├── CRC32.m │ │ ├── ChannelArray.m │ │ ├── ChannelID.m │ │ ├── ChannelMapping.m │ │ ├── CombinedBlockVectorHeaderEntry.m │ │ ├── ContinuousBlockVectorHeaderEntry.m │ │ ├── ContinuousDataSet.m │ │ ├── ContractilityWaveform.m │ │ ├── DataSet.m │ │ ├── DateTime.m │ │ ├── DiscontinuousBlockVectorHeaderEntry.m │ │ ├── Entry.m │ │ ├── EntryRecord.m │ │ ├── EntryRecordID.m │ │ ├── EventTag.m │ │ ├── KeyValuePairTag.m │ │ ├── LeapInductionEvent.m │ │ ├── LedColor.m │ │ ├── LedPosition.m │ │ ├── LegacySupport.m │ │ ├── LoadArgs.m │ │ ├── Note.m │ │ ├── PlateTypes.m │ │ ├── SpikeDataSet.m │ │ ├── Spike_v1.m │ │ ├── StimulationChannels.m │ │ ├── StimulationEvent.m │ │ ├── StimulationEventData.m │ │ ├── StimulationLeds.m │ │ ├── StimulationWaveform.m │ │ ├── Tag.m │ │ ├── TagEntry.m │ │ ├── TagType.m │ │ ├── ViabilityImpedanceEvent.m │ │ ├── VoltageWaveform.m │ │ ├── Waveform.m │ │ ├── WellInformation.m │ │ ├── freadstring.m │ │ └── parseGuid.m │ ├── CONTRIBUTING.md │ ├── LICENSE │ └── README.md ├── BurstDetectISIn.m ├── CC_PL_SW │ ├── latmio_und_v2.m │ ├── randmio_und_v2.m │ └── small_worldness_RL_wu.m ├── Colormaps │ ├── Colormaps │ │ ├── README.txt │ │ ├── Thumbs.db │ │ ├── demo1.m │ │ ├── demo1_output.png │ │ ├── demo2.m │ │ ├── fake_parula.m │ │ ├── inferno.m │ │ ├── magma.asv │ │ ├── magma.m │ │ ├── plasma.asv │ │ ├── plasma.m │ │ └── viridis.m │ └── license.txt ├── CreateOutputFolders.m ├── ExtractNetMet.m ├── GUI │ └── runGUImode.m ├── GroupingInfo.m ├── HalfViolinPlot.m ├── McsMatlabDataTools │ ├── +McsHDF5 │ │ ├── @McsAnalogStream │ │ │ ├── McsAnalogStream.m │ │ │ └── plot.m │ │ ├── @McsAverageSegment │ │ │ ├── McsAverageSegment.m │ │ │ └── plot.m │ │ ├── @McsCmosAcquisitionSource │ │ │ ├── McsCmosAcquisitionSource.m │ │ │ └── plot.m │ │ ├── @McsCmosDataSource │ │ │ └── McsCmosDataSource.m │ │ ├── @McsCmosFilterSource │ │ │ └── McsCmosFilterSource.m │ │ ├── @McsCmosLinkedDataSource │ │ │ ├── McsCmosLinkedDataSource.m │ │ │ └── plot.m │ │ ├── @McsCmosRecording │ │ │ ├── McsCmosRecording.m │ │ │ └── plot.m │ │ ├── @McsCmosSpikeSorterSource │ │ │ ├── McsCmosSpikeSorterSource.m │ │ │ ├── checkboxHandler.m │ │ │ ├── createSensorSTAImage.m │ │ │ ├── listHandler.m │ │ │ ├── mapHandler.m │ │ │ └── plot.m │ │ ├── @McsCmosSpikeSorterUnit │ │ │ ├── McsCmosSpikeSorterUnit.m │ │ │ ├── createUnitSTAImage.m │ │ │ └── plot.m │ │ ├── @McsCmosSpikeStream │ │ │ ├── McsCmosSpikeStream.m │ │ │ └── plot.m │ │ ├── @McsCmosStaExplorerSource │ │ │ ├── McsCmosStaExplorerSource.m │ │ │ ├── mouseHandlerHeatMap.m │ │ │ ├── mouseSingleSensor.m │ │ │ ├── plot.m │ │ │ ├── plotHeatMap.m │ │ │ └── plotSingleSensor.m │ │ ├── @McsCutoutSegment │ │ │ ├── McsCutoutSegment.m │ │ │ ├── plot.asv │ │ │ └── plot.m │ │ ├── @McsData │ │ │ ├── McsData.m │ │ │ └── plot.m │ │ ├── @McsEventStream │ │ │ ├── McsEventStream.m │ │ │ └── plot.m │ │ ├── @McsFrameDataEntity │ │ │ ├── McsFrameDataEntity.m │ │ │ ├── frameMovie.m │ │ │ └── plot.m │ │ ├── @McsFrameStream │ │ │ ├── McsFrameStream.m │ │ │ └── plot.m │ │ ├── @McsH5Helper │ │ │ └── McsH5Helper.m │ │ ├── @McsRecording │ │ │ ├── McsRecording.m │ │ │ └── plot.m │ │ ├── @McsSegmentStream │ │ │ ├── McsSegmentStream.m │ │ │ └── plot.m │ │ ├── @McsStream │ │ │ └── McsStream.m │ │ ├── @McsTimeStampStream │ │ │ ├── McsTimeStampStream.m │ │ │ └── plot.m │ │ ├── @McsVideo │ │ │ └── McsVideo.m │ │ ├── ExponentToUnit.m │ │ ├── ID2coordinates.m │ │ ├── SecToTick.m │ │ ├── TickToSec.m │ │ ├── checkParameter.m │ │ ├── coordinates2ID.m │ │ ├── help │ │ │ ├── examples.m │ │ │ ├── helpCmosMea.m │ │ │ ├── helpDataManager.m │ │ │ ├── helpInstalling.m │ │ │ ├── helpIntro.m │ │ │ ├── html │ │ │ │ ├── helpCmosMea.html │ │ │ │ ├── helpDataManager.html │ │ │ │ ├── helpDataManager_eq06716003005155465776.png │ │ │ │ ├── helpDataManager_eq09220389044114281081.png │ │ │ │ ├── helpInstalling.html │ │ │ │ ├── helpIntro.html │ │ │ │ └── staComplete.PNG │ │ │ └── staComplete.PNG │ │ └── version.m │ ├── Changelog.txt │ ├── demos.xml │ ├── html │ │ ├── .directory │ │ ├── helpCmosMea.html │ │ ├── helpDataManager.html │ │ ├── helpDataManager_eq06716003005155465776.png │ │ ├── helpDataManager_eq09220389044114281081.png │ │ ├── helpInstalling.html │ │ ├── helpIntro.html │ │ ├── helpsearch-v3 │ │ │ ├── _0.cfe │ │ │ ├── _0.cfs │ │ │ ├── _0.si │ │ │ ├── segments.gen │ │ │ └── segments_2 │ │ ├── helptoc.xml │ │ └── staComplete.PNG │ └── info.xml ├── Modularity │ ├── consensus_coclassify.m │ ├── consensuscheck.m │ └── mod_consensus_cluster_iterate.m ├── NodeCartography.m ├── PlotEphysStats.m ├── PlotIndvNetMet.m ├── PlotNetMet.m ├── PlotNetMet.m~ ├── PlotNetMetOrganoid.m ├── STTCandThresholding │ ├── README.md │ ├── adjM_thr_checkreps.m │ ├── adjM_thr_parallel.m │ ├── cmocean.m │ ├── cshift.c │ ├── cshift.mexmaci64 │ ├── get_sttc.m │ ├── significance_distribution_plots.m │ ├── sttc.c │ ├── sttc.mexa64 │ ├── sttc.mexmaci64 │ ├── sttc.mexw64 │ ├── sttc_jeremi.c │ ├── sttc_jeremi.mexw64 │ ├── sttc_m.m │ ├── testSTTC.m │ └── test_sttc_c_code.m ├── SWTTEO │ ├── SWTTEO.m │ ├── extendswt.m │ ├── get_spike_pos.m │ └── myTEOcircshift.m ├── SpikeTimesToMatrix.m ├── StandardisedNetworkPlot.m ├── StandardisedNetworkPlotNodeCartography.m ├── StandardisedNetworkPlotNodeColourMap.m ├── StandardisedNetworkPlotNodeColourMap2.m ├── ThresholdingChecks │ └── significance_distribution_check_v2.m ├── TrialLandscapeDensity.m ├── WATERS-master │ ├── adaptWavelet.m │ ├── alignPeaks.m │ ├── batchDetectSpikes.m │ ├── batchInterfaceSimple.m │ ├── detectSpikesCWT.m │ ├── detectSpikesThreshold.m │ ├── detectSpikesWavelet.m │ ├── getSpikeAmp.m │ └── getTemplate.m ├── aesthetics.m ├── burstDetect.m ├── calEffRank.m ├── calNMF.m ├── calNodeCartography.m ├── checkIfAnySpikes.m ├── checkOneFigureHandle.m ├── combineExpNetworkData.m ├── combinePlots.m ├── compileAllExpData.m ├── controlTheory │ ├── ave_control.m │ └── modal_control.m ├── convertMCSh5toMat.m ├── convertRawToMat │ ├── MEA_load_bin.m │ ├── MEAbatchConvert.m │ ├── createBatchCSVFile.m │ └── rawConvertFunc.m ├── doClassification.m ├── doLDA.m ├── doStats.m ├── downSampleSum.m ├── electrodeHeatMaps.m ├── electrodeSpecificMetrics.m ├── fLOESS.m ├── fcn_find_hubs_wu.m ├── fcn_find_rich_clubs_bu.m ├── featureCorrelation.m ├── findBasinsOfAttraction.m ├── findMinMaxAllNetMetStruct.m ├── findMinMaxNetMetTable.m ├── findNodeDegEdgeWeight.m ├── findSpikeTimes.m ├── find_best_spike_result.m ├── firingRateElectrodeDistribution.m ├── firingRatesBursts.m ├── formatSpikeTimes.m ├── generateAdjMs.m ├── getCommunicability.m ├── getCoordsFromLayout.m ├── getISInTh.m ├── makeHeatMap.m ├── mergeSpikes.m ├── notBoxPlotRF.m ├── npy-matlab-master │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── examples │ │ └── exampleMemmap.m │ ├── npy-matlab │ │ ├── constructNPYheader.m │ │ ├── datToNPY.m │ │ ├── readNPY.m │ │ ├── readNPYheader.m │ │ └── writeNPY.m │ └── tests │ │ ├── data │ │ ├── chelsea_float32.npy │ │ ├── chelsea_float64.npy │ │ ├── chelsea_int16.npy │ │ ├── chelsea_int32.npy │ │ ├── chelsea_int64.npy │ │ ├── chelsea_int8.npy │ │ ├── chelsea_uint16.npy │ │ ├── chelsea_uint32.npy │ │ ├── chelsea_uint64.npy │ │ ├── chelsea_uint8.npy │ │ ├── matlab_chelsea_float32.npy │ │ ├── matlab_chelsea_float64.npy │ │ ├── matlab_chelsea_int16.npy │ │ ├── matlab_chelsea_int32.npy │ │ ├── matlab_chelsea_int64.npy │ │ ├── matlab_chelsea_int8.npy │ │ ├── matlab_chelsea_uint16.npy │ │ ├── matlab_chelsea_uint32.npy │ │ ├── matlab_chelsea_uint64.npy │ │ ├── matlab_chelsea_uint8.npy │ │ ├── matlab_sine_float32.npy │ │ ├── matlab_sine_float64.npy │ │ ├── matlab_sine_int16.npy │ │ ├── matlab_sine_int32.npy │ │ ├── matlab_sine_int64.npy │ │ ├── matlab_sine_int8.npy │ │ ├── matlab_sine_uint16.npy │ │ ├── matlab_sine_uint32.npy │ │ ├── matlab_sine_uint64.npy │ │ ├── matlab_sine_uint8.npy │ │ ├── sine_float32.npy │ │ ├── sine_float64.npy │ │ ├── sine_int16.npy │ │ ├── sine_int32.npy │ │ ├── sine_int64.npy │ │ ├── sine_int8.npy │ │ ├── sine_uint16.npy │ │ ├── sine_uint32.npy │ │ ├── sine_uint64.npy │ │ ├── sine_uint8.npy │ │ └── test.npy │ │ ├── npy.ipynb │ │ ├── test_npy_roundtrip.py │ │ └── test_readNPY.m ├── participation_coef_norm.m ├── pipelineSaveFig.m ├── plotConnectivityProperties.m ├── plotElectrodeLayout.m ├── plotElectrodeTraceGUI.m ├── plotGraphMetricsByLag.m ├── plotHalfViolinByX.m ├── plotNMF.m ├── plotNetMetNodeCartography.m ├── plotNetworkWideMetrics.m ├── plotNodeCartography.m ├── plotNodeCartographyProportions.m ├── plotNullModelIterations.m ├── plotSpikeDetectionChecks.m ├── plotStats.m ├── plotting │ ├── getEdgeThreshold.m │ ├── getNodeCoords.m │ ├── getNodeSize.m │ └── plotNodeHeatmap.m ├── progressbar.m ├── randomiseSpikeTrain.m ├── rasterPlot.m ├── release_notes.html ├── release_notes.m ├── removeAxis.m ├── resampleMatrix.m ├── saveEphysStats.m ├── saveNetMet.m ├── setUpSpreadSheet.m ├── singleChannelBurstDetection.m ├── sjKDE │ ├── KDE2.m │ ├── bandwidth_SJ.m │ └── improvedSJkde.m ├── sparseCov.m ├── spikeMatrixToSpikeTimes.m ├── spikeTimeToMatrix.m ├── spikeTimesToSpikeMatrix.m ├── stats │ ├── oneway-RMANOVA │ │ ├── RMAOV1.m │ │ └── license.txt │ └── rm_anova2 │ │ ├── license.txt │ │ └── rm_anova2.m ├── stimAnalysis │ ├── batchDetectStim.asv │ ├── batchDetectStim.m │ ├── batchPlotStim.m │ ├── checkStimPattern.m │ ├── detectStimTimes.m │ ├── getFrAlignedToStim.m │ ├── getSpikeLatencyRelStim.m │ ├── getStimPatterns.m │ ├── plotIdvStimDataAndTrace.m │ ├── plotMetricAlignedToStim.m │ ├── plotPrePostStimFR.m │ ├── plotStimDetectionChecks.m │ ├── plotStimHeatmap.m │ ├── plotStimHeatmapWmetric.m │ ├── plotStimTimes.m │ ├── removeStimSpikes.m │ ├── stimActivityAnalysis.m │ └── valuesToColormap.m ├── tempdynamicsPC.m ├── tight_subplot │ ├── license.txt │ └── tight_subplot.m ├── twoPhoton │ ├── __pycache__ │ │ ├── readOpsNPY.cpython-38.pyc │ │ └── readStatNPY.cpython-38.pyc │ ├── appCheckSuite2pData.m │ ├── calTwopActivityStats.m │ ├── denoiseSuite2pData.py │ ├── get2pActivityMatrix.m │ ├── getCellTypeMatrix.m │ ├── plot2ptraces.m │ ├── readOpsNPY.py │ ├── readStatNPY.py │ └── suite2pToAdjm.m └── util │ ├── checkCSV.m │ ├── checkIfRecomputeMetric.m │ ├── checkMetricPrevComputed.m │ ├── getMemoryUsage.m │ ├── getVersion.m │ ├── isImageFile.m │ ├── loadExpData.m │ ├── natsort │ ├── license.txt │ ├── natsort.m │ ├── natsort_doc.m │ ├── natsort_test.m │ └── testfun_nsx.m │ ├── traverseFolder.m │ ├── traverseFolderAndStop.m │ ├── traverseFolderDepth2.m │ └── updateCSVstatusInGui.m ├── Images ├── BC.png ├── CC.png ├── Dens.png ├── EW.png ├── Eglob.png ├── Eloc.png ├── MS.png ├── ND.png ├── NS.png ├── NodeCartographyDiagram.jpg ├── NodeCartographyFull.jpg ├── PC.png ├── PL.png ├── SW.png ├── WMZ.png └── nMod.png ├── LICENSE ├── MEANAPApp.mlapp ├── MEANAPviewer.mlapp ├── MEApipeline.m ├── README.md ├── docs ├── .readthedocs.yaml ├── Makefile ├── _build │ ├── doctrees │ │ ├── citing-MEANAP.doctree │ │ ├── environment.pickle │ │ ├── frequently-asked-questions.doctree │ │ ├── guide-for-advanced-users.doctree │ │ ├── guide-for-new-users.doctree │ │ ├── how-to-contribute.doctree │ │ ├── index.doctree │ │ ├── meanap-methods.doctree │ │ ├── meanap-outputs.doctree │ │ ├── running-MEANAP-on-HPC.doctree │ │ ├── setting-up-matlab.doctree │ │ ├── setting-up-meanap.doctree │ │ ├── sources.doctree │ │ └── system-requirements.doctree │ └── html │ │ ├── .buildinfo │ │ ├── .buildinfo.bak │ │ ├── _images │ │ ├── BC.png │ │ ├── CC.png │ │ ├── Dens.png │ │ ├── EW.png │ │ ├── MEANAPoverview.png │ │ ├── MEApipeline.png │ │ ├── MS.png │ │ ├── ND.png │ │ ├── N_size.png │ │ ├── N_strength.png │ │ ├── PC.png │ │ ├── PL.png │ │ ├── WMZ.png │ │ ├── axion_file_conversion_gui.png │ │ ├── axion_file_conversion_gui_v1p10p0.png │ │ ├── burst_detection.png │ │ ├── connectivity_gui.png │ │ ├── example-spreadsheet-input.png │ │ ├── firing_rates.png │ │ ├── firing_rates_2.png │ │ ├── general_gui.png │ │ ├── github_repo.png │ │ ├── global_efficiency.png │ │ ├── local_efficiency.png │ │ ├── matlab_addon_dropdown_menu.png │ │ ├── matlab_home_menu.png │ │ ├── mexmaci64_error.png │ │ ├── nMod.png │ │ ├── node_cartography_2.png │ │ ├── node_cartography_3.png │ │ ├── node_cartography_4.png │ │ ├── node_cartography_proportions.png │ │ ├── num_electrodes.png │ │ ├── num_electrodes_2.png │ │ ├── plotting_gui.png │ │ ├── probabilistic_thresholding.png │ │ ├── run_button.png │ │ ├── save_parameters_gui.png │ │ ├── small_world_coefficient_1.png │ │ ├── small_world_coefficient_2.png │ │ ├── spike_detection.png │ │ ├── spike_detection_gui.png │ │ ├── spike_detection_methods.png │ │ ├── template_based_options_2.png │ │ └── threshold_based_options_2.png │ │ ├── _sources │ │ ├── citing-MEANAP.rst.txt │ │ ├── frequently-asked-questions.rst.txt │ │ ├── guide-for-advanced-users.rst.txt │ │ ├── guide-for-new-users.rst.txt │ │ ├── how-to-contribute.rst.txt │ │ ├── index.rst.txt │ │ ├── meanap-methods.rst.txt │ │ ├── meanap-outputs.rst.txt │ │ ├── running-MEANAP-on-HPC.rst.txt │ │ ├── setting-up-matlab.rst.txt │ │ ├── setting-up-meanap.rst.txt │ │ ├── sources.rst.txt │ │ └── system-requirements.rst.txt │ │ ├── _static │ │ ├── _sphinx_javascript_frameworks_compat.js │ │ ├── basic.css │ │ ├── css │ │ │ ├── custom.css │ │ │ ├── micromodal.css │ │ │ ├── tooltipster-sideTip-borderless.min.css │ │ │ ├── tooltipster-sideTip-light.min.css │ │ │ ├── tooltipster-sideTip-noir.min.css │ │ │ ├── tooltipster-sideTip-punk.min.css │ │ │ ├── tooltipster-sideTip-shadow.min.css │ │ │ ├── tooltipster.bundle.min.css │ │ │ └── tooltipster.custom.css │ │ ├── debug.css │ │ ├── doctools.js │ │ ├── documentation_options.js │ │ ├── file.png │ │ ├── jquery.js │ │ ├── js │ │ │ ├── hoverxref.js │ │ │ ├── micromodal.min.js │ │ │ └── tooltipster.bundle.min.js │ │ ├── language_data.js │ │ ├── minus.png │ │ ├── plus.png │ │ ├── pygments.css │ │ ├── scripts │ │ │ ├── furo-extensions.js │ │ │ ├── furo.js │ │ │ ├── furo.js.LICENSE.txt │ │ │ └── furo.js.map │ │ ├── searchtools.js │ │ ├── skeleton.css │ │ ├── sphinx_highlight.js │ │ └── styles │ │ │ ├── furo-extensions.css │ │ │ ├── furo-extensions.css.map │ │ │ ├── furo.css │ │ │ └── furo.css.map │ │ ├── citing-MEANAP.html │ │ ├── frequently-asked-questions.html │ │ ├── genindex.html │ │ ├── guide-for-advanced-users.html │ │ ├── guide-for-new-users.html │ │ ├── how-to-contribute.html │ │ ├── index.html │ │ ├── meanap-methods.html │ │ ├── meanap-outputs.html │ │ ├── objects.inv │ │ ├── running-MEANAP-on-HPC.html │ │ ├── search.html │ │ ├── searchindex.js │ │ ├── setting-up-matlab.html │ │ ├── setting-up-meanap.html │ │ ├── sources.html │ │ └── system-requirements.html ├── _templates │ └── layout.html ├── citing-MEANAP.rst ├── conf.py ├── frequently-asked-questions.rst ├── guide-for-advanced-users.rst ├── guide-for-new-users.rst ├── how-to-contribute.rst ├── imgs │ ├── BC.png │ ├── CC.png │ ├── ConvertRawtoMat.png │ ├── Dens.png │ ├── EW.png │ ├── Eglob.png │ ├── Eloc.png │ ├── MEANAP_dir_gui.png │ ├── MEANAPoverview.png │ ├── MEApipeline.png │ ├── MEApipelineSteps.svg │ ├── MEApipelineSteps2.png │ ├── MS.png │ ├── ND.png │ ├── NS.png │ ├── N_size.png │ ├── N_strength.png │ ├── NodeCartographyDiagram.jpg │ ├── NodeCartographyFull.jpg │ ├── NodeCartography_NoBoundaryNumbers.svg │ ├── PC.png │ ├── PL.png │ ├── SW.png │ ├── WMZ.png │ ├── axion_file_conversion_gui.png │ ├── axion_file_conversion_gui_v1p10p0.png │ ├── burst_detection.png │ ├── connectivity_gui.png │ ├── csv_file_example.png │ ├── curve_fitting_toolbox.png │ ├── example-input-file-workspace.png │ ├── example-spreadsheet-input.png │ ├── firing_rates.png │ ├── firing_rates_2.png │ ├── firing_rates_3.png │ ├── general_gui.png │ ├── github_repo.png │ ├── global_efficiency.png │ ├── local_efficiency.png │ ├── matlab_addon_dropdown_menu.png │ ├── matlab_addon_explorer.png │ ├── matlab_home_menu.png │ ├── mcs_file_conversion_gui.png │ ├── mexmaci64_error.png │ ├── nMod.png │ ├── node_cartography.png │ ├── node_cartography_2.png │ ├── node_cartography_3.png │ ├── node_cartography_4.png │ ├── node_cartography_proportions.png │ ├── num_electrodes.png │ ├── num_electrodes_2.png │ ├── parallel_computing_toolbox.png │ ├── pipeline-steps.png │ ├── plotting_gui.png │ ├── prior_analysis_gui.png │ ├── probabilistic_thresholding.png │ ├── rawConvert.png │ ├── run_button.png │ ├── save_parameters_gui.png │ ├── signal_processing_toolbox.png │ ├── small_world_coeff1.png │ ├── small_world_coeff2.png │ ├── small_world_coefficient_1.png │ ├── small_world_coefficient_2.png │ ├── spike_detection.png │ ├── spike_detection_gui.png │ ├── spike_detection_methods.png │ ├── stats_and_ML_toolbox.png │ ├── template_based_options.png │ ├── template_based_options_2.png │ ├── threshold_based_options.png │ ├── threshold_based_options_2.png │ └── v1p10p0 │ │ ├── connectivity_gui.png │ │ ├── general_gui.png │ │ ├── num_electrodes.png │ │ ├── num_electrodes_2.png │ │ ├── plotting_gui.png │ │ └── spike_detection_gui.png ├── index.rst ├── make.bat ├── meanap-methods.rst ├── meanap-outputs.rst ├── requirements.txt ├── running-MEANAP-on-HPC.rst ├── setting-up-matlab.rst ├── setting-up-meanap.rst ├── sources.rst └── system-requirements.rst ├── downloadExampleData.m ├── getParamsFromApp.m ├── imgs └── figureLegends.csv ├── mea-nap-logo-transparent.png ├── pipelineReadCSV.m ├── python ├── compile_plots.py ├── feature-schematic-figures │ ├── classification.svg │ ├── isi_within_network_burst.svg │ ├── linePlot.svg │ ├── network_burst.svg │ ├── probabilistic_thresholding.svg │ ├── raster.svg │ ├── sttc.svg │ ├── template_spike_detection.svg │ └── threshold_spike_detection.svg └── feature-schematic.ipynb ├── runMEANAPviewer.m ├── runPipelineApp.m ├── runStimDetectionApp.m ├── sand_logo.jpg ├── sensitivityAnalysis ├── WattsStrogatz.m ├── genRandNetwork.m ├── genRandSmallWorldNetwork.m ├── meanEdgeWeightSampleNetworks.mat ├── meanEdgeWeightSensitivity.png ├── meanEdgeWeightSensitivity.svg ├── nModulesSampleNetworks.mat ├── networkDensitySampleNetworks.mat ├── networkDensitySensitivity.png ├── networkDensitySensitivity.svg ├── numModulesSensitivity.png ├── numModulesSensitivity.svg ├── rewireNetwork.asv ├── rewireNetwork.m ├── smallWorldOmegaSampleNetworks.mat ├── smallWorldOmegaSensitivity.png ├── smallWorldOmegaSensitivity.svg ├── testSensitivity.asv ├── testSensitivity.m ├── top10meanPCSampleNetworks.mat ├── top10meanPCSensitivity.png └── top10meanPCSensitivity.svg ├── setAppParams.m ├── stimDetectionApp.mlapp └── version.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_store -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Functions/McsMatlabDataTools"] 2 | path = Functions/McsMatlabDataTools 3 | url = https://github.com/multichannelsystems/McsMatlabDataTools 4 | -------------------------------------------------------------------------------- /Functions/+NBP/jitterExamples.m: -------------------------------------------------------------------------------- 1 | function jitterExamples 2 | 3 | % 4 | % % Jitter examples 5 | % % default jitter is 0.3 6 | % 7 | % clf 8 | % 9 | % R = randn(40,5); 10 | % 11 | % subplot(3,1,1) 12 | % notBoxPlot(R,'jitter',0.15) 13 | % 14 | % subplot(3,1,2) 15 | % notBoxPlot(R,'jitter',0.3); % The default 16 | % 17 | % subplot(3,1,3) 18 | % notBoxPlot(R,'jitter',0.6); 19 | 20 | 21 | help(['NBP.',mfilename]) 22 | 23 | clf 24 | 25 | R = randn(40,5); 26 | 27 | subplot(3,1,1) 28 | notBoxPlot(R,'jitter',0.15) 29 | 30 | subplot(3,1,2) 31 | notBoxPlot(R,'jitter',0.3); % The default 32 | 33 | subplot(3,1,3) 34 | notBoxPlot(R,'jitter',0.6); 35 | -------------------------------------------------------------------------------- /Functions/+NBP/lineExamples.m: -------------------------------------------------------------------------------- 1 | function lineExamples 2 | 3 | % % Mixing lines and areas and using different number of points 4 | % % in each group [note that the way notBoxPlot sets the x axis 5 | % % limits can cause problems when combining plots this way] 6 | % 7 | % clf 8 | % 9 | % subplot(1,2,1) 10 | % h=notBoxPlot(randn(10,1)+4,5,'style','line'); 11 | % set(h.data,'color','m') 12 | % h=notBoxPlot(randn(50,10)); 13 | % set(h(5).data,'color','m') 14 | % 15 | % subplot(1,2,2) 16 | % notBoxPlot(randn(25,1),1,'style','sdline') 17 | % notBoxPlot(randn(50,1),2) % more points 18 | % xlim([0,3]) 19 | 20 | help(['NBP.',mfilename]) 21 | 22 | clf 23 | 24 | subplot(1,2,1) 25 | h=notBoxPlot(randn(10,1)+4,5,'style','line'); 26 | set(h.data,'color','m') 27 | h=notBoxPlot(randn(50,10)); 28 | set(h(5).data,'color','m') 29 | 30 | subplot(1,2,2) 31 | notBoxPlot(randn(25,1),1,'style','sdline') 32 | notBoxPlot(randn(50,1),2) % more points 33 | xlim([0,3]) 34 | -------------------------------------------------------------------------------- /Functions/+NBP/simpleExamples.m: -------------------------------------------------------------------------------- 1 | function simpleExamples 2 | % 3 | % clf 4 | % 5 | % subplot(2,2,1) 6 | % notBoxPlot(randn(20,5)); 7 | % 8 | % subplot(2,2,2) 9 | % notBoxPlot(randn(20,5),[1:4,7]); 10 | % 11 | % subplot(2,2,3) 12 | % h=notBoxPlot(randn(10,20)); 13 | % d=[h.data]; 14 | % set(d(1:4:end),'markerfacecolor',[0.4,1,0.4],'color',[0,0.4,0]) 15 | % 16 | % subplot(2,2,4) 17 | % x=[1,2,3,4,5,5]; 18 | % y=randn(20,length(x)); 19 | % y(:,end)=y(:,end)+3; 20 | % y(:,end-1)=y(:,end-1)-1; 21 | % notBoxPlot(y,x); 22 | 23 | help(['NBP.',mfilename]) 24 | 25 | clf 26 | 27 | subplot(2,2,1) 28 | notBoxPlot(randn(20,5)); 29 | 30 | subplot(2,2,2) 31 | notBoxPlot(randn(20,5),[1:4,7]); 32 | 33 | subplot(2,2,3) 34 | h=notBoxPlot(randn(10,20)); 35 | d=[h.data]; 36 | set(d(1:4:end),'markerfacecolor',[0.4,1,0.4],'color',[0,0.4,0]) 37 | 38 | 39 | subplot(2,2,4) 40 | x=[1,2,3,4,5,5]; 41 | y=randn(20,length(x)); 42 | y(:,end)=y(:,end)+3; 43 | y(:,end-1)=y(:,end-1)-1; 44 | notBoxPlot(y,x); 45 | -------------------------------------------------------------------------------- /Functions/+NBP/statsOptionsExample.m: -------------------------------------------------------------------------------- 1 | function statsOptionsExamples 2 | 3 | % 4 | % % Examples of different statistics options 5 | % 6 | % % The 95% SEM vs the 95% t-interval 7 | % clf 8 | % y=randn(8,3); 9 | % subplot(2,2,1) 10 | % notBoxPlot(y) 11 | % title('95% SEM (n=8)') 12 | % 13 | % subplot(2,2,2) 14 | % notBoxPlot(y,'interval','tInterval') 15 | % title('95% t-interval (n=8)') 16 | % 17 | % % Adding medians 18 | % subplot(2,2,:3:4) 19 | % n=[5,10,20,40]; 20 | % for ii=1:4 21 | % rng(555), notBoxPlot(rand(1,n(ii)),ii,'markMedian',true) 22 | % end 23 | % title('median vs mean') 24 | 25 | 26 | help(['NBP.',mfilename]) 27 | 28 | % The 95% SEM vs the 95% t-interval 29 | clf 30 | y=randn(8,3); 31 | subplot(2,2,1) 32 | notBoxPlot(y) 33 | title('95% SEM (n=8)') 34 | 35 | subplot(2,2,2) 36 | notBoxPlot(y,'interval','tInterval') 37 | title('95% t-interval (n=8)') 38 | 39 | % Adding medians 40 | subplot(2,2,3:4) 41 | n=[5,10,20,40]; 42 | for ii=1:4 43 | rng(555), notBoxPlot(rand(1,n(ii)),ii,'markMedian',true) 44 | end 45 | title('median vs mean') -------------------------------------------------------------------------------- /Functions/+NBP/tableExamples.m: -------------------------------------------------------------------------------- 1 | function tableExamples 2 | 3 | % % Table call format 4 | % 5 | % clf 6 | % 7 | % albert=[1,1,1,3,2,1,3,3,3,2,2,3,3]'; 8 | % victoria=[7,8,6,1,5,7,2,1,3,4,5,2,4]'; 9 | % M = table(victoria,albert); %place data in first column and groups in the second 10 | % 11 | % subplot(1,2,1) 12 | % notBoxPlot(M) 13 | % 14 | % subplot(1,2,2) 15 | % notBoxPlot(M,'jitter',0.5) 16 | 17 | 18 | help(['NBP.',mfilename]) 19 | 20 | 21 | clf 22 | 23 | albert=[1,1,1,3,2,1,3,3,3,2,2,3,3]'; 24 | victoria=[7,8,6,1,5,7,2,1,3,4,5,2,4]'; 25 | 26 | M = table(victoria,albert); %place data in first column and groups in the second 27 | 28 | subplot(1,2,1) 29 | notBoxPlot(M) 30 | 31 | subplot(1,2,2) 32 | notBoxPlot(M,'jitter',0.75) -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/agreement_weighted.m: -------------------------------------------------------------------------------- 1 | function D = agreement_weighted(CI,Wts) 2 | % AGREEMENT_WEIGHTED Weights agreement matrix 3 | % 4 | % D = AGREEMENT_WEIGHTED(CI,WTS) is identical to AGREEMENT, with the 5 | % exception that each partitions contribution is weighted according to 6 | % the corresponding scalar value stored in the vector WTS. As an example, 7 | % suppose CI contained partitions obtained using some heuristic for 8 | % maximizing modularity. A possible choice for WTS might be the Q metric 9 | % (Newman's modularity score). Such a choice would add more weight to 10 | % higher modularity partitions. 11 | % 12 | % NOTE: Unlike AGREEMENT, this script does not have the input argument 13 | % BUFFSZ. 14 | % 15 | % Inputs: CI, set of partitions 16 | % WTS, relative weight of importance of each paritition 17 | % 18 | % Outputs: D, weighted agreement matrix 19 | % 20 | % Richard Betzel, Indiana University, 2013 21 | 22 | Wts = Wts./sum(Wts); 23 | [N,M] = size(CI); 24 | D = zeros(N); 25 | for i = 1:M 26 | d = dummyvar(CI(:,i)); 27 | D = D + (d*d')*Wts(i); 28 | end -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/breadthdist.m: -------------------------------------------------------------------------------- 1 | function [R,D] = breadthdist(CIJ) 2 | %BREADTHDIST Reachability and distance matrices 3 | % 4 | % [R,D] = breadthdist(CIJ); 5 | % 6 | % The binary reachability matrix describes reachability between all pairs 7 | % of nodes. An entry (u,v)=1 means that there exists a path from node u 8 | % to node v; alternatively (u,v)=0. 9 | % 10 | % The distance matrix contains lengths of shortest paths between all 11 | % pairs of nodes. An entry (u,v) represents the length of shortest path 12 | % from node u to node v. The average shortest path length is the 13 | % characteristic path length of the network. 14 | % 15 | % Input: CIJ, binary (directed/undirected) connection matrix 16 | % 17 | % Outputs: R, reachability matrix 18 | % D, distance matrix 19 | % 20 | % Note: slower but less memory intensive than "reachdist.m". 21 | % 22 | % Algorithm: Breadth-first search. 23 | % 24 | % 25 | % Olaf Sporns, Indiana University, 2002/2007/2008 26 | 27 | N = size(CIJ,1); 28 | 29 | D = zeros(N); 30 | for i=1:N 31 | D(i,:) = breadth(CIJ,i); 32 | end; 33 | 34 | % replace zeros with 'Inf's 35 | D(D==0) = Inf; 36 | 37 | % construct R 38 | R = double(D~=Inf); 39 | 40 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/clustering_coef_bu.m: -------------------------------------------------------------------------------- 1 | function C=clustering_coef_bu(G) 2 | %CLUSTERING_COEF_BU Clustering coefficient 3 | % 4 | % C = clustering_coef_bu(A); 5 | % 6 | % The clustering coefficient is the fraction of triangles around a node 7 | % (equiv. the fraction of node's neighbors that are neighbors of each other). 8 | % 9 | % Input: A, binary undirected connection matrix 10 | % 11 | % Output: C, clustering coefficient vector 12 | % 13 | % Reference: Watts and Strogatz (1998) Nature 393:440-442. 14 | % 15 | % 16 | % Mika Rubinov, UNSW, 2007-2010 17 | 18 | n=length(G); 19 | C=zeros(n,1); 20 | 21 | for u=1:n 22 | V=find(G(u,:)); 23 | k=length(V); 24 | if k>=2 %degree must be at least 2 25 | S=G(V,V); 26 | C(u)=sum(S(:))/(k^2-k); 27 | end 28 | end -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/clustering_coef_wu.m: -------------------------------------------------------------------------------- 1 | function C=clustering_coef_wu(W) 2 | %CLUSTERING_COEF_WU Clustering coefficient 3 | % 4 | % C = clustering_coef_wu(W); 5 | % 6 | % The weighted clustering coefficient is the average "intensity" 7 | % (geometric mean) of all triangles associated with each node. 8 | % 9 | % Input: W, weighted undirected connection matrix 10 | % (all weights must be between 0 and 1) 11 | % 12 | % Output: C, clustering coefficient vector 13 | % 14 | % Note: All weights must be between 0 and 1. 15 | % This may be achieved using the weight_conversion.m function, 16 | % W_nrm = weight_conversion(W, 'normalize'); 17 | % 18 | % Reference: Onnela et al. (2005) Phys Rev E 71:065103 19 | % 20 | % 21 | % Mika Rubinov, UNSW/U Cambridge, 2007-2015 22 | 23 | % Modification history: 24 | % 2007: original 25 | % 2015: expanded documentation 26 | 27 | K=sum(W~=0,2); 28 | cyc3=diag((W.^(1/3))^3); 29 | K(cyc3==0)=inf; %if no 3-cycles exist, make C=0 (via K=inf) 30 | C=cyc3./(K.*(K-1)); %clustering coefficient 31 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/degrees_dir.m: -------------------------------------------------------------------------------- 1 | function [id,od,deg] = degrees_dir(CIJ) 2 | %DEGREES_DIR Indegree and outdegree 3 | % 4 | % [id,od,deg] = degrees_dir(CIJ); 5 | % 6 | % Node degree is the number of links connected to the node. The indegree 7 | % is the number of inward links and the outdegree is the number of 8 | % outward links. 9 | % 10 | % Input: CIJ, directed (binary/weighted) connection matrix 11 | % 12 | % Output: id, node indegree 13 | % od, node outdegree 14 | % deg, node degree (indegree + outdegree) 15 | % 16 | % Notes: Inputs are assumed to be on the columns of the CIJ matrix. 17 | % Weight information is discarded. 18 | % 19 | % 20 | % Olaf Sporns, Indiana University, 2002/2006/2008 21 | 22 | 23 | % ensure CIJ is binary... 24 | CIJ = double(CIJ~=0); 25 | 26 | % compute degrees 27 | id = sum(CIJ,1); % indegree = column sum of CIJ 28 | od = sum(CIJ,2)'; % outdegree = row sum of CIJ 29 | deg = id+od; % degree = indegree+outdegree 30 | 31 | 32 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/degrees_und.m: -------------------------------------------------------------------------------- 1 | function [deg] = degrees_und(CIJ) 2 | %DEGREES_UND Degree 3 | % 4 | % deg = degrees_und(CIJ); 5 | % 6 | % Node degree is the number of links connected to the node. 7 | % 8 | % Input: CIJ, undirected (binary/weighted) connection matrix 9 | % 10 | % Output: deg, node degree 11 | % 12 | % Note: Weight information is discarded. 13 | % 14 | % 15 | % Olaf Sporns, Indiana University, 2002/2006/2008 16 | 17 | 18 | % ensure CIJ is binary... 19 | CIJ = double(CIJ~=0); 20 | 21 | deg = sum(CIJ); 22 | 23 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/density_dir.m: -------------------------------------------------------------------------------- 1 | function [kden,N,K] = density_dir(CIJ) 2 | % DENSITY_DIR Density 3 | % 4 | % kden = density_dir(CIJ); 5 | % [kden,N,K] = density_dir(CIJ); 6 | % 7 | % Density is the fraction of present connections to possible connections. 8 | % 9 | % Input: CIJ, directed (weighted/binary) connection matrix 10 | % 11 | % Output: kden, density 12 | % N, number of vertices 13 | % K, number of edges 14 | % 15 | % Notes: Assumes CIJ is directed and has no self-connections. 16 | % Weight information is discarded. 17 | % 18 | % 19 | % Olaf Sporns, Indiana University, 2002/2007/2008 20 | 21 | N = size(CIJ,1); 22 | K = nnz(CIJ); 23 | kden = K/(N^2-N); 24 | 25 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/density_und.m: -------------------------------------------------------------------------------- 1 | function [kden,N,K] = density_und(CIJ) 2 | % DENSITY_UND Density 3 | % 4 | % kden = density_und(CIJ); 5 | % [kden,N,K] = density_und(CIJ); 6 | % 7 | % Density is the fraction of present connections to possible connections. 8 | % 9 | % Input: CIJ, undirected (weighted/binary) connection matrix 10 | % 11 | % Output: kden, density 12 | % N, number of vertices 13 | % K, number of edges 14 | % 15 | % Notes: Assumes CIJ is undirected and has no self-connections. 16 | % Weight information is discarded. 17 | % 18 | % 19 | % Olaf Sporns, Indiana University, 2002/2007/2008 20 | 21 | 22 | % Modification history: 23 | % 2009-10: K fixed to sum over one half of CIJ [Tony Herdman, SFU] 24 | 25 | N = size(CIJ,1); 26 | K = nnz(triu(CIJ)); 27 | kden = K/((N^2-N)/2); 28 | 29 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/diffusion_efficiency.m: -------------------------------------------------------------------------------- 1 | function [GEdiff,Ediff] = diffusion_efficiency(adj) 2 | % DIFFUSION_EFFICIENCY Global mean and pair-wise diffusion efficiency 3 | % 4 | % [GEdiff,Ediff] = diffusion_efficiency(adj); 5 | % 6 | % The diffusion efficiency between nodes i and j is the inverse of the 7 | % mean first passage time from i to j, that is the expected number of 8 | % steps it takes a random walker starting at node i to arrive for the 9 | % first time at node j. Note that the mean first passage time is not a 10 | % symmetric measure -- mfpt(i,j) may be different from mfpt(j,i) -- and 11 | % the pair-wise diffusion efficiency matrix is hence also not symmetric. 12 | % 13 | % 14 | % Input: 15 | % adj, Weighted/Unweighted, directed/undirected adjacency matrix 16 | % 17 | % 18 | % Outputs: 19 | % GEdiff, Mean Global diffusion efficiency (scalar) 20 | % Ediff, Pair-wise diffusion efficiency (matrix) 21 | % 22 | % 23 | % References: Goñi J, et al (2013) PLoS ONE 24 | % 25 | % Joaquin Goñi and Andrea Avena-Koenigsberger, IU Bloomington, 2012 26 | 27 | 28 | n = size(adj,1); 29 | mfpt = mean_first_passage_time(adj); 30 | Ediff = 1./mfpt; 31 | Ediff(eye(n)>0) = 0; 32 | GEdiff = sum(Ediff(~eye(n)>0))/(n^2-n); 33 | 34 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/distance_bin.m: -------------------------------------------------------------------------------- 1 | function D=distance_bin(A) 2 | %DISTANCE_BIN Distance matrix 3 | % 4 | % D = distance_bin(A); 5 | % 6 | % The distance matrix contains lengths of shortest paths between all 7 | % pairs of nodes. An entry (u,v) represents the length of shortest path 8 | % from node u to node v. The average shortest path length is the 9 | % characteristic path length of the network. 10 | % 11 | % Input: A, binary directed/undirected connection matrix 12 | % 13 | % Output: D, distance matrix 14 | % 15 | % Notes: 16 | % Lengths between disconnected nodes are set to Inf. 17 | % Lengths on the main diagonal are set to 0. 18 | % 19 | % Algorithm: Algebraic shortest paths. 20 | % 21 | % 22 | % Mika Rubinov, U Cambridge 23 | % Jonathan Clayden, UCL 24 | % 2007-2013 25 | 26 | % Modification history: 27 | % 2007: Original (MR) 28 | % 2013: Bug fix, enforce zero distance for self-connections (JC) 29 | 30 | A=double(A~=0); %binarize and convert to double format 31 | 32 | l=1; %path length 33 | Lpath=A; %matrix of paths l 34 | D=A; %distance matrix 35 | 36 | Idx=true; 37 | while any(Idx(:)) 38 | l=l+1; 39 | Lpath=Lpath*A; 40 | Idx=(Lpath~=0)&(D==0); 41 | D(Idx)=l; 42 | end 43 | 44 | D(~D)=inf; %assign inf to disconnected nodes 45 | D(1:length(A)+1:end)=0; %clear diagonal -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/eigenvector_centrality_und.m: -------------------------------------------------------------------------------- 1 | function v = eigenvector_centrality_und(CIJ) 2 | %EIGENVECTOR_CENTRALITY_UND Spectral measure of centrality 3 | % 4 | % v = eigenvector_centrality_und(CIJ) 5 | % 6 | % Eigenector centrality is a self-referential measure of centrality: 7 | % nodes have high eigenvector centrality if they connect to other nodes 8 | % that have high eigenvector centrality. The eigenvector centrality of 9 | % node i is equivalent to the ith element in the eigenvector 10 | % corresponding to the largest eigenvalue of the adjacency matrix. 11 | % 12 | % Inputs: CIJ, binary/weighted undirected adjacency matrix. 13 | % 14 | % Outputs: v, eigenvector associated with the largest 15 | % eigenvalue of the adjacency matrix CIJ. 16 | % 17 | % Reference: Newman, MEJ (2002). The mathematics of networks. 18 | % 19 | % Contributors: 20 | % Xi-Nian Zuo, Chinese Academy of Sciences, 2010 21 | % Rick Betzel, Indiana University, 2012 22 | % Mika Rubinov, University of Cambridge, 2015 23 | 24 | % MODIFICATION HISTORY 25 | % 2010/2012: original (XNZ, RB) 26 | % 2015: ensure the use of leading eigenvector (MR) 27 | 28 | 29 | n = length(CIJ); 30 | if n < 1000 31 | [V,D] = eig(CIJ); 32 | else 33 | [V,D] = eigs(sparse(CIJ)); 34 | end 35 | [~,idx] = max(diag(D)); 36 | ec = abs(V(:,idx)); 37 | v = reshape(ec, length(ec), 1); -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/erange.m: -------------------------------------------------------------------------------- 1 | function [Erange,eta,Eshort,fs] = erange(CIJ) 2 | %ERANGE Shortcuts 3 | % 4 | % [Erange,eta,Eshort,fs] = erange(CIJ); 5 | % 6 | % Shorcuts are central edges which significantly reduce the 7 | % characteristic path length in the network. 8 | % 9 | % Input: CIJ, binary directed connection matrix 10 | % 11 | % Outputs: Erange, range for each edge, i.e. the length of the 12 | % shortest path from i to j for edge c(i,j) AFTER 13 | % the edge has been removed from the graph. 14 | % eta average range for entire graph. 15 | % Eshort entries are ones for shortcut edges. 16 | % fs fraction of shortcuts in the graph. 17 | % 18 | % Follows the treatment of 'shortcuts' by Duncan Watts 19 | % 20 | % 21 | % Olaf Sporns, Indiana University, 2002/2007/2008 22 | 23 | 24 | N = size(CIJ,1); 25 | K = length(nonzeros(CIJ)); 26 | Erange = zeros(N,N); 27 | [i,j] = find(CIJ==1); 28 | 29 | for c=1:length(i) 30 | CIJcut = CIJ; 31 | CIJcut(i(c),j(c)) = 0; 32 | [~, D] = reachdist(CIJcut); 33 | Erange(i(c),j(c)) = D(i(c),j(c)); 34 | end; 35 | 36 | % average range (ignore Inf) 37 | eta = sum(Erange((Erange>0)&(Erange0)&(Erange 2, then the edge is a shortcut. 42 | % 'fshort' is the fraction of shortcuts over the entire graph. 43 | 44 | Eshort = Erange>2; 45 | fs = length(nonzeros(Eshort))/K; -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/findwalks.m: -------------------------------------------------------------------------------- 1 | function [Wq,twalk,wlq] = findwalks(CIJ) 2 | %FINDWALKS Network walks 3 | % 4 | % [Wq,twalk,wlq] = findwalks(CIJ); 5 | % 6 | % Walks are sequences of linked nodes, that may visit a single node more 7 | % than once. This function finds the number of walks of a given length, 8 | % between any two nodes. 9 | % 10 | % Input: CIJ binary (directed/undirected) connection matrix 11 | % 12 | % Outputs: Wq 3D matrix, Wq(i,j,q) is the number of walks 13 | % from 'i' to 'j' of length 'q'. 14 | % twalk total number of walks found 15 | % wlq walk length distribution as function of 'q' 16 | % 17 | % Notes: Wq grows very quickly for larger N,K,q. Weights are discarded. 18 | % 19 | % Algorithm: algebraic path count 20 | % 21 | % 22 | % Olaf Sporns, Indiana University, 2002/2007/2008 23 | 24 | % ensure CIJ is binary... 25 | CIJ = double(CIJ~=0); 26 | 27 | N = size(CIJ,1); 28 | Wq = zeros(N,N,N); 29 | CIJpwr = CIJ; 30 | Wq(:,:,1) = CIJ; 31 | for q=2:N 32 | CIJpwr = CIJpwr*CIJ; 33 | Wq(:,:,q) = CIJpwr; 34 | end; 35 | 36 | % total number of walks 37 | twalk = sum(sum(sum(Wq))); 38 | 39 | % walk length distribution 40 | wlq = reshape(sum(sum(Wq)),1,N); 41 | 42 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/kcoreness_centrality_bd.m: -------------------------------------------------------------------------------- 1 | function [coreness,kn] = kcoreness_centrality_bd(CIJ) 2 | %KCORENESS_CENTRALITY_BD K-coreness centrality 3 | % 4 | % [coreness,kn] = kcoreness_centrality_bd(CIJ) 5 | % 6 | % The k-core is the largest subgraph comprising nodes of degree at least 7 | % k. The coreness of a node is k if the node belongs to the k-core but 8 | % not to the (k+1)-core. This function computes k-coreness of all nodes 9 | % for a given binary directed connection matrix. 10 | % 11 | % input: CIJ, connection/adjacency matrix (binary, directed) 12 | % 13 | % output: coreness, node coreness. 14 | % kn, size of k-core 15 | % 16 | % References: e.g. Hagmann et al. (2008) PLoS Biology 17 | % 18 | % Olaf Sporns, Indiana University, 2007/2008/2010/2012 19 | 20 | N = size(CIJ,1); 21 | 22 | coreness = zeros(1,N); kn = zeros(1,N); 23 | for k=1:N 24 | [CIJkcore,kn(k)] = kcore_bd(CIJ,k); 25 | ss = sum(CIJkcore)>0; 26 | coreness(ss) = k; 27 | end; 28 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/kcoreness_centrality_bu.m: -------------------------------------------------------------------------------- 1 | function [coreness,kn] = kcoreness_centrality_bu(CIJ) 2 | %KCORENESS_CENTRALITY_BU K-coreness centrality 3 | % 4 | % [coreness,kn] = kcoreness_centrality_bu(CIJ) 5 | % 6 | % The k-core is the largest subgraph comprising nodes of degree at least 7 | % k. The coreness of a node is k if the node belongs to the k-core but 8 | % not to the (k+1)-core. This function computes the coreness of all nodes 9 | % for a given binary undirected connection matrix. 10 | % 11 | % input: CIJ, connection/adjacency matrix (binary, undirected) 12 | % 13 | % output: coreness, node coreness. 14 | % kn, size of k-core 15 | % 16 | % References: e.g. Hagmann et al. (2008) PLoS Biology 17 | % 18 | % Olaf Sporns, Indiana University, 2007/2008/2010/2012 19 | 20 | N = size(CIJ,1); 21 | 22 | % determine if the network is undirected - if not, compute coreness on the 23 | % corresponding undirected network 24 | CIJund = CIJ+CIJ'; 25 | if (any(CIJund(:)>1)) 26 | CIJ = double(CIJund>0); 27 | end; 28 | 29 | coreness = zeros(1,N); kn = zeros(1,N); 30 | for k=1:N 31 | [CIJkcore,kn(k)] = kcore_bu(CIJ,k); 32 | ss = sum(CIJkcore)>0; 33 | coreness(ss) = k; 34 | end; 35 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/makefractalCIJ.m: -------------------------------------------------------------------------------- 1 | function [CIJ,K] = makefractalCIJ(mx_lvl,E,sz_cl) 2 | %MAKEFRACTALCIJ Synthetic hierarchical modular network 3 | % 4 | % [CIJ,K] = makefractalCIJ(mx_lvl,E,sz_cl); 5 | % 6 | % This function generates a directed network with a hierarchical modular 7 | % organization. All modules are fully connected and connection density 8 | % decays as 1/(E^n), with n = index of hierarchical level. 9 | % 10 | % Inputs: mx_lvl, number of hierarchical levels, N = 2^mx_lvl 11 | % E, connection density fall-off per level 12 | % sz_cl, size of clusters (power of 2) 13 | % 14 | % Outputs: CIJ, connection matrix 15 | % K, number of connections present in the output CIJ 16 | % 17 | % 18 | % Olaf Sporns, Indiana University, 2005/2007 19 | 20 | % make a little template 21 | t = ones(2).*2; 22 | 23 | % compute N and cluster size 24 | N = 2^mx_lvl; 25 | sz_cl = sz_cl-1; 26 | 27 | % n = [0 0 0:mx_lvl-3]; 28 | 29 | for lvl=1:mx_lvl-1 30 | CIJ = ones(2^(lvl+1),2^(lvl+1)); 31 | group1 = 1:size(CIJ,1)/2; 32 | group2 = size(CIJ,1)/2+1:size(CIJ,1); 33 | CIJ(group1,group1) = t; 34 | CIJ(group2,group2) = t; 35 | CIJ = CIJ+ones(size(CIJ,1),size(CIJ,1)); 36 | t = CIJ; 37 | end; 38 | s = size(CIJ,1); 39 | CIJ = CIJ-ones(s,s)-mx_lvl.*eye(s); 40 | 41 | % assign connection probablities 42 | ee = mx_lvl-CIJ-sz_cl; 43 | ee = (ee>0).*ee; 44 | prob = (1./(E.^ee)).*(ones(s,s)-eye(s)); 45 | CIJ = (prob>rand(N)); 46 | 47 | % count connections 48 | K = sum(sum(CIJ)); 49 | 50 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/makelatticeCIJ.m: -------------------------------------------------------------------------------- 1 | function [CIJ] = makelatticeCIJ(N,K) 2 | %MAKELATTICECIJ Synthetic lattice network 3 | % 4 | % CIJ = makelatticeCIJ(N,K); 5 | % 6 | % This function generates a directed lattice network without toroidal 7 | % boundary counditions (i.e. no ring-like "wrapping around"). 8 | % 9 | % Inputs: N, number of vertices 10 | % K, number of edges 11 | % 12 | % Outputs: CIJ, connection matrix 13 | % 14 | % Note: The lattice is made by placing connections as close as possible 15 | % to the main diagonal, without wrapping around. No connections are made 16 | % on the main diagonal. In/Outdegree is kept approx. constant at K/N. 17 | % 18 | % 19 | % Olaf Sporns, Indiana University, 2005/2007 20 | 21 | % initialize 22 | CIJ = zeros(N); 23 | CIJ1 = ones(N); 24 | KK = 0; 25 | cnt = 0; 26 | seq = 1:N-1; 27 | 28 | % fill in 29 | while (KK0) 40 | [i,j] = find(dCIJ); 41 | rp = randperm(length(i)); 42 | for ii=1:overby 43 | CIJ(i(rp(ii)),j(rp(ii))) = 0; 44 | end; 45 | end; 46 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/makerandCIJ_dir.m: -------------------------------------------------------------------------------- 1 | function [CIJ] = makerandCIJ_dir(N,K) 2 | %MAKERANDCIJ_DIR Synthetic directed random network 3 | % 4 | % CIJ = makerandCIJ_dir(N,K); 5 | % 6 | % This function generates a directed random network 7 | % 8 | % Inputs: N, number of vertices 9 | % K, number of edges 10 | % 11 | % Output: CIJ, directed random connection matrix 12 | % 13 | % Note: no connections are placed on the main diagonal. 14 | % 15 | % 16 | % Olaf Sporns, Indiana University, 2007/2008 17 | 18 | ind = ~eye(N); 19 | i = find(ind); 20 | rp = randperm(length(i)); 21 | irp = i(rp); 22 | 23 | CIJ = zeros(N); 24 | CIJ(irp(1:K)) = 1; 25 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/makerandCIJ_und.m: -------------------------------------------------------------------------------- 1 | function [CIJ] = makerandCIJ_und(N,K) 2 | %MAKERANDCIJ_UND Synthetic directed random network 3 | % 4 | % CIJ = makerandCIJ_und(N,K); 5 | % 6 | % This function generates an undirected random network 7 | % 8 | % Inputs: N, number of vertices 9 | % K, number of edges 10 | % 11 | % Output: CIJ, undirected random connection matrix 12 | % 13 | % Note: no connections are placed on the main diagonal. 14 | % 15 | % 16 | % Olaf Sporns, Indiana University, 2007/2008 17 | 18 | ind = triu(~eye(N)); 19 | i = find(ind); 20 | rp = randperm(length(i)); 21 | irp = i(rp); 22 | 23 | CIJ = zeros(N); 24 | CIJ(irp(1:K)) = 1; 25 | CIJ = CIJ+CIJ'; % symmetrize 26 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/makeringlatticeCIJ.m: -------------------------------------------------------------------------------- 1 | function [CIJ] = makeringlatticeCIJ(N,K) 2 | %MAKERINGLATTICECIJ Synthetic lattice network 3 | % 4 | % CIJ = makeringlatticeCIJ(N,K); 5 | % 6 | % This function generates a directed lattice network with toroidal 7 | % boundary counditions (i.e. with ring-like "wrapping around"). 8 | % 9 | % Inputs: N, number of vertices 10 | % K, number of edges 11 | % 12 | % Outputs: CIJ, connection matrix 13 | % 14 | % Note: The lattice is made by placing connections as close as possible 15 | % to the main diagonal, with wrapping around. No connections are made 16 | % on the main diagonal. In/Outdegree is kept approx. constant at K/N. 17 | % 18 | % 19 | % Olaf Sporns, Indiana University, 2005/2007 20 | 21 | % initialize 22 | CIJ = zeros(N); 23 | CIJ1 = ones(N); 24 | KK = 0; 25 | cnt = 0; 26 | seq = 1:N-1; 27 | seq2 = N-1:-1:1; 28 | 29 | % fill in 30 | while (KK0) 42 | [i,j] = find(dCIJ); 43 | rp = randperm(length(i)); 44 | for ii=1:overby 45 | CIJ(i(rp(ii)),j(rp(ii))) = 0; 46 | end; 47 | end; 48 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/maketoeplitzCIJ.m: -------------------------------------------------------------------------------- 1 | function [CIJ] = maketoeplitzCIJ(N,K,s) 2 | %MAKETOEPLITZCIJ A synthetic directed network with Gaussian drop-off of 3 | % connectivity with distance 4 | % 5 | % CIJ = maketoeprandCIJ(N,K,s) 6 | % 7 | % This function generates a directed network with a Gaussian drop-off in 8 | % edge density with increasing distance from the main diagonal. There are 9 | % toroidal boundary counditions (i.e. no ring-like "wrapping around"). 10 | % 11 | % Inputs: N, number of vertices 12 | % K, number of edges 13 | % s, standard deviation of toeplitz 14 | % 15 | % Output: CIJ, connection matrix 16 | % 17 | % Note: no connections are placed on the main diagonal. 18 | % 19 | % 20 | % Olaf Sporns, Indiana University, 2005/2007 21 | 22 | profile = normpdf(1:N-1,0.5,s); 23 | template = toeplitz([0 profile],[0 profile]); 24 | template = template.*(K./sum(sum(template))); 25 | CIJ = zeros(N); 26 | 27 | while ((sum(sum(CIJ)) ~= K)) 28 | CIJ = (rand(N)0)); 28 | 29 | % if none found -> stop 30 | if (isempty(ff)) break; end; %#ok 31 | 32 | % peel found nodes 33 | CIJ(ff,:) = 0; 34 | CIJ(:,ff) = 0; 35 | 36 | end; 37 | 38 | CIJscore = CIJ; 39 | sn = sum(str>0); 40 | 41 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/strengths_dir.m: -------------------------------------------------------------------------------- 1 | function [is,os,str] = strengths_dir(CIJ) 2 | %STRENGTHS_DIR In-strength and out-strength 3 | % 4 | % [is,os,str] = strengths_dir(CIJ); 5 | % 6 | % Node strength is the sum of weights of links connected to the node. The 7 | % instrength is the sum of inward link weights and the outstrength is the 8 | % sum of outward link weights. 9 | % 10 | % Input: CIJ, directed weighted connection matrix 11 | % 12 | % Output: is, node instrength 13 | % os, node outstrength 14 | % str, node strength (instrength + outstrength) 15 | % 16 | % Notes: Inputs are assumed to be on the columns of the CIJ matrix. 17 | % 18 | % 19 | % Olaf Sporns, Indiana University, 2002/2006/2008 20 | 21 | 22 | % compute strengths 23 | is = sum(CIJ,1); % instrength = column sum of CIJ 24 | os = sum(CIJ,2)'; % outstrength = row sum of CIJ 25 | str = is+os; % strength = instrength+outstrength 26 | 27 | 28 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/strengths_und.m: -------------------------------------------------------------------------------- 1 | function [str] = strengths_und(CIJ) 2 | %STRENGTHS_UND Strength 3 | % 4 | % str = strengths_und(CIJ); 5 | % 6 | % Node strength is the sum of weights of links connected to the node. 7 | % 8 | % Input: CIJ, undirected weighted connection matrix 9 | % 10 | % Output: str, node strength 11 | % 12 | % 13 | % Olaf Sporns, Indiana University, 2002/2006/2008 14 | 15 | % compute strengths 16 | str = sum(CIJ); % strength 17 | 18 | 19 | -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/strengths_und_sign.m: -------------------------------------------------------------------------------- 1 | function [Spos,Sneg,vpos,vneg] = strengths_und_sign(W) 2 | %STRENGTHS_UND_SIGN Strength and weight 3 | % 4 | % [Spos Sneg] = strengths_und_sign(W); 5 | % [Spos Sneg vpos vneg] = strengths_und_sign(W); 6 | % 7 | % Node strength is the sum of weights of links connected to the node. 8 | % 9 | % Inputs: W, undirected connection matrix with positive 10 | % and negative weights 11 | % 12 | % Output: Spos/Sneg, nodal strength of positive/negative weights 13 | % vpos/vneg, total positive/negative weight 14 | % 15 | % 16 | % 2011, Mika Rubinov, UNSW 17 | 18 | % Modification History: 19 | % Mar 2011: Original 20 | 21 | 22 | n = length(W); %number of nodes 23 | W(1:n+1:end) = 0; %clear diagonal 24 | Spos = sum( W.*(W>0)); %positive strengths 25 | Sneg = sum(-W.*(W<0)); %negative strengths 26 | 27 | if nargout>2 28 | vpos = sum(Spos); %positive weight 29 | vneg = sum(Sneg); %negative weight 30 | end -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/subgraph_centrality.m: -------------------------------------------------------------------------------- 1 | function Cs = subgraph_centrality(CIJ) 2 | % SUBGRAPH_CENTRALITY Subgraph centrality of a network 3 | % 4 | % Cs = subgraph_centrality(CIJ) 5 | % 6 | % The subgraph centrality of a node is a weighted sum of closed walks of 7 | % different lengths in the network starting and ending at the node. This 8 | % function returns a vector of subgraph centralities for each node of the 9 | % network. 10 | % 11 | % Inputs: CIJ, adjacency matrix (binary) 12 | % 13 | % Outputs: Cs, subgraph centrality 14 | % 15 | % Reference: Estrada and Rodriguez-Velasquez (2005) Phys Rev E 71, 056103 16 | % Estrada and Higham (2010) SIAM Rev 52, 696. 17 | % 18 | % Xi-Nian Zuo, Chinese Academy of Sciences, 2010 19 | % Rick Betzel, Indiana University, 2012 20 | 21 | [V,lambda] = eig(CIJ); % Compute the eigenvectors and 22 | lambda = diag(lambda); % eigenvalues. 23 | V2 = V.^2; % Matrix of squares of the eigenvectors elements. 24 | Cs = real(V2 * exp(lambda)); % Compute eigenvector centrality. Lop off imaginary part remaining due to precision error. -------------------------------------------------------------------------------- /Functions/2019_03_03_BCT/threshold_absolute.m: -------------------------------------------------------------------------------- 1 | function W = threshold_absolute(W, thr) 2 | % THRESHOLD_ABSOLUTE Absolute thresholding 3 | % 4 | % W_thr = threshold_absolute(W, thr); 5 | % 6 | % This function thresholds the connectivity matrix by absolute weight 7 | % magnitude. All weights below the given threshold, and all weights 8 | % on the main diagonal (self-self connections) are set to 0. 9 | % 10 | % Inputs: W weighted or binary connectivity matrix 11 | % thr weight treshold 12 | % 13 | % Output: W_thr thresholded connectivity matrix 14 | % 15 | % 16 | % Mika Rubinov, UNSW, 2009-2010 17 | 18 | W(1:size(W,1)+1:end)=0; %clear diagonal 19 | W(Wuint8'); 18 | fWellRow = fread(aFileID, 1, 'uint8=>uint8'); 19 | fElectrodeColumn = fread(aFileID, 1, 'uint8=>uint8'); 20 | fElectrodeRow = fread(aFileID, 1, 'uint8=>uint8'); 21 | 22 | %Annotations are always broadcast 23 | if fWellColumn ~= 0 || fWellRow ~= 0 || ... 24 | fElectrodeColumn ~= 0 || fElectrodeRow ~= 0 25 | warning('File may be corrupt'); 26 | end 27 | 28 | this.NoteText = freadstring(aFileID); 29 | 30 | fStart = aRawTag.Start + TagEntry.BaseSize; 31 | if ftell(aFileID) > (fStart + aRawTag.EntryRecord.Length) 32 | warning('File may be corrupt'); 33 | end 34 | 35 | end 36 | end 37 | 38 | end 39 | 40 | -------------------------------------------------------------------------------- /Functions/AxionFileLoader/AxionFileLoader/BlockVectorData.m: -------------------------------------------------------------------------------- 1 | %{ 2 | Copyright (c) 2024 Axion BioSystems, Inc. 3 | Contact: support@axion-biosystems.com 4 | All Rights Reserved 5 | %} 6 | classdef BlockVectorData < Entry 7 | %BlockVectorData contains instructions for loading the Data types 8 | % (See BlockVectorDataType.m) from the data portions of the file 9 | % listed in the header. 10 | 11 | methods 12 | function this = BlockVectorData(aEntryRecord, aFileID) 13 | %BlockVectorData: Constructs a new BlockVectorData corresponding 14 | % to an Entry Record and the file handle it came from 15 | this = this@Entry(aEntryRecord, int64(ftell(aFileID))); 16 | 17 | fseek(aFileID, double(this.EntryRecord.Length), 'cof'); 18 | 19 | if ~(ftell(aFileID) == (this.Start + this.EntryRecord.Length) || isinf(this.EntryRecord.Length)) 20 | error('Unexpected BlockVectorHeader length') 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /Functions/AxionFileLoader/AxionFileLoader/BlockVectorDataType.m: -------------------------------------------------------------------------------- 1 | %{ 2 | Copyright (c) 2024 Axion BioSystems, Inc. 3 | Contact: support@axion-biosystems.com 4 | All Rights Reserved 5 | %} 6 | classdef BlockVectorDataType < uint16 7 | %BLOCKVECTORDATATYPE Enumeration of known types of block vector data. 8 | % 9 | % Raw_v1: Continuous data from an Axion Muse or Maestro device. 10 | % 11 | % Spike_v1: Binary Spike Data recorded by a Spike detector in Axis. 12 | % 13 | % NamedContinuousData: Continous data where every track of data has 14 | % an associated channel and name 15 | % 16 | 17 | enumeration 18 | Raw_v1(0) 19 | Spike_v1(1) 20 | NamedContinuousData(2) 21 | end 22 | 23 | methods(Static) 24 | function [value , success] = TryParse(aInput) 25 | try 26 | value = BlockVectorDataType(aInput); 27 | success = true; 28 | catch e 29 | 30 | warning(... 31 | 'BlockVectorDataType:TryParse', ... 32 | ['Unsupported BlockVectorDataType', e]); 33 | 34 | value = aInput; 35 | success = false; 36 | end 37 | end 38 | end 39 | 40 | end 41 | 42 | -------------------------------------------------------------------------------- /Functions/AxionFileLoader/AxionFileLoader/ChannelID.m: -------------------------------------------------------------------------------- 1 | %{ 2 | Copyright (c) 2024 Axion BioSystems, Inc. 3 | Contact: support@axion-biosystems.com 4 | All Rights Reserved 5 | %} 6 | classdef ChannelID < handle 7 | %ChannelID Representation of ChannelID class in AxIS 8 | % 9 | % Artichoke: Numerical amplifier number (e.g., 0-11) 10 | % 11 | % Channel: Numerical channel number (e.g., 0-63) 12 | % 13 | 14 | properties(GetAccess = public, SetAccess = private) 15 | Artichoke 16 | Channel 17 | end 18 | 19 | methods 20 | function this = ChannelID(aID) 21 | this.Artichoke = bitand(hex2dec('ff'), bitshift(aID, -8)); 22 | this.Channel = bitand(hex2dec('ff'), bitshift(aID, 0)); 23 | end 24 | end 25 | 26 | end 27 | 28 | -------------------------------------------------------------------------------- /Functions/AxionFileLoader/AxionFileLoader/KeyValuePairTag.m: -------------------------------------------------------------------------------- 1 | %{ 2 | Copyright (c) 2024 Axion BioSystems, Inc. 3 | Contact: support@axion-biosystems.com 4 | All Rights Reserved 5 | %} 6 | classdef KeyValuePairTag < Tag 7 | properties(SetAccess = private) 8 | % Key of this Dictonary Entry 9 | Key; 10 | % Key of this Dictonary Entry 11 | Value; 12 | end 13 | 14 | methods 15 | function this = KeyValuePairTag(aFileID, aRawTag) 16 | this = this@Tag(aRawTag.TagGuid); 17 | 18 | fStart = aRawTag.Start + TagEntry.BaseSize; 19 | fSeekResult = fseek(aFileID, fStart, 'bof'); 20 | 21 | if(fSeekResult == 0) 22 | this.Key = freadstring(aFileID); 23 | this.Value = freadstring(aFileID); 24 | else 25 | error('Encountered an error while loading LeapInductionEvent %s', aRawTag.TagGuid); 26 | end 27 | 28 | fStart = aRawTag.Start + TagEntry.BaseSize; 29 | if ftell(aFileID) > (fStart + aRawTag.EntryRecord.Length) 30 | warning('File may be corrupt'); 31 | end 32 | 33 | end 34 | end 35 | 36 | end -------------------------------------------------------------------------------- /Functions/AxionFileLoader/AxionFileLoader/LedColor.m: -------------------------------------------------------------------------------- 1 | %{ 2 | Copyright (c) 2024 Axion BioSystems, Inc. 3 | Contact: support@axion-biosystems.com 4 | All Rights Reserved 5 | %} 6 | classdef LedColor < uint16 7 | %LEDCOLOR Color of a Stimulating LED 8 | enumeration 9 | % None: Indicates that a color hasn't been assigned yet. 10 | None(uint16(0)), 11 | 12 | % None: Indicates that this was a Blue Led 13 | Blue(uint16(1)), 14 | 15 | % None: Indicates that this was an Orange Led 16 | Orange(uint16(2)), 17 | 18 | % None: Indicates that this was a Green Led 19 | Green(uint16(3)), 20 | 21 | % None: Indicates that this was a Red Led 22 | Red(uint16(4)) 23 | end 24 | end 25 | 26 | -------------------------------------------------------------------------------- /Functions/AxionFileLoader/AxionFileLoader/StimulationEventData.m: -------------------------------------------------------------------------------- 1 | %{ 2 | Copyright (c) 2024 Axion BioSystems, Inc. 3 | Contact: support@axion-biosystems.com 4 | All Rights Reserved 5 | %} 6 | classdef StimulationEventData 7 | %STIMULATIONTAGBLOCK Structure that contains the data describing a 8 | %marked, stimulation portion of a file 9 | 10 | properties(SetAccess = private) 11 | %ID: Number that StimulationEvent tags attach to 12 | ID; 13 | %StimDuration: Length of time (in seconds) that ths stimulation 14 | %portion of this block lasted 15 | StimDuration; 16 | %ArtifactEliminationDuration: Length of time (in seconds) that this 17 | %Artifact Elimination portion of this block lasted 18 | ArtifactEliminationDuration; 19 | %ChannelArrayIdList Channel array IDs that were used in this block 20 | ChannelArrayIdList; 21 | %Textual description of this Tag block 22 | Description; 23 | end 24 | 25 | methods 26 | function this = StimulationEventData(... 27 | aId, aStimDuration, aArtElimDuration,... 28 | aChannelArrayIdList, aDescription) 29 | this.ID = aId; 30 | this.StimDuration = aStimDuration; 31 | this.ArtifactEliminationDuration = aArtElimDuration; 32 | this.ChannelArrayIdList = aChannelArrayIdList; 33 | this.Description = aDescription; 34 | end 35 | end 36 | 37 | end 38 | 39 | -------------------------------------------------------------------------------- /Functions/AxionFileLoader/AxionFileLoader/VoltageWaveform.m: -------------------------------------------------------------------------------- 1 | %{ 2 | Copyright (c) 2024 Axion BioSystems, Inc. 3 | Contact: support@axion-biosystems.com 4 | All Rights Reserved 5 | %} 6 | classdef VoltageWaveform < Waveform 7 | 8 | methods 9 | function this = VoltageWaveform(aChannel, aStart, aData, aSource, aSubsampleFactor) 10 | this@Waveform(aChannel, aStart, aData, aSource, aSubsampleFactor) 11 | end 12 | 13 | function [timeData, voltageData] = GetTimeVoltageVector(this) 14 | %GetTimeVoltageVector: Returns a vector for time and voltage 15 | % for this waveform in a single call 16 | timeData = this.GetTimeVector(); 17 | voltageData = this.GetVoltageVector(); 18 | end 19 | 20 | function voltageData = GetVoltageVector(this) 21 | % GetVoltageVector: returns a voltage vector for this waveform based 22 | % on the uncasted sample data (Stored as int16) and the source 23 | % header's specified voltage scale 24 | % 25 | % If this Method is called on an array of waveforms, the 26 | % lengths of the waveforms MUST agree 27 | fData = double([this(:).Data]); 28 | fSource = [this(:).Source]; 29 | fVoltageScale = [fSource(:).VoltageScale]; 30 | voltageData = fData * diag(fVoltageScale); 31 | end 32 | end 33 | 34 | end -------------------------------------------------------------------------------- /Functions/AxionFileLoader/AxionFileLoader/freadstring.m: -------------------------------------------------------------------------------- 1 | %{ 2 | Copyright (c) 2024 Axion BioSystems, Inc. 3 | Contact: support@axion-biosystems.com 4 | All Rights Reserved 5 | %} 6 | function FileString = freadstring( aFileID ) 7 | %FREADSTRING reads a unicode string starting at the current location 8 | %of the file handle held by aFileID. Note that this function assumes that the 9 | %next 4 bytes will be an int32 that gives the length of a utf-8 string in bytes, 10 | %immediately after it. 11 | 12 | fBytes = fread(aFileID, 1, 'int32=>int32'); 13 | fBytes = fread(aFileID, double(fBytes), 'uint8=>uint8'); 14 | fBytes = fBytes'; 15 | FileString = native2unicode(fBytes, 'UTF-8'); 16 | 17 | end 18 | 19 | -------------------------------------------------------------------------------- /Functions/AxionFileLoader/AxionFileLoader/parseGuid.m: -------------------------------------------------------------------------------- 1 | %{ 2 | Copyright (c) 2024 Axion BioSystems, Inc. 3 | Contact: support@axion-biosystems.com 4 | All Rights Reserved 5 | %} 6 | % parseGuid: 7 | % Parses a Microsoft encoded GUID from bytes 8 | % 9 | function guid = parseGuid (guidBytes) 10 | 11 | guid = strrep(sprintf(... 12 | '%2x%2x%2x%2x-%2x%2x-%2x%2x-%2x%2x-%2x%2x%2x%2x%2x%2x',... 13 | guidBytes(4),... 14 | guidBytes(3),... 15 | guidBytes(2),... 16 | guidBytes(1),... 17 | ... 18 | guidBytes(6),... 19 | guidBytes(5),... 20 | ... 21 | guidBytes(8),... 22 | guidBytes(7),... 23 | ... 24 | guidBytes(9),... 25 | guidBytes(10),... 26 | ... 27 | guidBytes(11),... 28 | guidBytes(12),... 29 | guidBytes(13),... 30 | guidBytes(14),... 31 | guidBytes(15),... 32 | guidBytes(16)),... 33 | ' ', '0'); %Format %2x leaves a space in the leading 0 for 0x01-0x0F 34 | 35 | end -------------------------------------------------------------------------------- /Functions/AxionFileLoader/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Axion BioSystems, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Functions/Colormaps/Colormaps/README.txt: -------------------------------------------------------------------------------- 1 | DISCLAIMER: 2 | 3 | The author of this Matlab File Exchange submission has not created any of the colormaps. 4 | 5 | Parula has been taken from Matlab >=2014b 6 | 7 | py_A-D has been taken from the discussion of the new colormaps for matlplotlib library in python. 8 | 9 | Read more about colormaps on python: https://bids.github.io/colormap/ -------------------------------------------------------------------------------- /Functions/Colormaps/Colormaps/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/Colormaps/Colormaps/Thumbs.db -------------------------------------------------------------------------------- /Functions/Colormaps/Colormaps/demo1_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/Colormaps/Colormaps/demo1_output.png -------------------------------------------------------------------------------- /Functions/Colormaps/Colormaps/demo2.m: -------------------------------------------------------------------------------- 1 | %% Colormaps that are pretty awesome: DEMO2 2 | % In this demo we will show how to supereasily use the new colormaps 3 | % 4 | % 5 | % this is an exampe of 4 colormaps that are being considered as the default 6 | % colormap in python's matplotlib lybrary. 7 | % 8 | % All of them look quite good and they dont have any official name, so at 9 | % the moment they are A,B,C,D. 10 | % 11 | % colormaps from https://github.com/bids/colormap 12 | % 13 | % Ander Biguri 14 | %% Clear workspace and get screen data 15 | clear; 16 | clc 17 | close all; 18 | 19 | 20 | %% Generate sample data 21 | X=peaks(200); 22 | 23 | %% Load Colomaps 24 | 25 | jet=colormap('jet'); 26 | parula=fake_parula(); 27 | magma=magma(); 28 | inferno=inferno(); 29 | plasma=plasma(); 30 | viridis=viridis(); 31 | 32 | 33 | 34 | %% Chose colormap 35 | % Use 1 only, else it will just use the last 36 | % CTRL+R -> comment line 37 | % CTRL+T -> Uncomment line 38 | 39 | % colormap(jet); 40 | % colormap(parula); 41 | % colormap(magma); 42 | % colormap(inferno); 43 | % colormap(plasma); 44 | colormap(viridis); 45 | 46 | %% Plot 47 | 48 | for ii=1:0.3:20 49 | surf(cos(2*pi*ii/20)*X,'linestyle','none'); 50 | axis off 51 | axis([0 200 0 200 -10 10]) 52 | set(gca, 'CLim', [-8, 8]); 53 | drawnow 54 | end 55 | -------------------------------------------------------------------------------- /Functions/Colormaps/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Ander Biguri 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the distribution 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /Functions/GroupingInfo.m: -------------------------------------------------------------------------------- 1 | function [GrpInfo, GrpNames] = GroupingInfo(spikeDetectedData) 2 | 3 | % this function allows user to input information about groups/categories for the data 4 | 5 | cd(spikeDetectedData) 6 | 7 | GrpInfo = []; 8 | 9 | %% how many types of groupings? 10 | 11 | GrpNum = inputdlg({'How many group/category types? For example, if categories are age and cell line, enter ''2'''}); 12 | 13 | GrpNum = str2double(GrpNum); 14 | 15 | %% what are the names of the groupings and categories 16 | 17 | for i = 1:GrpNum 18 | TempCell{i,1} = strcat('Grouping',num2str(i)); 19 | end 20 | 21 | prompt = TempCell; 22 | dlgtitle = 'What are the names of the group/category types? For example ''DIV'' and ''CellLine'''; 23 | dims = [1 35]; 24 | definput = {'DIV','CellLine'}; 25 | GrpNames = inputdlg(prompt,dlgtitle,dims,definput); 26 | 27 | 28 | for i = 1:length(GrpNames) 29 | eval(['GrpInfo.' char(GrpNames(i)) ' = [];']); 30 | end 31 | 32 | clear TempCell 33 | 34 | %% loop through each recording 35 | 36 | RecList = dir('*.mat'); 37 | 38 | for i = 1:length(RecList) 39 | for j = 1:length(GrpNames) 40 | TempCell{j,1} = strcat('Within the category ',char(GrpNames(j)),', name the group this recording belongs to (e.g. WT, KO or DIV150)'); 41 | end 42 | 43 | GrpInd = inputdlg(TempCell,RecList(i).name); 44 | 45 | for j = 1:length(GrpNames) 46 | eval(['GrpInfo.' char(GrpNames(j)) '{i} = GrpInd(j);']); 47 | end 48 | 49 | end 50 | 51 | clear TempCell 52 | 53 | end -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/@McsCmosLinkedDataSource/plot.m: -------------------------------------------------------------------------------- 1 | function plot(acq, cfg, varargin) 2 | % Placeholder plot function for a McsCmosLinkedDataSource object 3 | % 4 | % function plot(acq, cfg, varargin) 5 | % 6 | % This function is empty at the moment 7 | 8 | end -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/@McsCmosSpikeSorterSource/listHandler.m: -------------------------------------------------------------------------------- 1 | function listHandler(src, evt) 2 | % function mouseHandlerHeatMap(src, evt) 3 | % 4 | % Is triggered when the mouse is clicked in the HeatMap figure. Reads 5 | % the current mouse position, translates it to a selectedIDsor ID and visualizes 6 | % (if matches unit in sta data) its neighborhood and its activity 7 | 8 | %% PARAMETERS 9 | selection = get(src,'Value'); 10 | fig = get(src,'Parent'); 11 | data = guidata(fig); 12 | 13 | selectedIDs = data.SpikeSorterSource.UnitInfos.UnitID(selection); 14 | field = arrayfun(@(ID) ['ID' num2str(ID)], selectedIDs, 'UniformOutput', false); 15 | % 16 | %% PLOT SPIKESORTERUNIT DATA FOR EACH SELECTED UNIT 17 | for unit=1:1:length(selection) 18 | if isfield(data.visualizations,(field{unit})) %check if figure showing that selectedIDsor is already open 19 | if isgraphics(data.visualizations.(field{unit}),'figure')%plot neighborhood graph and save in structure 20 | figure(data.visualizations.(field{unit})); 21 | else 22 | figure(); 23 | data.visualizations.(field{unit}) = plot(data.SpikeSorterSource.UnitEntities{selectedIDs(unit)},[]); 24 | end 25 | else%create (field)s and graphs 26 | figure(); 27 | data.visualizations.(field{unit}) = plot(data.SpikeSorterSource.UnitEntities{selectedIDs(unit)},[]); 28 | end 29 | end 30 | % 31 | %% STORE DATA BACK INTO FIGURE 32 | guidata(fig, data); 33 | % 34 | end 35 | 36 | -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/@McsCmosSpikeStream/plot.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/+McsHDF5/@McsCmosSpikeStream/plot.m -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/@McsCmosStaExplorerSource/plotSingleSensor.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/+McsHDF5/@McsCmosStaExplorerSource/plotSingleSensor.m -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/@McsSegmentStream/plot.m: -------------------------------------------------------------------------------- 1 | function plot(segStream, cfg, varargin) 2 | % This is just a placeholder function please see 3 | % 4 | % help McsHDF5.McsAverageSegment.plot 5 | % 6 | % for plotting of the contents of a segment stream with averages and 7 | % 8 | % help McsHDF5.McsCutoutSegment.plot 9 | % 10 | % for plotting of the contents of a segment stream with spike cutouts. 11 | % 12 | % (c) 2016 by Multi Channel Systems MCS GmbH 13 | 14 | end -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/ExponentToUnit.m: -------------------------------------------------------------------------------- 1 | function [fact,unit_string] = ExponentToUnit(e,o) 2 | % Utility function for some nice plotting of data. 3 | % 4 | % function [fact,unit_string] = ExponentToUnit(e,o) 5 | % 6 | % Receives the exponent of the largest absolute value of the data (i.e. 7 | % log10(max(abs(data)))) and the exponent after the data is scaled by the 8 | % exponent of the unit in which it is expressed. Example: Maximum 9 | % amplitude: 200 mV = 2*10^-1 V. Data is given in units of 10^-9 V. Then e 10 | % = -1, o = -1 - (-9) = 8. The function outputs a scaling factor for the 11 | % data and a prefix string for the unit it is represented in after applying 12 | % the scaling factor. 13 | % 14 | % Output: 15 | % fact - scalar factor. data * fact transforms the data to nice 16 | % units. In the 200 mV example with units of 10^-9 V, 17 | % fact = 10^-6 18 | % 19 | % unit_string - depending on the output range, the unit prefix (n, µ, 20 | % m, ...) 21 | % 22 | % (c) 2016 by Multi Channel Systems MCS GmbH 23 | 24 | poss_strings = {'p','n','\mu','m','','k','M','G'}; 25 | poss_exp = [-12,-9,-6,-3,0,3,6,9]; 26 | i = find(poss_exp <= e,1,'last'); 27 | if isempty(i) 28 | i = 1; 29 | end 30 | fact = 10^(rem(o,3)-o); 31 | unit_string = poss_strings{i}; 32 | end -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/ID2coordinates.m: -------------------------------------------------------------------------------- 1 | function coordinates = ID2coordinates(ID, numRows, numCols) 2 | %Converts the sensor ID representation to its coordinate representation on 3 | %the CMOS chip 4 | ID = ID - 1; 5 | x = floor(ID/numRows)+1; 6 | y = mod(ID,numRows)+1; 7 | %x = floor(ID/numRows)+1; 8 | %y = mod(ID,(floor(ID/numRows)*numRows)); 9 | %coordinates = [ floor(ID/numRows)+1 ; mod(ID,numRows) ]; 10 | coordinates = [ x ; y ]; 11 | if (coordinates(1)>numRows || coordinates(2)>numCols || coordinates(1)<1 || coordinates(2)<1) 12 | error('Single sensor coordinates exceed total sensor size!') 13 | end 14 | end 15 | 16 | -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/SecToTick.m: -------------------------------------------------------------------------------- 1 | function tick = SecToTick(sec) 2 | % Converts seconds to tick in microseconds 3 | % 4 | % function tick = SecToTick(sec) 5 | % 6 | % Input: 7 | % sec - Time in seconds 8 | % 9 | % Output: 10 | % tick - seconds converted to microseconds. 11 | % 12 | % (c) 2016 by Multi Channel Systems MCS GmbH 13 | 14 | tick = sec * 1e6; 15 | end -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/TickToSec.m: -------------------------------------------------------------------------------- 1 | function sec = TickToSec(tick) 2 | % Converts tick in microseconds to seconds 3 | % 4 | % function sec = TickToSec(tick) 5 | % 6 | % Input: 7 | % tick - Time in microseconds 8 | % 9 | % Output: 10 | % sec - microseconds converted to seconds. 11 | % 12 | % (c) 2016 by Multi Channel Systems MCS GmbH 13 | 14 | sec = double(tick) * 1e-6; 15 | end -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/checkParameter.m: -------------------------------------------------------------------------------- 1 | function [cfg, isDefault] = checkParameter(cfg, fieldname, default) 2 | % Helper function to set default parameters if necessary 3 | % 4 | % function [cfg, isDefault] = checkParameter(cfg, fieldname, default) 5 | % 6 | % Checks if a field with name fieldname exists in structure cfg. If not, or 7 | % if it is empty, sets it to default, otherwise leaves it unchanged. 8 | % isDefault is true if the default settings have been set in cfg, otherwise 9 | % false if the field is unchanged. 10 | % 11 | % (c) 2016 by Multi Channel Systems MCS GmbH 12 | 13 | isDefault = false; 14 | 15 | if isempty(cfg) 16 | cfg.(fieldname) = []; 17 | isDefault = true; 18 | end 19 | 20 | if ~isfield(cfg, fieldname) || isempty(cfg.(fieldname)) 21 | cfg.(fieldname) = default; 22 | isDefault = true; 23 | end -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/coordinates2ID.m: -------------------------------------------------------------------------------- 1 | function ID = coordinates2ID(coordinates, numRows, numCols) 2 | ID = numRows*(coordinates(1)-1) + coordinates(2); 3 | if ID > (numRows * numCols) 4 | error('ID out of range!') 5 | end 6 | end -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/help/html/helpDataManager_eq06716003005155465776.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/+McsHDF5/help/html/helpDataManager_eq06716003005155465776.png -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/help/html/helpDataManager_eq09220389044114281081.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/+McsHDF5/help/html/helpDataManager_eq09220389044114281081.png -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/help/html/staComplete.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/+McsHDF5/help/html/staComplete.PNG -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/help/staComplete.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/+McsHDF5/help/staComplete.PNG -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/+McsHDF5/version.m: -------------------------------------------------------------------------------- 1 | function version() 2 | 3 | fprintf(['This is version 1.2.0 of the McsHDF5 Matlab toolbox. (26/02/2018)\n'... 4 | 'Newer versions will be available at \n\n'... 5 | '\thttp://www.multichannelsystems.com/software/multi-channel-datamanager \n']); 6 | 7 | end -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/html/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | PreviewsShown=true 3 | Timestamp=2014,3,26,13,9,41 4 | Version=3 5 | ViewMode=1 6 | -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/html/helpDataManager_eq06716003005155465776.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/html/helpDataManager_eq06716003005155465776.png -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/html/helpDataManager_eq09220389044114281081.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/html/helpDataManager_eq09220389044114281081.png -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/html/helpsearch-v3/_0.cfe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/html/helpsearch-v3/_0.cfe -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/html/helpsearch-v3/_0.cfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/html/helpsearch-v3/_0.cfs -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/html/helpsearch-v3/_0.si: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/html/helpsearch-v3/_0.si -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/html/helpsearch-v3/segments.gen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/html/helpsearch-v3/segments.gen -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/html/helpsearch-v3/segments_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/html/helpsearch-v3/segments_2 -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/html/helptoc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The McsHDF5 Toolbox 5 | Installation 6 | DataManager 7 | CMOS-MEA 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/html/staComplete.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/McsMatlabDataTools/html/staComplete.PNG -------------------------------------------------------------------------------- /Functions/McsMatlabDataTools/info.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 2013a 6 | McsHDF5 7 | toolbox 8 | 9 | html 10 | $toolbox/matlab/icons/bookicon.gif 11 | 12 | -------------------------------------------------------------------------------- /Functions/Modularity/consensus_coclassify.m: -------------------------------------------------------------------------------- 1 | function [D] = consensus_coclassify(input_cell) 2 | % H Smith, Cambridge, 2020 3 | % Calculate consensus matrix for a series of community partitions 4 | % For an nodes i and j, calculates the proportion of times that i and j are 5 | % in the same modularity group in repeated grouping 6 | 7 | % INPUTS: 8 | % input_cell = cell containing n vectors size node_number x 1 of community 9 | % partitions (modularity groups) 10 | 11 | % OUTPUTS: 12 | % D = consensus matrix where element Dij represents proportion of 13 | % input_cell where input_cell(i) == input_cell(j) 14 | 15 | repNum = length(input_cell); % Number of repeats of community partition 16 | node_num = length(input_cell{1}); % Number of nodes in community 17 | D = zeros(node_num,node_num); 18 | 19 | for i = 1:node_num 20 | for j = 1:node_num 21 | counter = 0; 22 | for k = 1:repNum 23 | if input_cell{k}(i) == input_cell{k}(j) 24 | counter = counter + 1; 25 | end 26 | end 27 | prop = counter / repNum; 28 | D(i,j) = prop; 29 | end 30 | end 31 | 32 | end -------------------------------------------------------------------------------- /Functions/Modularity/consensuscheck.m: -------------------------------------------------------------------------------- 1 | function blockdiag = consensuscheck(D) 2 | % H Smith, Cambridge, 2020 3 | % Check if matrix is binary and block diagonal 4 | % 5 | % INPUTS: 6 | % D: adjacency matrix 7 | % 8 | % OUTPUTS: 9 | % blockdiag: 10 | % = 0: matrix is not block diagonal 11 | % = 1: matrix is block diagonal 12 | 13 | v1 = sum(D,1); 14 | v1 = v1'; 15 | v2 = sum(D,2); 16 | check = sum(v1 - v2,'all'); 17 | 18 | if check == 0 && (numel(D(D == 0)) + numel(D(D == 1))) == numel(D) 19 | blockdiag = 1; 20 | else 21 | blockdiag = 0; 22 | end 23 | 24 | end -------------------------------------------------------------------------------- /Functions/STTCandThresholding/cshift.c: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | #include 3 | 4 | /*Function to reverse arr[] from index start to end*/ 5 | void reverseArray(double arr[], int start, int end) 6 | { 7 | int temp; 8 | while (start < end) { 9 | temp = arr[start]; 10 | arr[start] = arr[end]; 11 | arr[end] = temp; 12 | start++; 13 | end--; 14 | } 15 | } 16 | 17 | void leftRotate(double arr[], int d, int n) 18 | { 19 | 20 | if (d == 0) 21 | return; 22 | // in case the rotating factor is 23 | // greater than array length 24 | d = d % n; 25 | 26 | reverseArray(arr, 0, d - 1); 27 | reverseArray(arr, d, n - 1); 28 | reverseArray(arr, 0, n - 1); 29 | } 30 | 31 | 32 | 33 | void mexFunction(int nlhs, mxArray *plhs[], 34 | int nrhs, const mxArray *prhs[]) 35 | { 36 | int n; /* input scalar */ 37 | int d; /* input scalar */ 38 | double *arr; /* 1xN input matrix */ 39 | 40 | /* get the value of the scalar input */ 41 | n = mxGetScalar(prhs[1]); 42 | d = mxGetScalar(prhs[2]); 43 | 44 | /* create a pointer to the real data in the input matrix */ 45 | #if MX_HAS_INTERLEAVED_COMPLEX 46 | arr = mxGetDoubles(prhs[0]); 47 | #else 48 | arr = mxGetPr(prhs[0]); 49 | #endif 50 | leftRotate(arr, d, n); 51 | } 52 | -------------------------------------------------------------------------------- /Functions/STTCandThresholding/cshift.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/STTCandThresholding/cshift.mexmaci64 -------------------------------------------------------------------------------- /Functions/STTCandThresholding/sttc.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/STTCandThresholding/sttc.mexa64 -------------------------------------------------------------------------------- /Functions/STTCandThresholding/sttc.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/STTCandThresholding/sttc.mexmaci64 -------------------------------------------------------------------------------- /Functions/STTCandThresholding/sttc.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/STTCandThresholding/sttc.mexw64 -------------------------------------------------------------------------------- /Functions/STTCandThresholding/sttc_jeremi.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/STTCandThresholding/sttc_jeremi.mexw64 -------------------------------------------------------------------------------- /Functions/STTCandThresholding/testSTTC.m: -------------------------------------------------------------------------------- 1 | % Generate some numbers to test if STTC is running 2 | 3 | spike_times_1 = [1, 5, 3]; 4 | spike_times_2 = [1, 7, 8, 10]; 5 | N1v = length(spike_times_1); 6 | N2v = length(spike_times_2); 7 | dtv = 0.1; 8 | Time = [1, 10]; 9 | tileCoef = sttc(N1v, N2v, dtv, Time, spike_times_1, spike_times_2); -------------------------------------------------------------------------------- /Functions/STTCandThresholding/test_sttc_c_code.m: -------------------------------------------------------------------------------- 1 | function c_code_works = test_sttc_c_code() 2 | %UNTITLED Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | Time = [1, 10]; 6 | spike_times_1 = [1, 4, 5, 8]; 7 | spike_times_2 = [2, 4.5, 6, 10]; 8 | dtv = 0.5; % in seconds, the delay time to look for conincidental spikes 9 | N1v = length(spike_times_1); 10 | N2v = length(spike_times_2); 11 | 12 | try 13 | tileCoef = sttc(N1v, N2v, dtv, Time, spike_times_1, spike_times_2); 14 | c_code_works = 1; 15 | catch 16 | c_code_works = 0; 17 | end 18 | 19 | end 20 | 21 | -------------------------------------------------------------------------------- /Functions/SWTTEO/extendswt.m: -------------------------------------------------------------------------------- 1 | function y = extendswt(x, lf) 2 | %EXTENDSWT extends the signal periodically at the boundaries 3 | % Parameters 4 | % ----------- 5 | % x : 6 | % lf : 7 | % 8 | % Output 9 | % ------ 10 | % y : 11 | [r,c] = size(x); 12 | y = zeros(r+lf,c); 13 | y(1:lf/2,:) = x(end-lf/2+1:end,:); 14 | y(lf/2+1:lf/2+r,:) = x; 15 | y(end-lf/2+1:end,:) = x(1:lf/2,:); 16 | 17 | end -------------------------------------------------------------------------------- /Functions/SWTTEO/myTEOcircshift.m: -------------------------------------------------------------------------------- 1 | function X = myTEOcircshift(Y,k) 2 | % circshift without the boundary behaviour 3 | % Parameters 4 | % ---------- 5 | % Y : 6 | % k : 7 | % 8 | % Output 9 | % ------ 10 | % X : 11 | 12 | colshift = k(1); 13 | rowshift = k(2); 14 | 15 | temp = circshift(Y,k); 16 | 17 | if colshift < 0 18 | temp(end+colshift+1:end,:) = flipud(Y(end+colshift+1:end,:)); 19 | elseif colshift > 0 20 | temp(1:1+colshift-1,:) = flipud(Y(1:1+colshift-1,:)); 21 | else 22 | 23 | end 24 | 25 | if rowshift<0 26 | temp(:,end+rowshift+1:end) = fliplr(Y(:,end+rowshift+1:end)); 27 | elseif rowshift>0 28 | temp(:,1:1+rowshift-1) = fliplr(Y(:,1:1+rowshift-1)); 29 | else 30 | end 31 | 32 | X = temp; 33 | 34 | end 35 | -------------------------------------------------------------------------------- /Functions/SpikeTimesToMatrix.m: -------------------------------------------------------------------------------- 1 | function [spikeMatrix] = SpikeTimesToMatrix(spikeTimes,fs,method,Info) 2 | % Convert spike times to spike matrix 3 | % TODO: can replace spikeDetectionResult with just fs, since 4 | % spikeDetectionResult may not always be available 5 | % ------------------------------------------------------------------- 6 | % Change log 7 | % 2025-01-21 : Returns empty double matrix if no cells in spikeTimes 8 | 9 | 10 | % Get spike times 11 | for i = 1:length(spikeTimes) 12 | if ~isempty(spikeTimes{1,i}) 13 | eval(['spikeTimesStruct.channel' num2str(i) '= spikeTimes{1,i}.(method);']); 14 | end 15 | end 16 | 17 | % Convert spike times to matrix 18 | start_time = 0; 19 | end_time = Info.duration_s; 20 | 21 | if exist('spikeTimesStruct', 'var') 22 | spikeMatrix = spikeTimeToMatrix(spikeTimesStruct, ... 23 | start_time, end_time, fs); 24 | else 25 | bin_edges = start_time:1/fs:end_time; 26 | num_bins = length(bin_edges) - 1; 27 | spikeMatrix = zeros(num_bins, 0); 28 | end 29 | 30 | 31 | end -------------------------------------------------------------------------------- /Functions/WATERS-master/getSpikeAmp.m: -------------------------------------------------------------------------------- 1 | function spikeAmps = getSpikeAmp(spikeWaveforms) 2 | %GETSPIKEAMP Get spike amplitude from spikeData 3 | % Detailed explanation goes here 4 | 5 | numChannels = length(spikeWaveforms); 6 | spikeAmps = cell(1, numChannels); 7 | 8 | for channelIdx = 1:length(spikeWaveforms) 9 | spikeAmps{channelIdx} = struct(); 10 | spikeDmethods = fieldnames(spikeWaveforms{channelIdx}); 11 | for spikeDmethodIdx = 1:length(spikeDmethods) 12 | spikeMethodName = spikeDmethods{spikeDmethodIdx}; 13 | spikeAmps{channelIdx}.(spikeMethodName) = min(spikeWaveforms{channelIdx}.(spikeMethodName), [], 2); 14 | end 15 | end 16 | 17 | 18 | end 19 | 20 | -------------------------------------------------------------------------------- /Functions/aesthetics.m: -------------------------------------------------------------------------------- 1 | function aesthetics() 2 | set(gca, 'box', 'off') % remove borders 3 | set(gcf,'color','w'); % white background 4 | set(gca, 'TickDir', 'out') 5 | ax = gca; 6 | try 7 | ax.Colorbar.TickDirection = 'out'; 8 | ax.Colorbar.FontName = 'Arial'; 9 | ax.Colorbar.FontSize = 12; 10 | catch 11 | end 12 | % set(gca, 'Box', 'off', 'TickDir', 'out', 'TickLength', [.02 .02], ... 13 | % 'XMinorTick', 'on', 'YMinorTick', 'on', 'YGrid', 'on', ... 14 | % 'XColor', [.3 .3 .3], 'YColor', [.3 .3 .3], 'YTick', 0:500:2500, ... 15 | % 'LineWidth', 1) 16 | 17 | % set(gca, 'Box', 'off', 'TickDir', 'out', ... 18 | % 'XMinorTick', 'on', 'YMinorTick', 'on', 'YGrid', 'on') 19 | set(gca, 'YGrid','off','XGrid','off') 20 | end -------------------------------------------------------------------------------- /Functions/checkIfAnySpikes.m: -------------------------------------------------------------------------------- 1 | function checkIfAnySpikes(spikeTimes, ExpName) 2 | 3 | spikeDetectionMethodUsed = fieldnames(spikeTimes{1}); 4 | all_method_spikes_detected = 0; 5 | for nmethod = 1:length(spikeDetectionMethodUsed) 6 | methodName = spikeDetectionMethodUsed{nmethod}; 7 | method_detected_spikes = 0; 8 | for channel = 1:length(spikeTimes) 9 | if ~isempty(spikeTimes{channel}) 10 | method_detected_spikes = method_detected_spikes + length(spikeTimes{channel}.(methodName)); 11 | end 12 | end 13 | if method_detected_spikes == 0 14 | fprintf(sprintf('No spikes detected in any channels in %s using %s \n', ExpName, methodName)) 15 | end 16 | all_method_spikes_detected = all_method_spikes_detected + method_detected_spikes; 17 | end 18 | 19 | if all_method_spikes_detected == 0 20 | fprintf(sprintf(['WARNING: In %s, no spikes were detected in any channels using any of the specified detection methods, \n ' ... 21 | 'consider removing this dataset from the analysis list or re-running spike detection,\n' ... 22 | 'otherwise downstream analysis may fail. \n'], ExpName)) 23 | end 24 | 25 | 26 | end -------------------------------------------------------------------------------- /Functions/checkOneFigureHandle.m: -------------------------------------------------------------------------------- 1 | function oneFigureHandle = checkOneFigureHandle(Params, oneFigureHandle) 2 | if Params.showOneFig 3 | if ~isgraphics(oneFigureHandle) 4 | oneFigureHandle = figure; 5 | end 6 | else 7 | oneFigureHandle = 0; 8 | end 9 | end -------------------------------------------------------------------------------- /Functions/controlTheory/ave_control.m: -------------------------------------------------------------------------------- 1 | function [values] = ave_control(A) 2 | % FUNCTION: 3 | % Returns values of AVERAGE CONTROLLABILITY for each node in a 4 | % network, given the adjacency matrix for that network. Average 5 | % controllability measures the ease by which input at that node can 6 | % steer the system into many easily-reachable states. 7 | % 8 | % INPUT: 9 | % A is the structural (NOT FUNCTIONAL) network adjacency matrix, 10 | % such that the simple linear model of dynamics outlined in the 11 | % reference is an accurate estimate of brain state fluctuations. 12 | % Assumes all values in the matrix are positive, and that the 13 | % matrix is symmetric. 14 | % 15 | % OUTPUT: 16 | % Vector of average controllability values for each node 17 | % 18 | % Bassett Lab, University of Pennsylvania, 2016. 19 | % Reference: Gu, Pasqualetti, Cieslak, Telesford, Yu, Kahn, Medaglia, 20 | % Vettel, Miller, Grafton & Bassett, Nature Communications 21 | % 6:8414, 2015. 22 | 23 | A = A./(1+svds(A,1)); % Matrix normalization 24 | [U, T] = schur(A,'real'); % Schur stability 25 | midMat = (U.^2)'; 26 | v = diag(T); 27 | P = repmat(diag(1 - v*v'),1,size(A,1)); 28 | values = sum(midMat./P)'; -------------------------------------------------------------------------------- /Functions/controlTheory/modal_control.m: -------------------------------------------------------------------------------- 1 | function [values] = modal_control(A) 2 | % FUNCTION: 3 | % Returns values of MODAL CONTROLLABILITY for each node in a 4 | % network, given the adjacency matrix for that network. Modal 5 | % controllability indicates the ability of that node to steer the 6 | % system into difficult-to-reach states, given input at that node. 7 | % 8 | % INPUT: 9 | % A is the structural (NOT FUNCTIONAL) network adjacency matrix, 10 | % such that the simple linear model of dynamics outlined in the 11 | % reference is an accurate estimate of brain state fluctuations. 12 | % Assumes all values in the matrix are positive, and that the 13 | % matrix is symmetric. 14 | % 15 | % OUTPUT: 16 | % Vector of modal controllability values for each node 17 | % 18 | % Bassett Lab, University of Pennsylvania, 2016. 19 | % Reference: Gu, Pasqualetti, Cieslak, Telesford, Yu, Kahn, Medaglia, 20 | % Vettel, Miller, Grafton & Bassett, Nature Communications 21 | % 6:8414, 2015. 22 | 23 | A = A./(1+svds(A,1)); % Matrix normalization 24 | [U, T] = schur(A,'real'); % Schur stability 25 | eigVals = diag(T); 26 | N = size(A,1); 27 | phi = zeros(N,1); 28 | for i = 1 : N 29 | phi(i) = (U(i,:).^2) * (1 - eigVals.^2); 30 | end 31 | values = phi; -------------------------------------------------------------------------------- /Functions/downSampleSum.m: -------------------------------------------------------------------------------- 1 | function outTrain = downSampleSum(spikeTrain, newSampleNum) 2 | %downSampleSum performs downsampling via summation (basically binning) of 3 | %2D matrices. 4 | 5 | % Author: Tim Sit 6 | % Last Update: 20180518 7 | 8 | % INPUT 9 | % spikeTrain | numSamp x numChannel matrix 10 | % newSampleNum | new sampling rate to use, ie. the number of bins that 11 | % you want in the end result 12 | 13 | 14 | % OUTPUT 15 | % outTrain | newSampleNum x numChannel matrix 16 | 17 | numElectrode = size(spikeTrain, 2); 18 | downTrain = reshape(spikeTrain, [], newSampleNum, numElectrode); 19 | % downTrain = sum(downTrain); % this need resolving 20 | downTrain = sum(downTrain, 1); % maybe this 21 | outTrain = reshape(downTrain, newSampleNum, numElectrode); 22 | end -------------------------------------------------------------------------------- /Functions/fcn_find_rich_clubs_bu.m: -------------------------------------------------------------------------------- 1 | % script to find whether a rich club exists in the network 2 | % -------------------------------------------------------------------------------- /Functions/findMinMaxAllNetMetStruct.m: -------------------------------------------------------------------------------- 1 | function [NetMetMinMax] = findMinMaxAllNetMetStruct(NetMetAllDat) 2 | 3 | % find min and max for NetMet values and edges (adjM 4 | % values) across the batch dataset 5 | 6 | NetMetPlots = {'ND','MEW','NS','Eloc','BC','PC','Z'}; 7 | 8 | for i = 1:length(NetMetPlots) 9 | NetMetMinMax.(sprintf(NetMetPlots{i})) = [min(NetMetAllDat.(sprintf(NetMetPlots{i}))) max(NetMetAllDat.(sprintf(NetMetPlots{i})))]; 10 | NetMetMinMax.adjM = [min(NetMetAllDat.adjM) max(NetMetAllDat.adjM)]; 11 | end -------------------------------------------------------------------------------- /Functions/findMinMaxNetMetTable.m: -------------------------------------------------------------------------------- 1 | function minMax = findMinMaxNetMetTable(outputDataDateFolder, Params) 2 | % Find the min and max values of each extracted feature in all recordings 3 | % combined 4 | 5 | spreadsheetFname = strcat('NetworkActivity_RecordingLevel', '.csv'); 6 | spreadsheetFpath = fullfile(outputDataDateFolder, spreadsheetFname); 7 | recordingLevelTable = readtable(spreadsheetFpath, 'Delimiter','comma'); 8 | 9 | electrodeSpreadsheetFname = strcat('NetworkActivity_NodeLevel','.csv'); 10 | electrodeSpreadsheetFpath = fullfile(outputDataDateFolder, electrodeSpreadsheetFname); 11 | nodeLevelTable = readtable(electrodeSpreadsheetFpath, 'Delimiter','comma'); 12 | 13 | % Find min max of each column and return structure 14 | 15 | for netMetIdx = 1:length(Params.networkLevelNetMetToPlot) 16 | 17 | netMetStr = Params.networkLevelNetMetToPlot{netMetIdx}; 18 | if contains(netMetStr, recordingLevelTable.Properties.VariableNames) 19 | minMax.(netMetStr) = [min(recordingLevelTable.(netMetStr)), ... 20 | max(recordingLevelTable.(netMetStr))]; 21 | end 22 | 23 | end 24 | 25 | for electrodeMetIdx = 1:length(Params.unitLevelNetMetToPlot) 26 | 27 | eMetStr = Params.unitLevelNetMetToPlot{electrodeMetIdx}; 28 | minMax.(eMetStr) = [min(nodeLevelTable.(eMetStr)), ... 29 | max(nodeLevelTable.(eMetStr))]; 30 | 31 | 32 | end 33 | 34 | 35 | end -------------------------------------------------------------------------------- /Functions/findSpikeTimes.m: -------------------------------------------------------------------------------- 1 | function spikeTimes = findSpikeTimes(spikeTrain, method, samplingRate) 2 | %findSpikeTimes calculate spike times given binary matrix 3 | % assumes input matrix in the form numSampl x numChannel 4 | % returns spikeTimes as an array of vectors 5 | 6 | % if method is 'seconds', then spike times are returned in seconds 7 | % otherwise, it will be returned in terms of sample number 8 | 9 | % according to this, a for loop works about as well as a vectorised 10 | % solution 11 | %https://www.mathworks.com/matlabcentral/answers/229711-using-find-on-each-column-of-a-matrix-independently 12 | 13 | spikeTimes = cell(1, size(spikeTrain, 2)); % pre-allocate 14 | for n = 1:size(spikeTrain, 2) 15 | spikeTimes{n} = find(spikeTrain(:, n) == 1); 16 | end 17 | 18 | if strcmp(method, 'seconds') 19 | % not sure how to do operations on cell array 20 | % but feel like there should be more effiecient way of doing this 21 | for n = 1:size(spikeTrain, 2) 22 | spikeTimes{n} = spikeTimes{n} ./ samplingRate; 23 | end 24 | end 25 | 26 | 27 | end 28 | 29 | -------------------------------------------------------------------------------- /Functions/npy-matlab-master/.gitignore: -------------------------------------------------------------------------------- 1 | *.asv 2 | .ipynb_checkpoints/ 3 | __pycache__ 4 | -------------------------------------------------------------------------------- /Functions/npy-matlab-master/.travis.yml: -------------------------------------------------------------------------------- 1 | # Using several other .travis.yml files as inspiration. See for example: 2 | # https://github.com/MOxUnit/MOxUnit 3 | # https://github.com/scottclowe/matlab-continuous-integration/ 4 | # https://github.com/fieldtrip/fieldtrip/blob/master/.travis.yml 5 | 6 | language: python 7 | 8 | cache: 9 | - apt 10 | 11 | before_install: 12 | # to prevent IPv6 being used for APT 13 | - sudo bash -c "echo 'Acquire::ForceIPv4 \"true\";' > /etc/apt/apt.conf.d/99force-ipv4" 14 | - travis_retry sudo apt-get -y -qq update 15 | - travis_retry sudo apt-get install -y -qq software-properties-common python-software-properties 16 | - travis_retry sudo apt-add-repository -y ppa:octave/stable 17 | - travis_retry sudo apt-get -y -qq update 18 | # get Octave 4.0 19 | - travis_retry sudo apt-get -y -qq install octave liboctave-dev 20 | 21 | # Get conda 22 | - wget -q http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh 23 | - chmod +x miniconda.sh 24 | - ./miniconda.sh -b -p /home/travis/miniconda 25 | - export PATH=/home/travis/miniconda/bin:$PATH 26 | - conda update --yes --quiet conda 27 | 28 | install: 29 | - conda create -n testenv --yes python=3.6 30 | - source activate testenv 31 | - conda install --yes --quiet numpy 32 | - conda install --yes -c conda-forge scikit-image 33 | - pip install pytest==3.3.2 pytest-sugar 34 | 35 | script: 36 | - echo "Octave version:" 37 | - octave --no-gui --eval "version()" 38 | - pytest 39 | -------------------------------------------------------------------------------- /Functions/npy-matlab-master/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2015, npy-matlab developers 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /Functions/npy-matlab-master/examples/exampleMemmap.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | % Example implementation of memory mapping an NPY file using readNPYheader 4 | 5 | filename = 'data/chelsea_float64.npy'; 6 | 7 | [arrayShape, dataType, fortranOrder, littleEndian, totalHeaderLength, npyVersion] = readNPYheader(filename); 8 | 9 | figure; 10 | 11 | if fortranOrder 12 | f = memmapfile(filename, 'Format', {dataType, arrayShape, 'd'}, 'Offset', totalHeaderLength); 13 | image(f.Data.d) 14 | 15 | else 16 | % Note! In this case, the dimensions of the array will be transposed, 17 | % e.g. an AxBxCxD array becomes DxCxBxA. 18 | f = memmapfile(filename, 'Format', {dataType, arrayShape(end:-1:1), 'd'}, 'Offset', totalHeaderLength); 19 | 20 | tmp = f.Data.d; 21 | img = permute(tmp, length(arrayShape):-1:1); % note here you have to reverse the dimensions. 22 | image(img./255) 23 | end -------------------------------------------------------------------------------- /Functions/npy-matlab-master/npy-matlab/readNPY.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | function data = readNPY(filename) 4 | % Function to read NPY files into matlab. 5 | % *** Only reads a subset of all possible NPY files, specifically N-D arrays of certain data types. 6 | % See https://github.com/kwikteam/npy-matlab/blob/master/tests/npy.ipynb for 7 | % more. 8 | % 9 | 10 | [shape, dataType, fortranOrder, littleEndian, totalHeaderLength, ~] = readNPYheader(filename); 11 | 12 | if littleEndian 13 | fid = fopen(filename, 'r', 'l'); 14 | else 15 | fid = fopen(filename, 'r', 'b'); 16 | end 17 | 18 | try 19 | 20 | [~] = fread(fid, totalHeaderLength, 'uint8'); 21 | 22 | % read the data 23 | data = fread(fid, prod(shape), [dataType '=>' dataType]); 24 | 25 | if length(shape)>1 && ~fortranOrder 26 | data = reshape(data, shape(end:-1:1)); 27 | data = permute(data, [length(shape):-1:1]); 28 | elseif length(shape)>1 29 | data = reshape(data, shape); 30 | end 31 | 32 | fclose(fid); 33 | 34 | catch me 35 | fclose(fid); 36 | rethrow(me); 37 | end 38 | -------------------------------------------------------------------------------- /Functions/npy-matlab-master/npy-matlab/writeNPY.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | function writeNPY(var, filename) 4 | % function writeNPY(var, filename) 5 | % 6 | % Only writes little endian, fortran (column-major) ordering; only writes 7 | % with NPY version number 1.0. 8 | % 9 | % Always outputs a shape according to matlab's convention, e.g. (10, 1) 10 | % rather than (10,). 11 | 12 | 13 | shape = size(var); 14 | dataType = class(var); 15 | 16 | header = constructNPYheader(dataType, shape); 17 | 18 | fid = fopen(filename, 'w'); 19 | fwrite(fid, header, 'uint8'); 20 | fwrite(fid, var, dataType); 21 | fclose(fid); 22 | 23 | 24 | end 25 | 26 | -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/chelsea_float32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/chelsea_float32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/chelsea_float64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/chelsea_float64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/chelsea_int16.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/chelsea_int16.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/chelsea_int32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/chelsea_int32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/chelsea_int64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/chelsea_int64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/chelsea_int8.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/chelsea_int8.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/chelsea_uint16.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/chelsea_uint16.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/chelsea_uint32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/chelsea_uint32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/chelsea_uint64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/chelsea_uint64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/chelsea_uint8.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/chelsea_uint8.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_chelsea_float32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_chelsea_float32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_chelsea_float64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_chelsea_float64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_chelsea_int16.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_chelsea_int16.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_chelsea_int32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_chelsea_int32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_chelsea_int64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_chelsea_int64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_chelsea_int8.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_chelsea_int8.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_chelsea_uint16.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_chelsea_uint16.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_chelsea_uint32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_chelsea_uint32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_chelsea_uint64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_chelsea_uint64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_chelsea_uint8.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_chelsea_uint8.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_sine_float32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_sine_float32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_sine_float64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_sine_float64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_sine_int16.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_sine_int16.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_sine_int32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_sine_int32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_sine_int64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_sine_int64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_sine_int8.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_sine_int8.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_sine_uint16.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_sine_uint16.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_sine_uint32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_sine_uint32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_sine_uint64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_sine_uint64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/matlab_sine_uint8.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/matlab_sine_uint8.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/sine_float32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/sine_float32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/sine_float64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/sine_float64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/sine_int16.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/sine_int16.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/sine_int32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/sine_int32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/sine_int64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/sine_int64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/sine_int8.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/sine_int8.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/sine_uint16.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/sine_uint16.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/sine_uint32.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/sine_uint32.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/sine_uint64.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/sine_uint64.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/sine_uint8.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/sine_uint8.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/data/test.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/npy-matlab-master/tests/data/test.npy -------------------------------------------------------------------------------- /Functions/npy-matlab-master/tests/test_readNPY.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | %% Test the readNPY function with given data 4 | dtypes = {'uint8','uint16','uint32','uint64','int8','int16','int32','int64','float32','float64'}; 5 | figure; 6 | for d = 1:length(dtypes) 7 | 8 | data = readNPY(['data/sine_' dtypes{d} '.npy']); 9 | 10 | subplot(length(dtypes),1,d) 11 | plot(data) 12 | title(dtypes{d}); 13 | 14 | end 15 | 16 | 17 | figure; 18 | for d = 1:length(dtypes) 19 | 20 | data = readNPY(['data/chelsea_' dtypes{d} '.npy']); 21 | data(1:3,1:3,:) 22 | subplot(length(dtypes),1,d) 23 | imagesc(double(data)./255) 24 | title(dtypes{d}); 25 | 26 | end 27 | 28 | 29 | %% test readNPY and writeNPY 30 | dtypes = {'uint8','uint16','uint32','uint64','int8','int16','int32','int64','float32','float64'}; 31 | 32 | figure; 33 | for d = 1:length(dtypes) 34 | 35 | data = readNPY(['data/sine_' dtypes{d} '.npy']); 36 | writeNPY(data, ['data/matlab_sine_' dtypes{d} '.npy']); 37 | data = readNPY(['data/matlab_sine_' dtypes{d} '.npy']); 38 | 39 | subplot(length(dtypes),1,d) 40 | plot(data) 41 | title(dtypes{d}); 42 | 43 | end 44 | 45 | 46 | figure; 47 | for d = 1:length(dtypes) 48 | 49 | data = readNPY(['data/chelsea_' dtypes{d} '.npy']); 50 | writeNPY(data, ['data/matlab_chelsea_' dtypes{d} '.npy']); 51 | data = readNPY(['data/matlab_chelsea_' dtypes{d} '.npy']); 52 | 53 | data(1:3,1:3,:) 54 | subplot(length(dtypes),1,d) 55 | imagesc(double(data)./255) 56 | title(dtypes{d}); 57 | 58 | end -------------------------------------------------------------------------------- /Functions/plotElectrodeTraceGUI.m: -------------------------------------------------------------------------------- 1 | %% Parameters 2 | 3 | rawDataFolder = '/media/timothysit/Elements/MAT_files/MPT_MEC/'; 4 | fileName = 'MPT200108_2B_DIV14.mat'; 5 | channelNameToPlot = 14; 6 | plotTimeRange = [0, 60]; % in seconds 7 | filterTrace = 1; % 0 : plot raw trace, 1 : plot filtered trace 8 | filterLowPass = 600; 9 | filterHighPass = 8000; 10 | traceColor = 'black'; 11 | 12 | data = load(fullfile(rawDataFolder, fileName)); 13 | 14 | channelIdxToPlot = find(data.channels == channelNameToPlot); 15 | plotTimeSamplesRange = plotTimeRange * data.fs + 1; % 1 indexing 16 | numSamplesToPlot = plotTimeSamplesRange(2) - plotTimeSamplesRange(1); 17 | secTimeBins = linspace(plotTimeRange(1), plotTimeRange(2), numSamplesToPlot + 1); 18 | 19 | channelTrace = data.dat(:, channelIdxToPlot); 20 | 21 | if filterTrace 22 | wn = [filterLowPass filterHighPass] / (fs / 2); 23 | filterOrder = 3; 24 | [b, a] = butter(filterOrder, wn); 25 | channelTrace = filtfilt(b, a, double(channelTrace)); 26 | end 27 | 28 | 29 | %% Plot 30 | 31 | figure 32 | 33 | plot(secTimeBins, channelTrace(plotTimeSamplesRange(1):plotTimeSamplesRange(2)), 'color', traceColor) 34 | xlabel('Time (seconds)') 35 | title(sprintf('Channel %.f', channelNameToPlot)); 36 | 37 | 38 | % -------------------------------------------------------------------------------- /Functions/plotNullModelIterations.m: -------------------------------------------------------------------------------- 1 | function [] = plotNullModelIterations(met, met2, lagval, e, FN, Params, figFolder, oneFigureHandle) 2 | %{ 3 | 4 | Parameters 5 | ---------- 6 | 7 | met : 8 | met2 : 9 | lagval : int 10 | e : 11 | FN : 12 | Params : struct 13 | 14 | 15 | Returns 16 | ------- 17 | 18 | %} 19 | 20 | p = [100 100 1000 600]; 21 | set(0, 'DefaultFigurePosition', p) 22 | 23 | if ~Params.showOneFig 24 | figure(); 25 | else 26 | set(oneFigureHandle, 'Position', p); 27 | end 28 | 29 | t = tiledlayout(2,1); 30 | t.Title.String = strcat(regexprep(FN,'_','','emptymatch'),{' '},num2str(lagval(e)),{' '},'ms',{' '},'lag'); 31 | 32 | nexttile 33 | plot(met,'LineWidth',2) 34 | ylabel('small world coefficient') 35 | xlabel('iterations/10') 36 | title('lattice null model') 37 | aesthetics 38 | set(gca,'TickDir','out'); 39 | 40 | nexttile 41 | plot(met2,'LineWidth',2) 42 | title('random null model') 43 | ylabel('small world coefficient') 44 | xlabel('iterations/10') 45 | aesthetics 46 | set(gca,'TickDir','out'); 47 | 48 | 49 | %% save figure 50 | figName = strcat(['8_adjM', num2str(lagval(e)), 'msNullModels']); 51 | figPath = fullfile(figFolder, figName); 52 | 53 | if Params.showOneFig 54 | pipelineSaveFig(figPath, Params.figExt, Params.fullSVG, oneFigureHandle); 55 | else 56 | pipelineSaveFig(figPath, Params.figExt, Params.fullSVG); 57 | end 58 | 59 | if ~Params.showOneFig 60 | close all 61 | else 62 | set(0, 'CurrentFigure', oneFigureHandle); 63 | clf reset 64 | end 65 | 66 | end -------------------------------------------------------------------------------- /Functions/plotting/getEdgeThreshold.m: -------------------------------------------------------------------------------- 1 | function edge_thresh = getEdgeThreshold(adjM, Params) 2 | %GETEDGETHRESHOLD Summary of this function goes here 3 | % Detailed explanation goes here 4 | if isfield(Params, 'networkPlotEdgeThresholdMethod') 5 | if strcmp(Params.networkPlotEdgeThresholdMethod, 'Absolute Value') 6 | edge_thresh = Params.networkPlotEdgeThreshold; 7 | else 8 | edge_thresh_percentile = Params.networkPlotEdgeThresholdPercentile; 9 | edge_thresh = prctile(adjM(:), edge_thresh_percentile); 10 | end 11 | else 12 | % Pre version 1.10.0 parameters 13 | edge_thresh = 0.0001; 14 | end 15 | 16 | end 17 | 18 | -------------------------------------------------------------------------------- /Functions/plotting/getNodeSize.m: -------------------------------------------------------------------------------- 1 | function nodeSize = getNodeSize(z_i, nodeScaleF, Params) 2 | %GETNODESIZE Summary of this function goes here 3 | % Detailed explanation goes here 4 | if isfield(Params, 'nodeScalingMethod') 5 | if strcmp(Params.nodeScalingMethod, 'Linear') 6 | nodeSize = max(Params.minNodeSize, z_i/nodeScaleF); 7 | elseif strcmp(Params.nodeScalingMethod, 'Log2') 8 | nodeSize = max(Params.minNodeSize, log2(z_i+1)/log2(nodeScaleF +1)); 9 | elseif strcmp(Params.nodeScalingMethod, 'Log10') 10 | nodeSize = max(Params.minNodeSize, log10(z_i+1)/log10(nodeScaleF +1)); 11 | elseif strcmp(Params.nodeScalingMethod, 'Square') 12 | nodeSize = max(Params.minNodeSize, z_i^2/nodeScaleF^2); 13 | elseif strcmp(Params.nodeScalingMethod, 'Cube') 14 | nodeSize = max(Params.minNodeSize, z_i^3/nodeScaleF^3); 15 | elseif strcmp(Params.nodeScalingMethod, 'Power') 16 | nodeSize = max(Params.minNodeSize, z_i^Params.nodeScalingPower/nodeScaleF^Params.nodeScalingPower); 17 | end 18 | else 19 | % This here means that the max node size is 1 20 | nodeSize = max(Params.minNodeSize, z_i/nodeScaleF); 21 | end 22 | 23 | if isfield(Params, 'maxNodeSize') 24 | nodeSize = max(Params.minNodeSize, nodeSize * Params.maxNodeSize); 25 | end 26 | 27 | end 28 | 29 | -------------------------------------------------------------------------------- /Functions/randomiseSpikeTrain.m: -------------------------------------------------------------------------------- 1 | function randSpikeTimes = randomiseSpikeTrain(spikeTimes, duration, method) 2 | 3 | if strcmp(method, 'wrap') 4 | minTime = 0; 5 | maxTime = duration; 6 | cutTime = (maxTime-minTime) .* rand(1,1) + minTime; 7 | 8 | beforeCutTimeIdx = spikeTimes < cutTime; 9 | afterCutTimeIdx = spikeTimes >= cutTime; 10 | 11 | randSpikeTimes(beforeCutTimeIdx) = (duration - cutTime) + spikeTimes(beforeCutTimeIdx); 12 | randSpikeTimes(afterCutTimeIdx) = spikeTimes(afterCutTimeIdx) - cutTime; 13 | end 14 | 15 | end -------------------------------------------------------------------------------- /Functions/removeAxis.m: -------------------------------------------------------------------------------- 1 | function removeAxis() 2 | %REMOVEAXIS Remove X and Y axis from plot 3 | ax1 = gca; % gca = get current axis 4 | ax1.YAxis.Visible = 'off'; % remove y-axis 5 | ax1.XAxis.Visible = 'off'; % remove x-axis 6 | end 7 | 8 | -------------------------------------------------------------------------------- /Functions/resampleMatrix.m: -------------------------------------------------------------------------------- 1 | function newMatrix = resampleMatrix(ogMatrix, ogFs, newFs) 2 | %RESAMPLEMATRIX Resample matrix given original and new sampling rate 3 | % INPUT 4 | % ----------- 5 | % ogMatrix : (numTimePoints, numVariables) 6 | % Reference: 7 | % https://uk.mathworks.com/help/signal/ug/resampling-uniformly-sampled-signals.html 8 | 9 | [p, q] = rat(newFs / ogFs); % get matlab resmapling parameters 10 | 11 | ogNumSamples = size(ogMatrix, 1); 12 | numVar = size(ogMatrix, 2); 13 | 14 | newNumSamples = ogNumSamples / ogFs * newFs; 15 | newMatrix = zeros(newNumSamples, numVar) + nan; 16 | 17 | for varIdx = 1:numVar 18 | newMatrix(:, varIdx) = resample(ogMatrix(:, varIdx), p, q); 19 | end 20 | 21 | 22 | end 23 | 24 | -------------------------------------------------------------------------------- /Functions/sjKDE/bandwidth_SJ.m: -------------------------------------------------------------------------------- 1 | function [hout]=bandwidth_SJ(xi,K) 2 | % 3 | % Bandwidth selection with Sheater and Jones(1991) 4 | % and Wand and Jones (1995) pp.74-75 5 | 6 | syms uh 7 | if K=='norm' 8 | fk=1/sqrt(2*pi)*exp(-0.5*uh^2); 9 | interK1=-inf;interK2=inf; 10 | elseif K=='biwt' 11 | fk=15/16*(1-uh^2)^2; 12 | interK1=-1;interK2=1; 13 | elseif K=='expn' 14 | fk=exp(-uh); 15 | interK1=0;interK2=inf; 16 | end 17 | 18 | fk_der4_0=subs(diff(fk,4),0); 19 | fk_der6_0=subs(diff(fk,6),0); 20 | 21 | RK=int(fk^2,interK1,interK2); 22 | RKr=double(RK); 23 | mu2=int(uh^2*fk,interK1,interK2); 24 | mu2r=double(mu2); 25 | nL=length(xi); 26 | %Psi6_NS=-15/(16*pi^0.5*std(xi)^7); 27 | Psi8_NS=105/(32*pi^0.5*std(xi)^9); 28 | g1=(-2*fk_der6_0/(mu2r*Psi8_NS*nL))^(1/9); 29 | Psi6=f_Psi_Lrg(fk,6,g1,xi,interK1,interK2); 30 | 31 | g2=(-2*fk_der4_0/(mu2r*Psi6*nL))^(1/7); 32 | Psi4=f_Psi_Lrg(fk,4,g2,xi,interK1,interK2); 33 | 34 | hout=(RKr/(mu2r^2*Psi4*nL))^(1/5); 35 | 36 | 37 | function [outPsi]=f_Psi_Lrg(L,r,g,xx,interK1,interK2) 38 | fL_r_der=diff(L,r); 39 | nL=length(xx); 40 | sum1=0; 41 | for iL1=1:nL 42 | uu1=(xx-xx(iL1))./g; 43 | uu2=uu1(uu1~=0 & (uu1>interK1 & uu1 0)); 12 | if isempty(spikeTimesRelStim) 13 | spikeTimesRelStim = nan; 14 | end 15 | 16 | spikeLatencies(stimIdx) = spikeTimesRelStim; 17 | 18 | end 19 | 20 | end 21 | 22 | -------------------------------------------------------------------------------- /Functions/stimAnalysis/getStimPatterns.m: -------------------------------------------------------------------------------- 1 | function [stimInfo, stimPatterns] = getStimPatterns(stimInfo, Params) 2 | %GETSTIMPATTERNS Identify unique patterns of stimulation 3 | % Detailed explanation goes here 4 | 5 | % 1 | Get unique stimulation numbers 6 | numElectrode = length(stimInfo); 7 | numStimPerElectrode = zeros(numElectrode, 1); 8 | 9 | for elecIndex = 1:length(stimInfo) 10 | 11 | numStimPerElectrode(elecIndex) = length(stimInfo{elecIndex}.elecStimTimes); 12 | 13 | end 14 | 15 | numPotentialUniquePatterns = length(unique(numStimPerElectrode)); 16 | 17 | if strcmp(Params.verboseLevel, 'High') 18 | fprintf(sprintf('Number of potential patterns detected: %.f \n', numPotentialUniquePatterns)); 19 | end 20 | 21 | % 2 | start from electrode with least stimulation number to look for 22 | % patterns 23 | stimPatterns = {}; 24 | [~, elecIndexSorted] = sort(numStimPerElectrode); 25 | 26 | for eIndex = 1:length(stimInfo) 27 | 28 | elecIndex = elecIndexSorted(eIndex); 29 | 30 | % check if there is no stimulation, if so, assign to pattern 0 31 | if length(stimInfo{elecIndex}.elecStimTimes) == 0 32 | stimInfo{elecIndex}.pattern = 0; 33 | else 34 | [patternId, stimPatterns] = checkStimPattern(stimInfo{elecIndex}.elecStimTimes, ... 35 | stimPatterns, Params.stimTimeDiffThreshold); 36 | stimInfo{elecIndex}.pattern = patternId; 37 | end 38 | 39 | 40 | end 41 | 42 | 43 | 44 | 45 | 46 | end 47 | 48 | -------------------------------------------------------------------------------- /Functions/stimAnalysis/plotStimHeatmap.m: -------------------------------------------------------------------------------- 1 | function figHandle = plotStimHeatmap(stimInfo, figHandle) 2 | %PLOTSTIMHEATMAP Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | if ~exist('figHandle', 'var') 6 | figHandle = figure(); 7 | elseif ~isgraphics(figHandle) 8 | figHandle = figure(); 9 | end 10 | 11 | p = [100 100 600 600]; 12 | set(figHandle, 'Position', p); 13 | 14 | numNodes = length(stimInfo); 15 | 16 | nodeScaleF = 1; 17 | 18 | for nodeIdx = 1:numNodes 19 | xc = stimInfo{nodeIdx}.coords(1); 20 | yc = stimInfo{nodeIdx}.coords(2); 21 | circlePos = [xc - (0.5*nodeScaleF), yc - (0.5*nodeScaleF), nodeScaleF, nodeScaleF]; 22 | 23 | if length(stimInfo{nodeIdx}.elecStimTimes) == 0 24 | nodeColor = 'white'; 25 | else 26 | nodeColor = 'black'; 27 | end 28 | rectangle('Position', circlePos,'Curvature',[1 1],'FaceColor',nodeColor,'EdgeColor','black','LineWidth', 1) 29 | end 30 | 31 | 32 | 33 | 34 | 35 | end 36 | 37 | -------------------------------------------------------------------------------- /Functions/stimAnalysis/plotStimHeatmapWmetric.m: -------------------------------------------------------------------------------- 1 | function figHandle = plotStimHeatmapWmetric(nodeMetric, vrange, cmap, cmapLabel, stimInfo, patternID, figHandle) 2 | %PLOTSTIMHEATMAP Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | if ~exist('figHandle', 'var') 6 | figHandle = figure(); 7 | elseif ~isgraphics(figHandle) 8 | figHandle = figure(); 9 | end 10 | 11 | p = [100 100 700 600]; 12 | set(figHandle, 'Position', p); 13 | 14 | numNodes = length(stimInfo); 15 | 16 | nodeScaleF = 1; 17 | 18 | for nodeIdx = 1:numNodes 19 | xc = stimInfo{nodeIdx}.coords(1); 20 | yc = stimInfo{nodeIdx}.coords(2); 21 | circlePos = [xc - (0.5*nodeScaleF), yc - (0.5*nodeScaleF), nodeScaleF, nodeScaleF]; 22 | 23 | if (length(stimInfo{nodeIdx}.elecStimTimes) > 0) & ismember(stimInfo{nodeIdx}.pattern, patternID) 24 | nodeColor = 'white'; % [0.5, 0.5, 0.5]; 25 | else 26 | % nodeColor = 'black'; 27 | nodeColor = valuesToColormap(nodeMetric(nodeIdx), cmap, vrange(1), vrange(2)); 28 | end 29 | rectangle('Position', circlePos,'Curvature',[1 1],'FaceColor',nodeColor,'EdgeColor','black','LineWidth', 1) 30 | end 31 | 32 | % colorbar 33 | colormap(cmap); 34 | cb = colorbar(); 35 | clim(vrange); 36 | ylabel(cb, cmapLabel, 'FontSize', 12); 37 | 38 | % remove ticks and axis 39 | axis off 40 | 41 | set(gcf, 'color', 'w') 42 | 43 | end 44 | 45 | -------------------------------------------------------------------------------- /Functions/stimAnalysis/valuesToColormap.m: -------------------------------------------------------------------------------- 1 | function rgbColors = valuesToColormap(values, cmapName, vmin, vmax) 2 | % valuesToColormap: Map numeric values to RGB colors using a colormap. 3 | % Written by chatgpt with the following prompt: 4 | % In matlab, can you write me code to convert a set of values to color 5 | % values specified by a colormap, 6 | % I will provide the min and max of the set of values available 7 | % Inputs: 8 | % - values: A vector or matrix of numeric values. 9 | % - cmapName: Name of a MATLAB colormap, e.g., 'parula', 'jet', 'hot'. 10 | % - vmin: Minimum value for scaling. 11 | % - vmax: Maximum value for scaling. 12 | % 13 | % Output: 14 | % - rgbColors: An Nx3 matrix of RGB color values if input is a vector, 15 | % or an MxNx3 matrix if input is a matrix. 16 | 17 | % Get the colormap 18 | cmap = colormap(cmapName); 19 | nColors = size(cmap, 1); 20 | 21 | % Normalize values to range [0, 1] 22 | normVals = (values - vmin) / (vmax - vmin); 23 | normVals = max(0, min(1, normVals)); % Clip to [0,1] 24 | 25 | % Scale to colormap indices 26 | idx = round(normVals * (nColors - 1)) + 1; 27 | 28 | % Apply colormap 29 | if isvector(values) 30 | rgbColors = cmap(idx, :); 31 | else 32 | rgbColors = zeros([size(values), 3]); 33 | for i = 1:3 34 | channel = cmap(:, i); 35 | rgbColors(:,:,i) = reshape(channel(idx), size(values)); 36 | end 37 | end 38 | end -------------------------------------------------------------------------------- /Functions/tight_subplot/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Pekka Kumpulainen 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the distribution 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /Functions/twoPhoton/__pycache__/readOpsNPY.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/twoPhoton/__pycache__/readOpsNPY.cpython-38.pyc -------------------------------------------------------------------------------- /Functions/twoPhoton/__pycache__/readStatNPY.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Functions/twoPhoton/__pycache__/readStatNPY.cpython-38.pyc -------------------------------------------------------------------------------- /Functions/twoPhoton/get2pActivityMatrix.m: -------------------------------------------------------------------------------- 1 | function twopActivityMatrix = get2pActivityMatrix(F, denoisedF, spks, spikeTimes, resamplingRate, Info, Params) 2 | %GET2PACTIVITYMATRIX Summary of this function goes here 3 | % Detailed explanation goes here 4 | % twopActivityMatrix (numTimeSmaples, numUnits) 5 | if strcmp(Params.twopActivity, 'F') 6 | twopActivityMatrix = double(F); 7 | elseif strcmp(Params.twopActivity, 'denoised F') 8 | twopActivityMatrix = double(denoisedF); 9 | elseif strcmp(Params.twopActivity, 'spks') 10 | twopActivityMatrix = double(spks); 11 | elseif strcmp(Params.twopActivity, 'peaks') 12 | twopActivityMatrix = SpikeTimesToMatrix(spikeTimes, resamplingRate, 'peak', Info); 13 | end 14 | 15 | end 16 | 17 | -------------------------------------------------------------------------------- /Functions/twoPhoton/getCellTypeMatrix.m: -------------------------------------------------------------------------------- 1 | function [cellTypeMatrix, cellTypeNames] = getCellTypeMatrix(cellTypesTable, channels) 2 | %GETCELLTYPEMATRIX Summary of this function goes here 3 | % Detailed explanation goes here 4 | % cellTypesTable : Info.CellTypes 5 | 6 | cellTypesArray = table2array(cellTypesTable) + 1; % go from 0-indexing to 1-indexing 7 | numCellTypes = size(cellTypesArray, 2); 8 | cellTypeMatrix = zeros(length(channels), numCellTypes); 9 | cellTypeNames = cellTypesTable.Properties.VariableNames; 10 | 11 | 12 | for cellTypeColumnIdx = 1:numCellTypes 13 | cellIds = cellTypesArray(:, cellTypeColumnIdx); 14 | cellIds = cellIds(~isnan(cellIds)); 15 | cellIdsInChannel = cellIds(ismember(cellIds, channels)); 16 | % can probably vectorised find, but this is easier to understand 17 | cellIndices = zeros(length(cellIdsInChannel), 1); 18 | for cellIdx = 1:length(cellIdsInChannel) 19 | cellIndices(cellIdx) = find(channels == cellIdsInChannel(cellIdx)); 20 | end 21 | cellTypeMatrix(cellIndices, cellTypeColumnIdx) = 1; 22 | end 23 | 24 | end 25 | 26 | -------------------------------------------------------------------------------- /Functions/twoPhoton/readOpsNPY.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | def getFs(opsFpath): 4 | 5 | ops = np.load(opsFpath, allow_pickle=True).item() 6 | fs = ops['fs'] 7 | 8 | return fs -------------------------------------------------------------------------------- /Functions/twoPhoton/readStatNPY.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | def getXYloc(statFpath): 4 | 5 | stat = np.load(statFpath, allow_pickle=True) 6 | x_loc = [stat[x]['med'][0] for x in np.arange(0, len(stat))] 7 | y_loc = [stat[x]['med'][1] for x in np.arange(0, len(stat))] 8 | 9 | XYloc = np.stack([x_loc, y_loc]) 10 | 11 | return XYloc 12 | 13 | -------------------------------------------------------------------------------- /Functions/util/checkIfRecomputeMetric.m: -------------------------------------------------------------------------------- 1 | function pleaseComputeMetric = checkIfRecomputeMetric(Params, prevNetMet, lagValFieldName, netMetName) 2 | %CHECKIFRECOMPUTEMETRIC Check whether to recompute metric 3 | % Detailed explanation goes here 4 | % TODO: write function to also check the Parameters related to metric 5 | % calculation matches 6 | 7 | % Check if user ask to recompute metrics 8 | if Params.recomputeMetrics == 1 9 | if contains(Params.metricsToRecompute, 'all') 10 | pleaseComputeMetric = 1; 11 | % check if the metric in question is one user specifically asked to 12 | % recompute 13 | elseif contains(Params.metricsToRecompute, netMetName) 14 | pleaseComputeMetric = 1; 15 | else 16 | % various checks to see if the metric already existed before 17 | prevComputed = checkMetricPrevComputed(prevNetMet, lagValFieldName, netMetName); 18 | pleaseComputeMetric = (1 - prevComputed); 19 | end 20 | else 21 | % if metric is alredy previously computed, then do not recompute it 22 | prevComputed = checkMetricPrevComputed(prevNetMet, lagValFieldName, netMetName); 23 | pleaseComputeMetric = (1 - prevComputed); 24 | end 25 | 26 | 27 | end 28 | 29 | -------------------------------------------------------------------------------- /Functions/util/checkMetricPrevComputed.m: -------------------------------------------------------------------------------- 1 | function prevComputed = checkMetricPrevComputed(prevNetMet, lagValFieldName, netMetName) 2 | % Check if the lag has previously been done before 3 | if isfield(prevNetMet, lagValFieldName) 4 | if isfield(prevNetMet.(lagValFieldName), netMetName) 5 | prevComputed = 1; 6 | else 7 | prevComputed = 0; 8 | end 9 | else 10 | prevComputed = 0; 11 | end 12 | 13 | end 14 | -------------------------------------------------------------------------------- /Functions/util/getMemoryUsage.m: -------------------------------------------------------------------------------- 1 | function getMemoryUsage() 2 | %GETMEMORYUSAGE Summary of this function goes here 3 | % Detailed explanation goes here 4 | % Get memory usage 5 | if ispc 6 | user = memory; 7 | total_mem_usage_mb = user.MemUsedMATLAB / (10.^6); 8 | 9 | else 10 | [tmp pid] = system('pgrep MATLAB'); 11 | pid_split = strsplit(pid); 12 | total_mem_usage_mb = 0; 13 | for pid_idx = 1:length(pid_split)-1 14 | [tmp mem_usage] = system(['cat /proc/' strtrim(pid_split{pid_idx}) '/status | grep VmSize']); 15 | mem_usage_mb = round(str2num(strtrim(extractAfter(extractBefore(mem_usage, ' kB'), ':'))) / 1000); 16 | total_mem_usage_mb = total_mem_usage_mb + mem_usage_mb; 17 | end 18 | 19 | 20 | end 21 | 22 | fprintf(sprintf('MATLAB memory used: %.f MB \n', total_mem_usage_mb)) 23 | 24 | end 25 | 26 | -------------------------------------------------------------------------------- /Functions/util/isImageFile.m: -------------------------------------------------------------------------------- 1 | function isImage = isImageFile(extension) 2 | % Define valid image extensions 3 | validExtensions = {'.png', '.jpg', '.jpeg', '.bmp', '.tif', '.tiff', '.gif'}; 4 | 5 | % Check if the file has a valid image extension 6 | isImage = any(strcmpi(extension, validExtensions)); 7 | end 8 | -------------------------------------------------------------------------------- /Functions/util/natsort/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024, Stephen Cobeldick 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution 13 | 14 | * Neither the name of nor the names of its 15 | contributors may be used to endorse or promote products derived from this 16 | software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /Functions/util/traverseFolder.m: -------------------------------------------------------------------------------- 1 | function parentNode = traverseFolder(parentNode, currentFolder) 2 | 3 | 4 | % Get all contents of the current folder 5 | contents = dir(currentFolder); 6 | 7 | % Filter out '.' and '..' directories 8 | contents = contents(~ismember({contents.name}, {'.', '..'})); 9 | [~, sort_idx] = natsort({contents.name}); 10 | contents = contents(sort_idx); 11 | 12 | for i = 1:length(contents) 13 | % Get the name and full path of the current item 14 | itemName = contents(i).name; 15 | itemFullPath = fullfile(currentFolder, itemName); 16 | 17 | if contents(i).isdir 18 | % If it's a folder, create a new uitreenode 19 | folderNode = uitreenode(parentNode, 'Text', itemName, 'NodeData', itemFullPath); 20 | % parentNode.addChild(folderNode); 21 | 22 | % Recursively traverse the folder and add its contents 23 | traverseFolder(folderNode, itemFullPath); 24 | else 25 | % If it's an image file, create a new node and add it 26 | [~, ~, ext] = fileparts(itemFullPath); 27 | if isImageFile(ext) 28 | imageNode = uitreenode(parentNode, 'Text', itemName, 'NodeData', itemFullPath); 29 | % parentNode.addChild(imageNode); 30 | end 31 | end 32 | end 33 | 34 | end -------------------------------------------------------------------------------- /Functions/util/traverseFolderAndStop.m: -------------------------------------------------------------------------------- 1 | function parentNode = traverseFolderAndStop(parentNode, currentFolder) 2 | % This only goes one folder (does not recurvesily go through folder) 3 | 4 | % Get all contents of the current folder 5 | contents = dir(currentFolder); 6 | 7 | % Filter out '.' and '..' directories 8 | contents = contents(~ismember({contents.name}, {'.', '..'})); 9 | [~, sort_idx] = natsort({contents.name}); 10 | contents = contents(sort_idx); 11 | 12 | for i = 1:length(contents) 13 | % Get the name and full path of the current item 14 | itemName = contents(i).name; 15 | itemFullPath = fullfile(currentFolder, itemName); 16 | 17 | if contents(i).isdir 18 | % If it's a folder, create a new uitreenode 19 | folderNode = uitreenode(parentNode, 'Text', itemName, 'NodeData', itemFullPath); 20 | % parentNode.addChild(folderNode); 21 | 22 | else 23 | % If it's an image file, create a new node and add it 24 | [~, ~, ext] = fileparts(itemFullPath); 25 | if isImageFile(ext) 26 | imageNode = uitreenode(parentNode, 'Text', itemName, 'NodeData', itemFullPath); 27 | % parentNode.addChild(imageNode); 28 | end 29 | end 30 | end 31 | 32 | end -------------------------------------------------------------------------------- /Images/BC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/BC.png -------------------------------------------------------------------------------- /Images/CC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/CC.png -------------------------------------------------------------------------------- /Images/Dens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/Dens.png -------------------------------------------------------------------------------- /Images/EW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/EW.png -------------------------------------------------------------------------------- /Images/Eglob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/Eglob.png -------------------------------------------------------------------------------- /Images/Eloc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/Eloc.png -------------------------------------------------------------------------------- /Images/MS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/MS.png -------------------------------------------------------------------------------- /Images/ND.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/ND.png -------------------------------------------------------------------------------- /Images/NS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/NS.png -------------------------------------------------------------------------------- /Images/NodeCartographyDiagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/NodeCartographyDiagram.jpg -------------------------------------------------------------------------------- /Images/NodeCartographyFull.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/NodeCartographyFull.jpg -------------------------------------------------------------------------------- /Images/PC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/PC.png -------------------------------------------------------------------------------- /Images/PL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/PL.png -------------------------------------------------------------------------------- /Images/SW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/SW.png -------------------------------------------------------------------------------- /Images/WMZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/WMZ.png -------------------------------------------------------------------------------- /Images/nMod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/Images/nMod.png -------------------------------------------------------------------------------- /MEANAPApp.mlapp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/MEANAPApp.mlapp -------------------------------------------------------------------------------- /MEANAPviewer.mlapp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/MEANAPviewer.mlapp -------------------------------------------------------------------------------- /docs/.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file for Sphinx projects 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | # Required 5 | version: 2 6 | 7 | build: 8 | os: ubuntu-22.04 9 | tools: 10 | python: "3.12" 11 | 12 | # Build documentation in the "docs/" directory with Sphinx 13 | sphinx: 14 | configuration: docs/conf.py 15 | 16 | python: 17 | install: 18 | - requirements: docs/requirements.txt 19 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/_build/doctrees/citing-MEANAP.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/citing-MEANAP.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/_build/doctrees/frequently-asked-questions.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/frequently-asked-questions.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/guide-for-advanced-users.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/guide-for-advanced-users.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/guide-for-new-users.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/guide-for-new-users.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/how-to-contribute.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/how-to-contribute.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/meanap-methods.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/meanap-methods.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/meanap-outputs.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/meanap-outputs.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/running-MEANAP-on-HPC.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/running-MEANAP-on-HPC.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/setting-up-matlab.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/setting-up-matlab.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/setting-up-meanap.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/setting-up-meanap.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/sources.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/sources.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/system-requirements.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/doctrees/system-requirements.doctree -------------------------------------------------------------------------------- /docs/_build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file records the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: c5d614a02a206c7b9930a02f5eb0a02f 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/_build/html/.buildinfo.bak: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: c7dd5d059eb7d71502a3e7ce60dcef5c 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/_build/html/_images/BC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/BC.png -------------------------------------------------------------------------------- /docs/_build/html/_images/CC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/CC.png -------------------------------------------------------------------------------- /docs/_build/html/_images/Dens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/Dens.png -------------------------------------------------------------------------------- /docs/_build/html/_images/EW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/EW.png -------------------------------------------------------------------------------- /docs/_build/html/_images/MEANAPoverview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/MEANAPoverview.png -------------------------------------------------------------------------------- /docs/_build/html/_images/MEApipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/MEApipeline.png -------------------------------------------------------------------------------- /docs/_build/html/_images/MS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/MS.png -------------------------------------------------------------------------------- /docs/_build/html/_images/ND.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/ND.png -------------------------------------------------------------------------------- /docs/_build/html/_images/N_size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/N_size.png -------------------------------------------------------------------------------- /docs/_build/html/_images/N_strength.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/N_strength.png -------------------------------------------------------------------------------- /docs/_build/html/_images/PC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/PC.png -------------------------------------------------------------------------------- /docs/_build/html/_images/PL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/PL.png -------------------------------------------------------------------------------- /docs/_build/html/_images/WMZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/WMZ.png -------------------------------------------------------------------------------- /docs/_build/html/_images/axion_file_conversion_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/axion_file_conversion_gui.png -------------------------------------------------------------------------------- /docs/_build/html/_images/axion_file_conversion_gui_v1p10p0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/axion_file_conversion_gui_v1p10p0.png -------------------------------------------------------------------------------- /docs/_build/html/_images/burst_detection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/burst_detection.png -------------------------------------------------------------------------------- /docs/_build/html/_images/connectivity_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/connectivity_gui.png -------------------------------------------------------------------------------- /docs/_build/html/_images/example-spreadsheet-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/example-spreadsheet-input.png -------------------------------------------------------------------------------- /docs/_build/html/_images/firing_rates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/firing_rates.png -------------------------------------------------------------------------------- /docs/_build/html/_images/firing_rates_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/firing_rates_2.png -------------------------------------------------------------------------------- /docs/_build/html/_images/general_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/general_gui.png -------------------------------------------------------------------------------- /docs/_build/html/_images/github_repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/github_repo.png -------------------------------------------------------------------------------- /docs/_build/html/_images/global_efficiency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/global_efficiency.png -------------------------------------------------------------------------------- /docs/_build/html/_images/local_efficiency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/local_efficiency.png -------------------------------------------------------------------------------- /docs/_build/html/_images/matlab_addon_dropdown_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/matlab_addon_dropdown_menu.png -------------------------------------------------------------------------------- /docs/_build/html/_images/matlab_home_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/matlab_home_menu.png -------------------------------------------------------------------------------- /docs/_build/html/_images/mexmaci64_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/mexmaci64_error.png -------------------------------------------------------------------------------- /docs/_build/html/_images/nMod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/nMod.png -------------------------------------------------------------------------------- /docs/_build/html/_images/node_cartography_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/node_cartography_2.png -------------------------------------------------------------------------------- /docs/_build/html/_images/node_cartography_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/node_cartography_3.png -------------------------------------------------------------------------------- /docs/_build/html/_images/node_cartography_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/node_cartography_4.png -------------------------------------------------------------------------------- /docs/_build/html/_images/node_cartography_proportions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/node_cartography_proportions.png -------------------------------------------------------------------------------- /docs/_build/html/_images/num_electrodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/num_electrodes.png -------------------------------------------------------------------------------- /docs/_build/html/_images/num_electrodes_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/num_electrodes_2.png -------------------------------------------------------------------------------- /docs/_build/html/_images/plotting_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/plotting_gui.png -------------------------------------------------------------------------------- /docs/_build/html/_images/probabilistic_thresholding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/probabilistic_thresholding.png -------------------------------------------------------------------------------- /docs/_build/html/_images/run_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/run_button.png -------------------------------------------------------------------------------- /docs/_build/html/_images/save_parameters_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/save_parameters_gui.png -------------------------------------------------------------------------------- /docs/_build/html/_images/small_world_coefficient_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/small_world_coefficient_1.png -------------------------------------------------------------------------------- /docs/_build/html/_images/small_world_coefficient_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/small_world_coefficient_2.png -------------------------------------------------------------------------------- /docs/_build/html/_images/spike_detection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/spike_detection.png -------------------------------------------------------------------------------- /docs/_build/html/_images/spike_detection_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/spike_detection_gui.png -------------------------------------------------------------------------------- /docs/_build/html/_images/spike_detection_methods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/spike_detection_methods.png -------------------------------------------------------------------------------- /docs/_build/html/_images/template_based_options_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/template_based_options_2.png -------------------------------------------------------------------------------- /docs/_build/html/_images/threshold_based_options_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_images/threshold_based_options_2.png -------------------------------------------------------------------------------- /docs/_build/html/_sources/citing-MEANAP.rst.txt: -------------------------------------------------------------------------------- 1 | Citing MEA-NAP 2 | =============== 3 | 4 | **Please cite our paper if you use MEA-NAP in your research:** 5 | 6 | Timothy PH Sit +, Rachael C Feord +, Alexander WE Dunn, Jeremi Chabros, David Oluigbo, Hugo H Smith, Lance Burn, Elise Chang, Alessio Boschi, Yin Yuan, George M Gibbons, Mahsa Khayat-Khoei, Francesco De Angelis, Erik Hemberg, Martin Hemberg, Madeline A Lancaster, Andras Lakatos, Stephen J Eglen, Ole Paulsen, Susanna B Mierau. **MEA-NAP: A flexible network analysis pipeline for neuronal 2D and 3D organoid multielectrode recordings.** `Cell Reports Methods`, 4, 100901, November 18, 2024. doi:[https://doi.org/10.1016/j.crmeth.2024.100901]. + equal contribution 7 | 8 | An earlier version of the manuscript is also available on bioRxiv and on PubMed Central: 9 | 10 | [https://pmc.ncbi.nlm.nih.gov/articles/PMC10871179/] 11 | 12 | Sit TPH +, Feord RC +, Dunn AWE, Chabros J, Oluigbo D, Smith HH, Burn L, Change E, Boschi A, Yuan Y, Gibbons GM, Khayat-Khoei M, De Angelis F, Hemberg E, Hemberg M, Lancaster MA, Lakatos A, Eglen SJ, Paulsen O, Mierau SB. **MEA-NAP compares microscale functional connectivity, topology, and network dynamics in organoid or monolayer neuronal cultures**. bioRxiv 2024.02.05.578738. doi: [https://doi.org/10.1101/2024.02.05.578738]. + co-first author 13 | -------------------------------------------------------------------------------- /docs/_build/html/_static/css/custom.css: -------------------------------------------------------------------------------- 1 | .bolditalic { 2 | font-weight: bold; 3 | font-style: italic; 4 | } -------------------------------------------------------------------------------- /docs/_build/html/_static/css/tooltipster-sideTip-noir.min.css: -------------------------------------------------------------------------------- 1 | .tooltipster-sidetip.tooltipster-noir .tooltipster-box{border-radius:0;border:3px solid #000;background:#fff}.tooltipster-sidetip.tooltipster-noir .tooltipster-content{color:#000}.tooltipster-sidetip.tooltipster-noir .tooltipster-arrow{height:11px;margin-left:-11px;width:22px}.tooltipster-sidetip.tooltipster-noir.tooltipster-left .tooltipster-arrow,.tooltipster-sidetip.tooltipster-noir.tooltipster-right .tooltipster-arrow{height:22px;margin-left:0;margin-top:-11px;width:11px}.tooltipster-sidetip.tooltipster-noir .tooltipster-arrow-background{border:11px solid transparent}.tooltipster-sidetip.tooltipster-noir.tooltipster-bottom .tooltipster-arrow-background{border-bottom-color:#fff;top:4px}.tooltipster-sidetip.tooltipster-noir.tooltipster-left .tooltipster-arrow-background{border-left-color:#fff;left:-4px}.tooltipster-sidetip.tooltipster-noir.tooltipster-right .tooltipster-arrow-background{border-right-color:#fff;left:4px}.tooltipster-sidetip.tooltipster-noir.tooltipster-top .tooltipster-arrow-background{border-top-color:#fff;top:-4px}.tooltipster-sidetip.tooltipster-noir .tooltipster-arrow-border{border-width:11px}.tooltipster-sidetip.tooltipster-noir.tooltipster-bottom .tooltipster-arrow-uncropped{top:-11px}.tooltipster-sidetip.tooltipster-noir.tooltipster-right .tooltipster-arrow-uncropped{left:-11px} -------------------------------------------------------------------------------- /docs/_build/html/_static/css/tooltipster-sideTip-punk.min.css: -------------------------------------------------------------------------------- 1 | .tooltipster-sidetip.tooltipster-punk .tooltipster-box{border-radius:5px;border:none;border-bottom:3px solid #f71169;background:#2a2a2a}.tooltipster-sidetip.tooltipster-punk.tooltipster-top .tooltipster-box{margin-bottom:7px}.tooltipster-sidetip.tooltipster-punk .tooltipster-content{color:#fff;padding:8px 16px}.tooltipster-sidetip.tooltipster-punk .tooltipster-arrow-background{display:none}.tooltipster-sidetip.tooltipster-punk.tooltipster-bottom .tooltipster-arrow-border{border-bottom-color:#2a2a2a}.tooltipster-sidetip.tooltipster-punk.tooltipster-left .tooltipster-arrow-border{border-left-color:#2a2a2a}.tooltipster-sidetip.tooltipster-punk.tooltipster-right .tooltipster-arrow-border{border-right-color:#2a2a2a}.tooltipster-sidetip.tooltipster-punk.tooltipster-top .tooltipster-arrow-border{border-top-color:#f71169} -------------------------------------------------------------------------------- /docs/_build/html/_static/css/tooltipster.custom.css: -------------------------------------------------------------------------------- 1 | .hxr-hoverxref { 2 | border-bottom: 1px dotted; 3 | border-color: gray; 4 | } 5 | 6 | .tooltipster-box { 7 | max-height: 600px; 8 | } 9 | 10 | .tooltipster-sidetip.tooltipster-shadow.tooltipster-shadow-custom .tooltipster-content { 11 | color: #8d8d8d; 12 | font-size: 80%; 13 | padding: 18px; 14 | } 15 | 16 | .tooltipster-sidetip.tooltipster-shadow.tooltipster-shadow-custom .tooltipster-content p { 17 | font-size: 100% !important; 18 | } 19 | 20 | .tooltipster-sidetip.tooltipster-shadow.tooltipster-shadow-custom .tooltipster-content .headerlink { 21 | visibility: hidden; 22 | } -------------------------------------------------------------------------------- /docs/_build/html/_static/debug.css: -------------------------------------------------------------------------------- 1 | /* 2 | This CSS file should be overridden by the theme authors. It's 3 | meant for debugging and developing the skeleton that this theme provides. 4 | */ 5 | body { 6 | font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, 7 | "Apple Color Emoji", "Segoe UI Emoji"; 8 | background: lavender; 9 | } 10 | .sb-announcement { 11 | background: rgb(131, 131, 131); 12 | } 13 | .sb-announcement__inner { 14 | background: black; 15 | color: white; 16 | } 17 | .sb-header { 18 | background: lightskyblue; 19 | } 20 | .sb-header__inner { 21 | background: royalblue; 22 | color: white; 23 | } 24 | .sb-header-secondary { 25 | background: lightcyan; 26 | } 27 | .sb-header-secondary__inner { 28 | background: cornflowerblue; 29 | color: white; 30 | } 31 | .sb-sidebar-primary { 32 | background: lightgreen; 33 | } 34 | .sb-main { 35 | background: blanchedalmond; 36 | } 37 | .sb-main__inner { 38 | background: antiquewhite; 39 | } 40 | .sb-header-article { 41 | background: lightsteelblue; 42 | } 43 | .sb-article-container { 44 | background: snow; 45 | } 46 | .sb-article-main { 47 | background: white; 48 | } 49 | .sb-footer-article { 50 | background: lightpink; 51 | } 52 | .sb-sidebar-secondary { 53 | background: lightgoldenrodyellow; 54 | } 55 | .sb-footer-content { 56 | background: plum; 57 | } 58 | .sb-footer-content__inner { 59 | background: palevioletred; 60 | } 61 | .sb-footer { 62 | background: pink; 63 | } 64 | .sb-footer__inner { 65 | background: salmon; 66 | } 67 | .sb-article { 68 | background: white; 69 | } 70 | -------------------------------------------------------------------------------- /docs/_build/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | const DOCUMENTATION_OPTIONS = { 2 | VERSION: '1.10.1', 3 | LANGUAGE: 'en', 4 | COLLAPSE_INDEX: false, 5 | BUILDER: 'html', 6 | FILE_SUFFIX: '.html', 7 | LINK_SUFFIX: '.html', 8 | HAS_SOURCE: true, 9 | SOURCELINK_SUFFIX: '.txt', 10 | NAVIGATION_WITH_KEYS: false, 11 | SHOW_SEARCH_SUMMARY: true, 12 | ENABLE_SEARCH_SHORTCUTS: true, 13 | }; -------------------------------------------------------------------------------- /docs/_build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_static/file.png -------------------------------------------------------------------------------- /docs/_build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/_build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_static/plus.png -------------------------------------------------------------------------------- /docs/_build/html/_static/scripts/furo-extensions.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/_static/scripts/furo-extensions.js -------------------------------------------------------------------------------- /docs/_build/html/_static/scripts/furo.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * gumshoejs v5.1.2 (patched by @pradyunsg) 3 | * A simple, framework-agnostic scrollspy script. 4 | * (c) 2019 Chris Ferdinandi 5 | * MIT License 6 | * http://github.com/cferdinandi/gumshoe 7 | */ 8 | -------------------------------------------------------------------------------- /docs/_build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/_build/html/objects.inv -------------------------------------------------------------------------------- /docs/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | {% set css_files = css_files + [ "_static/css/custom.css" ] %} -------------------------------------------------------------------------------- /docs/citing-MEANAP.rst: -------------------------------------------------------------------------------- 1 | Citing MEA-NAP 2 | =============== 3 | 4 | **Please cite our paper if you use MEA-NAP in your research:** 5 | 6 | Timothy PH Sit +, Rachael C Feord +, Alexander WE Dunn, Jeremi Chabros, David Oluigbo, Hugo H Smith, Lance Burn, Elise Chang, Alessio Boschi, Yin Yuan, George M Gibbons, Mahsa Khayat-Khoei, Francesco De Angelis, Erik Hemberg, Martin Hemberg, Madeline A Lancaster, Andras Lakatos, Stephen J Eglen, Ole Paulsen, Susanna B Mierau. **MEA-NAP: A flexible network analysis pipeline for neuronal 2D and 3D organoid multielectrode recordings.** `Cell Reports Methods`, 4, 100901, November 18, 2024. doi:[https://doi.org/10.1016/j.crmeth.2024.100901]. + equal contribution 7 | 8 | An earlier version of the manuscript is also available on bioRxiv and on PubMed Central: 9 | 10 | [https://pmc.ncbi.nlm.nih.gov/articles/PMC10871179/] 11 | 12 | Sit TPH +, Feord RC +, Dunn AWE, Chabros J, Oluigbo D, Smith HH, Burn L, Change E, Boschi A, Yuan Y, Gibbons GM, Khayat-Khoei M, De Angelis F, Hemberg E, Hemberg M, Lancaster MA, Lakatos A, Eglen SJ, Paulsen O, Mierau SB. **MEA-NAP compares microscale functional connectivity, topology, and network dynamics in organoid or monolayer neuronal cultures**. bioRxiv 2024.02.05.578738. doi: [https://doi.org/10.1101/2024.02.05.578738]. + co-first author 13 | -------------------------------------------------------------------------------- /docs/imgs/BC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/BC.png -------------------------------------------------------------------------------- /docs/imgs/CC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/CC.png -------------------------------------------------------------------------------- /docs/imgs/ConvertRawtoMat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/ConvertRawtoMat.png -------------------------------------------------------------------------------- /docs/imgs/Dens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/Dens.png -------------------------------------------------------------------------------- /docs/imgs/EW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/EW.png -------------------------------------------------------------------------------- /docs/imgs/Eglob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/Eglob.png -------------------------------------------------------------------------------- /docs/imgs/Eloc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/Eloc.png -------------------------------------------------------------------------------- /docs/imgs/MEANAP_dir_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/MEANAP_dir_gui.png -------------------------------------------------------------------------------- /docs/imgs/MEANAPoverview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/MEANAPoverview.png -------------------------------------------------------------------------------- /docs/imgs/MEApipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/MEApipeline.png -------------------------------------------------------------------------------- /docs/imgs/MEApipelineSteps2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/MEApipelineSteps2.png -------------------------------------------------------------------------------- /docs/imgs/MS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/MS.png -------------------------------------------------------------------------------- /docs/imgs/ND.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/ND.png -------------------------------------------------------------------------------- /docs/imgs/NS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/NS.png -------------------------------------------------------------------------------- /docs/imgs/N_size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/N_size.png -------------------------------------------------------------------------------- /docs/imgs/N_strength.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/N_strength.png -------------------------------------------------------------------------------- /docs/imgs/NodeCartographyDiagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/NodeCartographyDiagram.jpg -------------------------------------------------------------------------------- /docs/imgs/NodeCartographyFull.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/NodeCartographyFull.jpg -------------------------------------------------------------------------------- /docs/imgs/PC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/PC.png -------------------------------------------------------------------------------- /docs/imgs/PL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/PL.png -------------------------------------------------------------------------------- /docs/imgs/SW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/SW.png -------------------------------------------------------------------------------- /docs/imgs/WMZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/WMZ.png -------------------------------------------------------------------------------- /docs/imgs/axion_file_conversion_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/axion_file_conversion_gui.png -------------------------------------------------------------------------------- /docs/imgs/axion_file_conversion_gui_v1p10p0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/axion_file_conversion_gui_v1p10p0.png -------------------------------------------------------------------------------- /docs/imgs/burst_detection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/burst_detection.png -------------------------------------------------------------------------------- /docs/imgs/connectivity_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/connectivity_gui.png -------------------------------------------------------------------------------- /docs/imgs/csv_file_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/csv_file_example.png -------------------------------------------------------------------------------- /docs/imgs/curve_fitting_toolbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/curve_fitting_toolbox.png -------------------------------------------------------------------------------- /docs/imgs/example-input-file-workspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/example-input-file-workspace.png -------------------------------------------------------------------------------- /docs/imgs/example-spreadsheet-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/example-spreadsheet-input.png -------------------------------------------------------------------------------- /docs/imgs/firing_rates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/firing_rates.png -------------------------------------------------------------------------------- /docs/imgs/firing_rates_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/firing_rates_2.png -------------------------------------------------------------------------------- /docs/imgs/firing_rates_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/firing_rates_3.png -------------------------------------------------------------------------------- /docs/imgs/general_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/general_gui.png -------------------------------------------------------------------------------- /docs/imgs/github_repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/github_repo.png -------------------------------------------------------------------------------- /docs/imgs/global_efficiency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/global_efficiency.png -------------------------------------------------------------------------------- /docs/imgs/local_efficiency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/local_efficiency.png -------------------------------------------------------------------------------- /docs/imgs/matlab_addon_dropdown_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/matlab_addon_dropdown_menu.png -------------------------------------------------------------------------------- /docs/imgs/matlab_addon_explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/matlab_addon_explorer.png -------------------------------------------------------------------------------- /docs/imgs/matlab_home_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/matlab_home_menu.png -------------------------------------------------------------------------------- /docs/imgs/mcs_file_conversion_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/mcs_file_conversion_gui.png -------------------------------------------------------------------------------- /docs/imgs/mexmaci64_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/mexmaci64_error.png -------------------------------------------------------------------------------- /docs/imgs/nMod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/nMod.png -------------------------------------------------------------------------------- /docs/imgs/node_cartography.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/node_cartography.png -------------------------------------------------------------------------------- /docs/imgs/node_cartography_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/node_cartography_2.png -------------------------------------------------------------------------------- /docs/imgs/node_cartography_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/node_cartography_3.png -------------------------------------------------------------------------------- /docs/imgs/node_cartography_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/node_cartography_4.png -------------------------------------------------------------------------------- /docs/imgs/node_cartography_proportions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/node_cartography_proportions.png -------------------------------------------------------------------------------- /docs/imgs/num_electrodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/num_electrodes.png -------------------------------------------------------------------------------- /docs/imgs/num_electrodes_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/num_electrodes_2.png -------------------------------------------------------------------------------- /docs/imgs/parallel_computing_toolbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/parallel_computing_toolbox.png -------------------------------------------------------------------------------- /docs/imgs/pipeline-steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/pipeline-steps.png -------------------------------------------------------------------------------- /docs/imgs/plotting_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/plotting_gui.png -------------------------------------------------------------------------------- /docs/imgs/prior_analysis_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/prior_analysis_gui.png -------------------------------------------------------------------------------- /docs/imgs/probabilistic_thresholding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/probabilistic_thresholding.png -------------------------------------------------------------------------------- /docs/imgs/rawConvert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/rawConvert.png -------------------------------------------------------------------------------- /docs/imgs/run_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/run_button.png -------------------------------------------------------------------------------- /docs/imgs/save_parameters_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/save_parameters_gui.png -------------------------------------------------------------------------------- /docs/imgs/signal_processing_toolbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/signal_processing_toolbox.png -------------------------------------------------------------------------------- /docs/imgs/small_world_coeff1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/small_world_coeff1.png -------------------------------------------------------------------------------- /docs/imgs/small_world_coeff2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/small_world_coeff2.png -------------------------------------------------------------------------------- /docs/imgs/small_world_coefficient_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/small_world_coefficient_1.png -------------------------------------------------------------------------------- /docs/imgs/small_world_coefficient_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/small_world_coefficient_2.png -------------------------------------------------------------------------------- /docs/imgs/spike_detection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/spike_detection.png -------------------------------------------------------------------------------- /docs/imgs/spike_detection_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/spike_detection_gui.png -------------------------------------------------------------------------------- /docs/imgs/spike_detection_methods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/spike_detection_methods.png -------------------------------------------------------------------------------- /docs/imgs/stats_and_ML_toolbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/stats_and_ML_toolbox.png -------------------------------------------------------------------------------- /docs/imgs/template_based_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/template_based_options.png -------------------------------------------------------------------------------- /docs/imgs/template_based_options_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/template_based_options_2.png -------------------------------------------------------------------------------- /docs/imgs/threshold_based_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/threshold_based_options.png -------------------------------------------------------------------------------- /docs/imgs/threshold_based_options_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/threshold_based_options_2.png -------------------------------------------------------------------------------- /docs/imgs/v1p10p0/connectivity_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/v1p10p0/connectivity_gui.png -------------------------------------------------------------------------------- /docs/imgs/v1p10p0/general_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/v1p10p0/general_gui.png -------------------------------------------------------------------------------- /docs/imgs/v1p10p0/num_electrodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/v1p10p0/num_electrodes.png -------------------------------------------------------------------------------- /docs/imgs/v1p10p0/num_electrodes_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/v1p10p0/num_electrodes_2.png -------------------------------------------------------------------------------- /docs/imgs/v1p10p0/plotting_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/v1p10p0/plotting_gui.png -------------------------------------------------------------------------------- /docs/imgs/v1p10p0/spike_detection_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/docs/imgs/v1p10p0/spike_detection_gui.png -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.https://www.sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | ###### Requirements without Version Specifiers ###### 2 | sphinx 3 | furo 4 | sphinx-hoverxref 5 | -------------------------------------------------------------------------------- /mea-nap-logo-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/mea-nap-logo-transparent.png -------------------------------------------------------------------------------- /pipelineReadCSV.m: -------------------------------------------------------------------------------- 1 | function csv_data = pipelineReadCSV(spreadsheet_filename, csvRange) 2 | %PIPELINEREADCSV Summary of this function goes here 3 | % Detailed explanation goes here 4 | opts = detectImportOptions(spreadsheet_filename); 5 | opts.Delimiter = ','; 6 | opts.VariableNamesLine = 1; 7 | 8 | if length(opts.VariableTypes) < 3 9 | csv_data = 0; 10 | else 11 | opts.VariableTypes{1} = 'char'; % this should be the recoding file name 12 | opts.VariableTypes{2} = 'double'; % this should be the DIV 13 | opts.VariableTypes{3} = 'char'; % this should be Group 14 | if length(opts.VariableNames) > 3 15 | opts.VariableTypes{4} = 'char'; % this should be Ground 16 | end 17 | opts.DataLines = csvRange; % read the data in the range [StartRow EndRow] 18 | % csv_data = readtable(spreadsheet_filename, 'Delimiter','comma'); 19 | csv_data = readtable(spreadsheet_filename, opts); 20 | end 21 | 22 | end 23 | 24 | -------------------------------------------------------------------------------- /sand_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/sand_logo.jpg -------------------------------------------------------------------------------- /sensitivityAnalysis/WattsStrogatz.m: -------------------------------------------------------------------------------- 1 | % Copyright 2015 The MathWorks, Inc. 2 | 3 | function h = WattsStrogatz(N,K,beta) 4 | % H = WattsStrogatz(N,K,beta) returns a Watts-Strogatz model graph with N 5 | % nodes, N*K edges, mean node degree 2*K, and rewiring probability beta. 6 | % 7 | % beta = 0 is a ring lattice, and beta = 1 is a random graph. 8 | 9 | % Connect each node to its K next and previous neighbors. This constructs 10 | % indices for a ring lattice. 11 | s = repelem((1:N)',1,K); 12 | t = s + repmat(1:K,N,1); 13 | t = mod(t-1,N)+1; 14 | 15 | % Rewire the target node of each edge with probability beta 16 | for source=1:N 17 | switchEdge = rand(K, 1) < beta; 18 | 19 | newTargets = rand(N, 1); 20 | newTargets(source) = 0; 21 | newTargets(s(t==source)) = 0; 22 | newTargets(t(source, ~switchEdge)) = 0; 23 | 24 | [~, ind] = sort(newTargets, 'descend'); 25 | t(source, switchEdge) = ind(1:nnz(switchEdge)); 26 | end 27 | 28 | h = graph(s,t); 29 | end 30 | -------------------------------------------------------------------------------- /sensitivityAnalysis/genRandNetwork.m: -------------------------------------------------------------------------------- 1 | function G = genRandNetwork(numNodes, p, mew) 2 | % Generates a random network 3 | % Parameters 4 | % ---------- 5 | % numNodes : int 6 | % number of nodes to include in the network 7 | % p : float 8 | % connection probability 9 | % mew : float 10 | % mean edge weight, if not specified, then sample 11 | % weight from a uniform distribution 12 | 13 | G = rand(numNodes,numNodes) < p; 14 | G = triu(G,1); 15 | % Make the graph symmetric 16 | G = G + G'; 17 | % sample weights from a distribution and assign them to 18 | numEdges = sum(sum(G == 1)); 19 | 20 | if exist('mew', 'var') 21 | sigma = 0.1; 22 | edgeWeights = normrnd(mew,sigma, numEdges, 1); 23 | edgeWeights(edgeWeights > 1) = 1; 24 | edgeWeights(edgeWeights < 0) = 0; 25 | else 26 | edgeWeights = rand(numEdges, 1); 27 | end 28 | 29 | 30 | 31 | G(G == 1) = edgeWeights; 32 | G = (G + G') / 2; 33 | % remove diagonal elements 34 | G(logical(eye(size(G)))) = 0; 35 | end -------------------------------------------------------------------------------- /sensitivityAnalysis/genRandSmallWorldNetwork.m: -------------------------------------------------------------------------------- 1 | function adjM = genRandSmallWorldNetwork(numNodes, K_edge, beta) 2 | 3 | G = WattsStrogatz(numNodes, K_edge, beta); % generates symmetric (undirected) small-world network 4 | adjM = full(adjacency(G)); 5 | numEdges = sum(sum(adjM == 1)); 6 | edgeWeights = rand(numEdges/2, 1); 7 | adjM_U = triu(adjM); 8 | adjM_U(adjM_U == 1) = edgeWeights; 9 | adjM = (adjM_U + adjM_U')/2; 10 | % remove diagonal elements 11 | adjM(logical(eye(size(adjM)))) = 0; 12 | 13 | end -------------------------------------------------------------------------------- /sensitivityAnalysis/meanEdgeWeightSampleNetworks.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/sensitivityAnalysis/meanEdgeWeightSampleNetworks.mat -------------------------------------------------------------------------------- /sensitivityAnalysis/meanEdgeWeightSensitivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/sensitivityAnalysis/meanEdgeWeightSensitivity.png -------------------------------------------------------------------------------- /sensitivityAnalysis/nModulesSampleNetworks.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/sensitivityAnalysis/nModulesSampleNetworks.mat -------------------------------------------------------------------------------- /sensitivityAnalysis/networkDensitySampleNetworks.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/sensitivityAnalysis/networkDensitySampleNetworks.mat -------------------------------------------------------------------------------- /sensitivityAnalysis/networkDensitySensitivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/sensitivityAnalysis/networkDensitySensitivity.png -------------------------------------------------------------------------------- /sensitivityAnalysis/numModulesSensitivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/sensitivityAnalysis/numModulesSensitivity.png -------------------------------------------------------------------------------- /sensitivityAnalysis/rewireNetwork.asv: -------------------------------------------------------------------------------- 1 | function G_rewired = rewireNetwork(G, p) 2 | %REWIRENETWORK Summary of this function goes here 3 | % G : network adjacency matrix 4 | % p : re-wiring probability 5 | 6 | % select edges to replace 7 | numNodes = size(G, 1); 8 | edgePairs = nchoosek(1:numNodes, 2); 9 | edgePairIdx = 1:length(edgePairs); 10 | edgePairIdxRandomised = edgePairIdx(randperm(edgePairIdx)); 11 | 12 | numEdgePairsToReplace = round(length(edgePairs) * p); 13 | 14 | edgePairIdxToReplace = edgePairIdxRandomised(1:numEdgePairsToReplace); 15 | 16 | % uniform [0, 1] distribution of edge weights 17 | edgePairReplacementValues = rand(numEdgePairsToReplace, 1); 18 | 19 | G_random = G; 20 | 21 | for edgeIdx = edgePairIdxToReplace 22 | edgeCounter = 1; 23 | node1 = edgePairs(edgeIdx, 1); 24 | node2 = edgePairs(edgeIdx, 2); 25 | 26 | G_random(node1, node2) = edgePairReplacementValues(edgeCounter); 27 | G_random(node2, node1) = edgePairReplacementValues(edgeCounter); 28 | 29 | edgeCounter = edgeCounter+1; 30 | end 31 | 32 | 33 | end 34 | 35 | -------------------------------------------------------------------------------- /sensitivityAnalysis/rewireNetwork.m: -------------------------------------------------------------------------------- 1 | function G_rewired = rewireNetwork(G, p) 2 | %REWIRENETWORK Summary of this function goes here 3 | % G : network adjacency matrix 4 | % p : re-wiring probability 5 | 6 | % select edges to replace 7 | numNodes = size(G, 1); 8 | edgePairs = nchoosek(1:numNodes, 2); 9 | edgePairIdx = 1:length(edgePairs); 10 | edgePairIdxRandomised = edgePairIdx(randperm(length(edgePairIdx))); 11 | 12 | numEdgePairsToReplace = round(length(edgePairs) * p); 13 | 14 | edgePairIdxToReplace = edgePairIdxRandomised(1:numEdgePairsToReplace); 15 | 16 | % uniform [0, 1] distribution of edge weights 17 | edgePairReplacementValues = rand(numEdgePairsToReplace, 1); 18 | 19 | G_rewired = G; 20 | 21 | %{ 22 | node1vec = edgePairs(edgePairIdxToReplace, 1); 23 | node2vec = edgePairs(edgePairIdxToReplace, 2); 24 | G_rewired(node1vec, node2vec) = edgePairReplacementValues; 25 | G_rewired(node2vec, node1vec) = edgePairReplacementValues; 26 | %} 27 | % 28 | for edgeIdx = edgePairIdxToReplace 29 | edgeCounter = 1; 30 | node1 = edgePairs(edgeIdx, 1); 31 | node2 = edgePairs(edgeIdx, 2); 32 | 33 | G_rewired(node1, node2) = edgePairReplacementValues(edgeCounter); 34 | G_rewired(node2, node1) = edgePairReplacementValues(edgeCounter); 35 | 36 | edgeCounter = edgeCounter+1; 37 | end 38 | % 39 | 40 | 41 | end 42 | 43 | -------------------------------------------------------------------------------- /sensitivityAnalysis/smallWorldOmegaSampleNetworks.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/sensitivityAnalysis/smallWorldOmegaSampleNetworks.mat -------------------------------------------------------------------------------- /sensitivityAnalysis/smallWorldOmegaSensitivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/sensitivityAnalysis/smallWorldOmegaSensitivity.png -------------------------------------------------------------------------------- /sensitivityAnalysis/top10meanPCSampleNetworks.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/sensitivityAnalysis/top10meanPCSampleNetworks.mat -------------------------------------------------------------------------------- /sensitivityAnalysis/top10meanPCSensitivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/sensitivityAnalysis/top10meanPCSensitivity.png -------------------------------------------------------------------------------- /stimDetectionApp.mlapp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAND-Lab/MEA-NAP/02d2b4b5bffb20b5c6c653ca4946cb2c71a6f039/stimDetectionApp.mlapp -------------------------------------------------------------------------------- /version.txt: -------------------------------------------------------------------------------- 1 | 1.10.2 2 | --------------------------------------------------------------------------------