plateform
stringclasses
1 value
repo_name
stringlengths
13
113
name
stringlengths
3
74
ext
stringclasses
1 value
path
stringlengths
12
229
size
int64
23
843k
source_encoding
stringclasses
9 values
md5
stringlengths
32
32
text
stringlengths
23
843k
github
xyza11808/MATLAB-master
sagittalSlices.m
.m
MATLAB-master/allenCCF-master/Browsing Functions/sagittalSlices.m
1,105
utf_8
5be36b230a9720ed29249e9ac3687ca4
function [f,h, whichSlice] = sagittalSlices(tv, ccfCoords, f) if nargin<3 f = figure; p = get(f, 'Position'); set(f, 'Position', [p(1) p(2) 1597 700]); set(f, 'Color', 'k'); slicesExist = false; else slicesExist = true; end slicePoints = 0.25:0.25:3.0; %mm bregma = allenCCFbre...
github
xyza11808/MATLAB-master
AtlasTransformBrowser.m
.m
MATLAB-master/allenCCF-master/Browsing Functions/AtlasTransformBrowser.m
53,464
utf_8
f8ecdec397a9435aa47ac603a9b67c6d
function f = allenAtlasBrowser(f, templateVolume, annotationVolume, structureTree, slice_figure, save_location, save_suffix, plane) % ------------------------------------------------ % Browser for the allen atlas ccf data in matlab. % ------------------------------------------------ % % Inputs templateVolume, annotatio...
github
xyza11808/MATLAB-master
HistologyCropper.m
.m
MATLAB-master/allenCCF-master/Histology Functions/HistologyCropper.m
4,439
utf_8
c35653c00fba7ed8c64d59b68b2ba4b3
function HistologyCropper(histology_figure, save_folder, image_file_names, reference_size, save_file_name, use_already_downsampled_image) % set up histology figure ud_histology.file_num = 1; ud_histology.num_files = length(image_file_names); ud_histology.slice_num = ones(length(image_file_names),1); ud_histology.save_...
github
xyza11808/MATLAB-master
SliceFlipper.m
.m
MATLAB-master/allenCCF-master/Histology Functions/SliceFlipper.m
7,857
utf_8
52cdeaba9791844aa003a698e16d6dac
function SliceFlipper(slice_figure, folder_processed_images, reference_size) % crop, sharpen, and flip slice images processed_images = dir([folder_processed_images filesep '*tif']); ud.processed_image_names = natsortfiles({processed_images.name}); ud.total_num_files = size(processed_images,1); disp(['found ' num2str(u...
github
xyza11808/MATLAB-master
HistologyBrowser.m
.m
MATLAB-master/allenCCF-master/Histology Functions/HistologyBrowser.m
6,443
utf_8
a32b38d3dc2e73f79df5e7be800b38aa
function HistologyBrowser(histology_figure, save_folder, image_folder, image_file_names, folder_processed_images, image_file_are_individual_slices, ... use_already_downsampled_image, microns_per_pixel, microns_per_pixel_after_downsampling, gain) % display image and set up user controls for contrast cha...
github
xyza11808/MATLAB-master
applyCARtoDat.m
.m
MATLAB-master/spikes-master/preprocessing/applyCARtoDat.m
1,860
utf_8
3bd79728bd4d3de571f8efe113750fc4
function medianTrace = applyCARtoDat(filename, nChansTotal, outputDir) % Subtracts median of each channel, then subtracts median of each time % point. % % filename should include the extension % outputDir is optional, by default will write to the directory of the input file % % should make chunk size as big as poss...
github
xyza11808/MATLAB-master
extractMedianWFs.m
.m
MATLAB-master/spikes-master/preprocessing/extractMedianWFs.m
1,766
utf_8
0e7943bc3113db2f00eb8f7476492a71
function medWFs = extractMedianWFs(clu, st, Fs, datPath, dataType, dataSize, chanMap, gain) % medWFs = extractMedianWFs(clu, st, cids, cgs, Fs, datPath, dataType, dataSize, chanMap, gain) % % - medWFs [nClusters, nChannels, nSamples] will be median waveforms of % every cluster represented in clu % -- note: if you...
github
xyza11808/MATLAB-master
applyCorrection.m
.m
MATLAB-master/spikes-master/preprocessing/applyCorrection.m
253
utf_8
2b83703b2c329ba39402319ea6f08e40
function outData = applyCorrection(inData, b) % function outData = applyCorrection(inData, b) % % align a timeseries according to correction factors ("b") made with % companion function "makeCorrection" outData = [inData(:) ones(size(inData(:)))]*b;
github
xyza11808/MATLAB-master
xml2struct.m
.m
MATLAB-master/spikes-master/preprocessing/xml2struct.m
6,773
utf_8
0194599f7bac6b67c42391f372b5ff91
function [ s ] = xml2struct( file ) %Convert xml file into a MATLAB structure % [ s ] = xml2struct( file ) % % A file containing: % <XMLname attrib1="Some value"> % <Element>Some text</Element> % <DifferentElement attrib2="2">Some more text</Element> % <DifferentElement attrib3="2" attrib4="1">Even more text</Dif...
github
xyza11808/MATLAB-master
extractSyncChannel.m
.m
MATLAB-master/spikes-master/preprocessing/extractSyncChannel.m
346
utf_8
b1cbecfb5fffe117a1537a0762c38bbe
function syncDat = extractSyncChannel(folder, numChans, syncChanIndex) % extraChanIndices are 1-indexed dataFiles = dir(fullfile(folder,'*.lf.bin')); for d = 1:length(dataFiles) filename = fullfile(folder, dataFiles(d).name); syncDat = extractSyncChannelFromFile(filename, numChans, syncChanIndex); ...
github
xyza11808/MATLAB-master
spikeGLXdigitalParse.m
.m
MATLAB-master/spikes-master/preprocessing/spikeGLXdigitalParse.m
1,326
utf_8
fb7a98c4253a58e883878e44211c3cb9
function eventTimes = spikeGLXdigitalParse(digitalChannel, Fs) % function eventTimes = spikeGLXdigitalParse(digitalChannel, Fs) % % returns the event times of all 16 digital inputs recorded by SpikeGLX % They are returned in a length=16 cell array. Each cell has three cells, % which contain the times of all events (so...
github
xyza11808/MATLAB-master
readSpikeGLXmeta.m
.m
MATLAB-master/spikes-master/preprocessing/readSpikeGLXmeta.m
2,586
utf_8
948def0d1296138f402899f709a5ec26
function S = readSpikeGLXmeta(vcFname) % function S = readSpikeGLXmeta(vcFname) % % returns a struct containing the contents of a SpikeGLX-generated .meta % file. % % From James Jun, 2016-12-31 S = []; viRef_imec3 = [37 76 113 152 189 228 265 304 341 380]; % Read file if nargin < 1 [FileName,PathName,FilterInde...
github
xyza11808/MATLAB-master
loadSync.m
.m
MATLAB-master/spikes-master/preprocessing/loadSync.m
1,996
utf_8
61ccc3b5af32b6e5d6a3fb3685655462
function [syncData, detectedFlips, eventTimes] = loadSync(mouseName, thisDate, tag) %function syncData = loadSync(mouseName, thisDate, tag) % % load the sync channel data from a phase3 probe recorded with spikeglx % rootE = dat.expPath(mouseName, thisDate, 1, 'main', 'master'); % root = fileparts(rootE); root = getR...
github
xyza11808/MATLAB-master
extractSyncChannelFromFile.m
.m
MATLAB-master/spikes-master/preprocessing/extractSyncChannelFromFile.m
1,052
utf_8
c8588810ad7c986c0fe782055fde3a79
function syncDat = extractSyncChannelFromFile(filename, numChans, syncChanIndex) % extraChanIndices are 1-indexed maxReadSize = 1e9; d = dir(filename); [folder,fn] = fileparts(filename); syncFname = fullfile(folder, [fn '_sync.dat']); fidOut = fopen(syncFname, 'w'); fprintf(1,' loading %s\n', filename); fid = f...
github
xyza11808/MATLAB-master
makeCorrection.m
.m
MATLAB-master/spikes-master/preprocessing/makeCorrection.m
1,536
utf_8
b35a195ab14568c7267b5db883afd15e
function [corrFun, b] = makeCorrection(correctTo, correctFrom, makePlots) % function [corrFun, b] = makeCorrection(correctTo, correctFrom, makePlots) % % make a function that linearly predicts correctTo from correctFrom, both vectors of same % length % - now can attempt to fit for cases with vectors of different lengt...
github
xyza11808/MATLAB-master
totalMinDiffs.m
.m
MATLAB-master/spikes-master/preprocessing/helpers/totalMinDiffs.m
334
utf_8
e65d70ab3e6063dadd1a19310d7440b8
function t = totalMinDiffs(b, predictTo, predictFrom) myPred = [predictFrom(:) ones(size(predictFrom(:)))]*b; md = findMinDiffs(myPred, predictTo).^2; % throw away the worst N where N is the number of excess elements in the % longer vector mds = sort(md); md = mds(1:min(length(predictTo), length(predictFrom))); ...
github
xyza11808/MATLAB-master
findMinDiffs.m
.m
MATLAB-master/spikes-master/preprocessing/helpers/findMinDiffs.m
751
utf_8
a6ad33605c6399bc369bb3c5af61cab4
function d = findMinDiffs(A, B) %function d = findMinDiffs(A, B) % from https://uk.mathworks.com/matlabcentral/answers/79466-find-minimum-difference-between-matrices % % finds the entry in B which is closest to each entry in A and return the % distance B = sort(B(:)); %make B vector and sort for binning conveni...
github
xyza11808/MATLAB-master
splitGLXBinFile.m
.m
MATLAB-master/spikes-master/preprocessing/imecPhase3/splitGLXBinFile.m
1,455
utf_8
ce7da65be94517debf654deff7a55a78
function splitGLXBinFile(filename, nChansTotal, subNames, subRanges, downsampleFactors, varargin) % for opt4: % splitGLXBinFile(filename,553,{'AP', 'LFP', 'sync'}, {1:276,277:552,553}, [1 10 10]) % for opt1,2,3: % splitGLXBinFile(filename,769,{'AP', 'LFP', 'sync'}, {1:384,385:768,769}, [1 10 10]) % % Exclude the '.b...
github
xyza11808/MATLAB-master
makeForPRBimecP3.m
.m
MATLAB-master/spikes-master/preprocessing/imecPhase3/makeForPRBimecP3.m
569
utf_8
d9d6de23b6bad7329af6fbd31df22d67
function [chanMap, chanMap0ind, xcoords, ycoords, connected, shankInd] = makeForPRBimecP3(opt) if opt==4 nCh = 276; refList = [37 76 113 152 189 228 265]; else nCh = 384; refList = [37 76 113 152 189 228 265 304 341 380]; end chanMap = (1:nCh)'; chanMap0ind = chanMap-1; connected = true(size(chanMap...
github
xyza11808/MATLAB-master
extractSyncChan.m
.m
MATLAB-master/spikes-master/preprocessing/imecPhase3/extractSyncChan.m
593
utf_8
acb8c6255a7063d0f9d09764a40bbcfe
function syncData = extractSyncChan(lfpFilename) % syncData = function extractSyncChan(lfpFilename) % % extracts the synchronization channel from a neuropixels phase3 data file % assumes it is channel 385 out of 385, and that data type is int16 [path, fname, ext] = fileparts(lfpFilename); syncOut = fullfile(path, [f...
github
xyza11808/MATLAB-master
writeToParamsPy.m
.m
MATLAB-master/spikes-master/preprocessing/phyHelpers/writeToParamsPy.m
559
utf_8
5bc988a593d63fdc1411fb855db1cef9
function writeToParamsPy(filename, fieldName, value) % function writeToParamsPy(filename, fieldName, value) % write a row in a params.py file. Will append to the end. if isstr(value) value = ['''' value '''']; % add a single quote on both sides elseif value==true value = 'True'; elseif value==false; valu...
github
xyza11808/MATLAB-master
sparsePCs.m
.m
MATLAB-master/spikes-master/preprocessing/phyHelpers/sparsePCs.m
1,690
utf_8
5ad65067d07103fc2d362c6ae735f113
function S = sparsePCs(pcFeat,pcFeatInd, spikeTemplates, varargin) %function S = sparsePCs(pdFeat,pcFeatInd, spikeTemplates[, nPCsPerChan, nPCchans]) % make a sparse matrix version of the pc features % - nPCsPerChan is the number of PCs per channel to keep, usually 3 (but use % fewer for memory reasons) % - nPCchans ...
github
xyza11808/MATLAB-master
addGainToParamsPy.m
.m
MATLAB-master/spikes-master/preprocessing/phyHelpers/addGainToParamsPy.m
903
utf_8
ddbaea31afad77fdf2ea8689df9d40d3
function addGainToParamsPy(ksDir, rawDir) paramsFn = fullfile(ksDir, 'params.py'); p = loadParamsPy(paramsFn); if ~isfield(p, 'gain') [~, rawFn] = fileparts(p.dat_path); if strcmp(rawFn(end-3:end), '_CAR') metaFn = [rawFn(1:end-4) '.meta']; else metaFn = [rawFn '.meta']; end metaPa...
github
xyza11808/MATLAB-master
loadAllKsDir.m
.m
MATLAB-master/spikes-master/preprocessing/phyHelpers/loadAllKsDir.m
1,598
utf_8
122176e5c8447ff1fd4fb82652fa5583
function sp = loadAllKsDir(mouseName, thisDate) % function sp = loadAllKsDir(mouseName, thisDate) % load all the spikes from a day into one struct, aligning them to each % other root = getRootDir(mouseName, thisDate); alignDir = fullfile(root, 'alignments'); [tags, hasEphys] = getEphysTags(mouseName, thisDate); ...
github
xyza11808/MATLAB-master
writeBordersCSV.m
.m
MATLAB-master/spikes-master/preprocessing/phyHelpers/writeBordersCSV.m
261
utf_8
29e8e99ca826cbd9d23cab021f4194bd
function writeBordersCSV(borders, fn) fid = fopen(fn, 'w'); fprintf(fid, 'area\tlowerBorder\tupperBorder\r\n'); fn = fields(borders); for f = 1:length(fn) fprintf(fid, '%s\t%d\t%d\r\n', fn{f}, borders.(fn{f})(1), borders.(fn{f})(2)); end fclose(fid);
github
xyza11808/MATLAB-master
loadParamsPy.m
.m
MATLAB-master/spikes-master/preprocessing/phyHelpers/loadParamsPy.m
1,511
utf_8
9cea31b53624c87a878a46868135dea0
function S = loadParamsPy(fn) % Loads a phy-style "params.py" into a matlab struct. The params.py is % python code but just a series of assignments, so most of it will run % directly in matlab % % now based on text2struct from James Jun, 2016-12-31, modified slightly by % N. Steinmetz. fid = fopen(fn, 'r'); mcFileM...
github
xyza11808/MATLAB-master
readClusterGroupsCSV.m
.m
MATLAB-master/spikes-master/preprocessing/phyHelpers/readClusterGroupsCSV.m
668
utf_8
ef027ef1778d6a73b430333d65109f5d
function [cids, cgs] = readClusterGroupsCSV(filename) %function [cids, cgs] = readClusterGroupsCSV(filename) % cids is length nClusters, the cluster ID numbers % cgs is length nClusters, the "cluster group": % - 0 = noise % - 1 = mua % - 2 = good % - 3 = unsorted fid = fopen(filename); C = textscan(fid, '%s%s'); fcl...
github
xyza11808/MATLAB-master
getMetaFname.m
.m
MATLAB-master/spikes-master/preprocessing/phyHelpers/getMetaFname.m
590
utf_8
f74190b5e26efa07ca861d4381dc37ac
function fn = getMetaFname(ksDir, rawDir, type) % function fn = getMetaFname(ksDir, rawDir, type) % % type is either 'LFP', or 'AP' % expects that params.py is in ksDir, and paramsFn = fullfile(ksDir, 'params.py'); p = loadParamsPy(paramsFn); [~, rawFn] = fileparts(p.dat_path); if strcmp(rawFn(end-3:end), '_CAR') ...
github
xyza11808/MATLAB-master
sparsePCsTopPC.m
.m
MATLAB-master/spikes-master/preprocessing/phyHelpers/sparsePCsTopPC.m
650
utf_8
48b00c06cf299af62fcdc5bcd608d050
function S = sparsePCsTopPC(pcFeat,pcFeatInd, spikeTemplates) %function S = sparsePCs(pdFeat,pcFeatInd) % make a sparse matrix version of the pc features % for the moment, only the top PC nPCchans = size(pcFeat,3); nSpikes = size(pcFeat,1); nTemplates = size(pcFeatInd,1); nChannels = double(max(pcFeatInd(:))+1); th...
github
xyza11808/MATLAB-master
loadKSdir.m
.m
MATLAB-master/spikes-master/preprocessing/phyHelpers/loadKSdir.m
2,608
utf_8
23dd1b40a75ce6dd5b14862b8c30e9e4
function spikeStruct = loadKSdir(ksDir, varargin) if ~isempty(varargin) params = varargin{1}; else params = []; end if ~isfield(params, 'excludeNoise') params.excludeNoise = true; end if ~isfield(params, 'loadPCs') params.loadPCs = false; end % load spike data spikeStruct = loadParamsPy(fullfile(k...
github
xyza11808/MATLAB-master
writePhyTSV.m
.m
MATLAB-master/spikes-master/preprocessing/phyHelpers/writePhyTSV.m
1,001
utf_8
9c872b07c51de72a79ccc1cc68fab0a1
function writePhyTSV(ksDir, labelName, cids, vals) % function writePhyTSV(ksDir, labelName, cids, vals) % Writes a .tsv file that phy can read to apply a new sortable column in cluster % view. E.g. calculate the amplitude of every template and use this to % write a .tsv file that will allow you to sort by that amplit...
github
xyza11808/MATLAB-master
sparseNoiseRF.m
.m
MATLAB-master/spikes-master/analysis/sparseNoiseRF.m
6,174
utf_8
d45e3bcb027ab378b5574e6c88e3c682
function [rfMap, stats, allPSTH, spikeCounts] = sparseNoiseRF(spikeTimes, stimTimes, stimPositions, params) % function [rfmap, stats] = sparseNoiseRF(spikeTimes, stimTimes, stimPositions, params) % % Assumes that stimPositions describe a rectangle and are evenly spaced. % % - spikeTimes is nSpikes x 1 % - stimTimes i...
github
xyza11808/MATLAB-master
rocArea.m
.m
MATLAB-master/spikes-master/analysis/rocArea.m
1,211
utf_8
55f2ffb2d6bd6cb600003e8d24b88566
function [rocOut, tpr, fpr] = rocArea(values1, values2) % function [rocOut, tpr, fpr] = rocArea(values1, values2) % % "values2" should have the larger mean, if you want it to return a value % greater than 0.5. if isempty(values1) && isempty(values2) rocOut = NaN; tpr = []; fpr = []; return; end % ...
github
xyza11808/MATLAB-master
psthAndBA.m
.m
MATLAB-master/spikes-master/analysis/psthAndBA.m
1,502
utf_8
098ce93397e7b11a160c6018f1bbf6fc
function [psth, bins, rasterX, rasterY, spikeCounts, binnedArray] = psthAndBA(spikeTimes, eventTimes, window, psthBinSize) % function [psth, bins, rasterX, rasterY, spikeCounts, binnedArray] = psthAndBA(spikeTimes, eventTimes, window, psthBinSize) % % Fast computation of psth and spike counts in a window relative to ...
github
xyza11808/MATLAB-master
ksDriftmap.m
.m
MATLAB-master/spikes-master/analysis/ksDriftmap.m
4,051
utf_8
54363ded01dc21757bd173bd6da59216
% Inputs/outputs: mostly self explanatory % localizedSpikesOnly (false by default) - if true, only spikes with no discrepancy between depth and site are returned. function [spikeTimes, spikeAmps, spikeDepths, spikeSites] = ksDriftmap(ksDir, localizedSpikesOnly) if nargin < 2 localizedSpikesOnly = false; end clear...
github
xyza11808/MATLAB-master
templatePositionsAmplitudes.m
.m
MATLAB-master/spikes-master/analysis/templatePositionsAmplitudes.m
3,474
utf_8
27d6732c4874d96669721bdf6f4e7574
function [spikeUnscaledAmps, spikeDepths, templateDepths, tempAmps, tempsUnW, templateDuration, waveforms] = templatePositionsAmplitudes(temps, winv, ycoords, spikeTemplates, tempScalingAmps) % function [spikeAmps, spikeDepths, templateDepths, tempAmps, tempsUnW, templateDuration, waveforms] = templatePositionsAmplitu...
github
xyza11808/MATLAB-master
computeSpikeWidths.m
.m
MATLAB-master/spikes-master/analysis/computeSpikeWidths.m
1,034
utf_8
0593c1a293fded49b4fa7a59caa3801d
function [spikeWidths, tempWidths, clusterWidths] = computeSpikeWidths(tempsUnW, spikeTemplates, varargin) % function [spikeWidths, tempWidths, clusterWidths] = computeSpikeWidths(tempsUnW, spikeTemplates[, clu]) % Computes spike widths in samples, according to widths of each template % If you pass clu, will also com...
github
xyza11808/MATLAB-master
makeAllBA.m
.m
MATLAB-master/spikes-master/analysis/makeAllBA.m
2,320
utf_8
9cf003966c347d57bc0edccbbc1b10fa
function [allba, bins] = makeAllBA(st, clu, eventTimes, binSize, win) binBorders = win(1):binSize:win(2); numBins = length(binBorders)-1; bins = binBorders(1:end-1)+binSize/2; % now using histdiffMulti. clu = clu-min(clu)+1; % make sure they are all positive cIDs = unique(clu); nC = numel(cIDs); clu = clu(st>min(...
github
xyza11808/MATLAB-master
slidingChoiceProbability.m
.m
MATLAB-master/spikes-master/analysis/slidingChoiceProbability.m
1,512
utf_8
bf87fd0d7450b09595f5edaf705c4918
function [cp, t, rs] = slidingChoiceProbability(ba, baBinSize, cpBinSize, trLabels) % function [cp, t, rs] = slidingChoiceProbability(ba, baBinSize, cpBinSize, trLabels) % Choice probability (i.e. area under ROC curve between spike counts in a % bin) using a sliding window. Input argument "ba" is a "binnedArray" from...
github
xyza11808/MATLAB-master
myACG.m
.m
MATLAB-master/spikes-master/analysis/myACG.m
2,472
utf_8
a4f981a2020b2efadda994bb43b43503
function [xLin, nLin, xLog, nLog] = myACG(st, axLin, axLog) % function [xLin, nLin, xLog, nLog] = myACG(st, axLin, axLog) % % Computes an autocorrelogram with both linear and log bins % % axLin and axLog are optional but if provided will produce a plot in each binSize = 0.0005; b = 0.0001:binSize:1; % start at a te...
github
xyza11808/MATLAB-master
timestampsToBinned.m
.m
MATLAB-master/spikes-master/analysis/timestampsToBinned.m
967
utf_8
5c2ac0a6185b9f402f9c1fc855e223fe
function [binArray, binCenters] = timestampsToBinned(timeStamps, referencePoints, binSize, window) % [binArray, binCenters] = timestampsToBinned(timeStamps, referencePoints, binSize, % window) % % Returns an array of binned spike counts. If you use a large enough % binSize, it may well be possible that there is more...
github
xyza11808/MATLAB-master
trueSpikeSNR.m
.m
MATLAB-master/spikes-master/analysis/trueSpikeSNR.m
3,546
utf_8
f63c1d91084de7ab6f62f280d1fd3313
function snr = trueSpikeSNR(datPars, spikeTimes) % todo: % - dim reduce then reconstruct the waveform with some svd, to avoid % getting a false boost from overfitting best would be cross-validating % (i.e. for each spike use only the mean determined from the other % spikes). Could do this by subtracting the spike o...
github
xyza11808/MATLAB-master
psthByDepth.m
.m
MATLAB-master/spikes-master/analysis/psthByDepth.m
1,519
utf_8
72aaaae1e8dd9072c6955a646bd2b878
function [timeBins, depthBins, allP, normVals] = psthByDepth(spikeTimes, spikeDepths, depthBinSize, timeBinSize, eventTimes, win, bslWin, varargin) % function [timeBins, depthBins, allP] = psthByDepth(spikeTimes, ... % spikeDepths, depthBinSize, timeBinSize, eventTimes, win, bslWin[, bslEvents]) % % Computes PSTH s...
github
xyza11808/MATLAB-master
computeRawRMS.m
.m
MATLAB-master/spikes-master/analysis/computeRawRMS.m
1,112
utf_8
677e4c505c9b60a5fbd8c5c3f8c45195
function [rmsPerChannel, madPerChannel] = computeRawRMS(ksDir, gainFactor, rawDir) % function [rmsPerChannel, madPerChannel] = computeRawRMS(ksDir, gain[, rawDir]) % % for spikeglx: gainFactor = 0.6/512/gainSetting*1e6; % % ksDir is directory of kilosort results % gainFactor will multiply the raw data % rawDir is l...
github
xyza11808/MATLAB-master
lfpBandPower.m
.m
MATLAB-master/spikes-master/analysis/lfpBandPower.m
1,796
utf_8
d420ca92c9414f6fa8465c84f41bce30
function [lfpByChannel, allPowerEst, F, allPowerVar] = lfpBandPower(lfpFilename, lfpFs, nChansInFile, freqBand) % function [lfpByChannel, allPowerEst, F] = lfpBandPower(lfpFilename, lfpFs, nChansInFile, freqBand) % Computes the power in particular bands, and across all frequencies, across the recording % samples 10 s...
github
xyza11808/MATLAB-master
eventLockedAvg.m
.m
MATLAB-master/spikes-master/analysis/eventLockedAvg.m
2,450
utf_8
56190afe22e31c1a8e8ea7d44057d4bd
function [avgPeriEventV, winSamps, periEventV, sortedLabels] = eventLockedAvg(V, t, eventTimes, eventLabels, calcWin) % function [avgPeriEventV, periEventV] = eventLockedAvg(V, t, eventTimes, eventLabels, calcWin) % % Inputs: % - V: nTraces x nTimePoints % - t: 1 x nTimePoints, the time points of each sample in V % -...
github
xyza11808/MATLAB-master
clusterAverage.m
.m
MATLAB-master/spikes-master/analysis/clusterAverage.m
926
utf_8
70028b183792bf538953450a17460200
function clusterQuantity = clusterAverage(clu, spikeQuantity) % function clusterQuantity = clusterAverage(clu, spikeQuantity) % % get the average of some quantity across spikes in each cluster, given the % quantity for each spike % % e.g. % > clusterDepths = clusterAverage(clu, spikeDepths); % % clu and spikeQuantit...
github
xyza11808/MATLAB-master
readDat.m
.m
MATLAB-master/spikes-master/analysis/readDat.m
650
utf_8
aa98bab7a806b0490908a0ab44907cb5
function dat = readDat(filename, numChans, varargin) % takes the same amount of time to read through for just one channel, but % you don't run into memory problems that way if the file is too big. requestedChan = []; if ~isempty(varargin) requestedChan = varargin{1}; end fid = fopen(filename); if isempty(requ...
github
xyza11808/MATLAB-master
spikeTrigLFP.m
.m
MATLAB-master/spikes-master/analysis/spikeTrigLFP.m
1,365
utf_8
5637d904b608166154eb4300295bcc36
function mnLFP = spikeTrigLFP(tLFP, lfpdat, theseST, winAroundSpike) % function mnLFP = spikeTrigLFP(tLFP, lfpdat, theseST, winAroundSpike) % % returns nChannels x nTimePoints mean spike-triggered LFP. % % Inputs: % - tLFP - 1 x nLFP - vector of time points at which the lfp was sampled % (s) % - lfpdat - nChannels x...
github
xyza11808/MATLAB-master
kilosortPredictData.m
.m
MATLAB-master/spikes-master/analysis/kilosortPredictData.m
3,343
utf_8
473c3f39bf0267cfba72f7c83be9ff83
function predData = kilosortPredictData(predictSamps, temps, spikeTimes, ... spikeTemplates, spikeAmps, invWhiteMat) % function predData = kilosortPredictData(predictSamps, temps, spikeTimes, ... % spikeTemplates, spikeAmps, invWhiteMat) % % Given kilosort output, determine what kilosort thought the raw data ...
github
xyza11808/MATLAB-master
replaceMissingSitesP3.m
.m
MATLAB-master/spikes-master/analysis/replaceMissingSitesP3.m
772
utf_8
12f8f37e0b6bd3909ff6b0a691747809
function [newData, newXC, newYC] = replaceMissingSitesP3(data, xc, yc) sigma = 20; data = data(:); missingXC = repmat([43 27]', 5, 1); missingYC = [1:10]'*380; missingData = zeros(size(missingXC)); for m = 1:length(missingXC) x = missingXC(m); y = missingYC(m); dists = sqrt((x-xc).^2+(y-yc).^2)...
github
xyza11808/MATLAB-master
findTempForEachClu.m
.m
MATLAB-master/spikes-master/analysis/findTempForEachClu.m
1,303
utf_8
fb87b0c525ab8e593b84f27364efdb66
function tempPerClu = findTempForEachClu(clu, spikeTemplates) % function tempPerClu = findTempForEachClu(clu, spikeTemplates) % % determine which template "corresponds to" each cluster, meaning, which % template is most represented for each cluster % % output: % - tempPerClu: a vector such that tempPerClu(clusterID) =...
github
xyza11808/MATLAB-master
schmittTimes.m
.m
MATLAB-master/spikes-master/analysis/helpers/schmittTimes.m
413
utf_8
a83c51d12ed8ff9d30f61f64025f62bf
function [flipTimes, flipsUp, flipsDown] = schmittTimes(t, sig, thresh) % function [flipTimes, flipsUp, flipsDown] = schmittTimes(t, sig, thresh) % % thresh is [low high] t = t(:); % make column sig = sig(:); schmittSig = schmitt(sig, thresh); flipsDown = t(schmittSig(1:end-1)==1 & schmittSig(2:end)==-1); flipsUp ...
github
xyza11808/MATLAB-master
eventTrigTrace.m
.m
MATLAB-master/spikes-master/analysis/helpers/eventTrigTrace.m
1,054
utf_8
6fe7b638d9eae86c06ee4bec2adbea6e
function [mn, stdErr, winSamps, allTraces] = eventTrigTrace(traceT, trace, eventTimes, win, varargin) % function [mn, stdev, allTraces] = eventTrigTrace(traceT, trace, eventTimes, win[, ops]) % % ops.Fs allows you to pick a different timescale of the average than of % the original trace, otherwise will use from the o...
github
xyza11808/MATLAB-master
myGaussWin.m
.m
MATLAB-master/spikes-master/analysis/helpers/myGaussWin.m
271
utf_8
3447340e9925cf4cc755e1cfc9e3be15
function gw = myGaussWin(stdev, Fs) % function gw = myGaussWin(stdev, Fs) % A gaussian window with specified stdev in units relative to the sampling % frequency, and normalized in amplitude stdevSamps = round(stdev*Fs); gw = gausswin(stdevSamps*6,3); gw = gw./sum(gw);
github
xyza11808/MATLAB-master
countUnique.m
.m
MATLAB-master/spikes-master/analysis/helpers/countUnique.m
192
utf_8
06818fad678f6ec59a82bb54144b9885
function [values,instances] = countUnique(x) % function [values,instances] = countUnique(x) y = sort(x(:)); p = find([true;diff(y)~=0;true]); values = y(p(1:end-1)); instances = diff(p);
github
xyza11808/MATLAB-master
simpleWFplot.m
.m
MATLAB-master/spikes-master/visualization/simpleWFplot.m
556
utf_8
10ee3b90280d9227e25c46dd8129d85b
function simpleWFplot(wf, coords, nWFtoPlot) wf = wf(:,20:end-5); wfAmps = max(wf')-min(wf'); [~,maxCh] = max(wfAmps); chDists = ((coords(maxCh,1)-coords(:,1)).^2+(coords(maxCh,2)-coords(:,2)).^2).^0.5; [~,nearestCh] = sort(chDists); for n = 1:nWFtoPlot plot((0:size(wf,2)-1)*0.4+coords(nearestCh(n),1), ... ...
github
xyza11808/MATLAB-master
plotAsPhase3.m
.m
MATLAB-master/spikes-master/visualization/plotAsPhase3.m
1,641
utf_8
58f44d4b7b20fa3f5e061b21d5e7bdf2
function plotMat = plotAsPhase3(data,xc, yc) % data is a vector of length nChans [data, xc, yc] = replaceMissingSitesP3(data, xc, yc); data = data(:); % is column now % turn xc into inds uxc = unique(xc); for u = 1:length(uxc) xc(xc==uxc(u))=u; end % turn yc into inds - here *assuming* a regular scale % ycDiff...
github
xyza11808/MATLAB-master
eventsAlignedRasters.m
.m
MATLAB-master/spikes-master/visualization/eventsAlignedRasters.m
1,781
utf_8
8db424b3e6de5771977e9ae58b0e4802
function eventsAlignedRasters(spikeTimes, eventTimes, eventNames, windows) % function eventsAlignedRasters(eventTimes, spikeTimes, eventNames, windows) % % plots rasters of the spikes aligned to each of multiple events, with % relative times of the other events indicated. % - spikeTimes is a vector % - other three ar...
github
xyza11808/MATLAB-master
quickMovieSpikes.m
.m
MATLAB-master/spikes-master/visualization/quickMovieSpikes.m
612
utf_8
5caddfca1733f13dfcfbcd70e4764c45
function quickMovieSpikes(mouseName, thisDate, tag, type) % determine which timeline to use % load spikes expPath = dat.expPath(mouseName, thisDate, expNum, 'main', 'master'); % load traces load(dat.expFilePath(mouseName, thisDate, expNum, 'Timeline', 'master')); traces = prepareTimelineTraces(Timeline); % loa...
github
xyza11808/MATLAB-master
quickMovieSpikesALF.m
.m
MATLAB-master/spikes-master/visualization/quickMovieSpikesALF.m
3,162
utf_8
5c95b840bafca6a1f34ade35a0915a68
function quickMovieSpikesALF(mouseName, thisDate, expNum, tag, type) root = fileparts(dat.expPath(mouseName, thisDate, 1, 'main', 'master')); alfDir = fullfile(root, 'alf'); % load traces traceNames = {'eye.area', 'lickSignal.trace', 'wheel.velocity'}; for tInd = 1:length(traceNames) tr = readNPY(fullfile(alf...
github
xyza11808/MATLAB-master
plotAsProbe.m
.m
MATLAB-master/spikes-master/visualization/plotAsProbe.m
837
utf_8
9969548b81a054e0d743db2d4dbbd5d6
function plotAsProbe(data, xc, yc, cm, sqSizeX, sqSizeY) % data is vector, same lenght as xc and yc % cm is colormap, size [n x 3] % % other usage: if data is empty and cm's first dimension is the same length % as xc and yc, then use those colors literally sqCoordsX = [-sqSizeX/2 sqSizeX/2 sqSizeX/2 -sqSizeX/2]; sqC...
github
xyza11808/MATLAB-master
plotWaveform.m
.m
MATLAB-master/spikes-master/visualization/plotWaveform.m
763
utf_8
449be20bd4a4ddd9d74ed0b4f5b4f442
function plotWaveform(wf, xcoords, ycoords, xScale, yScale, thresh, color, varargin) % wf is nChan x nTimePoints % color must be 3-element vector if ~isempty(thresh) chanAmps = max(wf,[],2)-min(wf, [], 2); maxAmp = max(chanAmps); inclChans = chanAmps>maxAmp*thresh; else inclChans = true(size(xcoords)...
github
xyza11808/MATLAB-master
evRastersGUI.m
.m
MATLAB-master/spikes-master/visualization/evRastersGUI.m
25,805
utf_8
fa13c6c19bdaa9a687bd6ff3cf080677
function f = evRastersGUI(st, clu, cweA, cwtA, moveData, lickTimes, anatData) % function evRastersGUI(st, clu, cweA, cwtA, moveData, lickTimes, anatData) % % Displays rasters and PSTHs for individual units in the choiceworld task % % Inputs: % - st - vector of spike times % - clu - vector of cluster identities % - cw...
github
xyza11808/MATLAB-master
rasterAndPSTHbyCond.m
.m
MATLAB-master/spikes-master/visualization/rasterAndPSTHbyCond.m
1,868
utf_8
5f82d5bd49df439aa231c953e88c71eb
function rasterAndPSTHbyCond(st, evTimes, evGroups, win, sm, colors, axR, axP) % sm is smoothing window size in sec % axR and axP are axes for rasters and psth's %% - compute psths binSize = 0.0005; [~,ii] = sort(evTimes); [~,revii] = sort(ii); [~, bins, ~, ~, ~, ba] = psthAndBA(... st, evTimes, win+[-0.1 0.1], ...
github
xyza11808/MATLAB-master
popRasterViewer.m
.m
MATLAB-master/spikes-master/visualization/popRasterViewer.m
15,595
utf_8
795baaa4c10451fbb710391f84da7cfa
function popRasterViewer(sp, eventData, traces, auxVid, pars) % % Viewer for ephys data collected during the task % % Displays: % - Rasters from multiple probes % -- Can make raster y-axis into cluster identity (sorted by depth) or probe depth % -- Can make raster colorization be different things, like depth or spike ...
github
xyza11808/MATLAB-master
movieWithTracesSpikes.m
.m
MATLAB-master/spikes-master/visualization/movieWithTracesSpikes.m
15,392
utf_8
4bb5108701cd64afe75cfcc5f441d023
% todo % - implement pixel traces % - implement version with raster % - smoothing % - normalization % - implement 'g' for go to specific time function movieWithTracesSpikes(spikeTimes, spikeClu, traces, auxVid, anatData, pars) % function movieWithTracesSpikes(spikeTimes, spikeClu, traces, auxVid, pars) % - spikeTime...
github
xyza11808/MATLAB-master
psthViewer.m
.m
MATLAB-master/spikes-master/visualization/psthViewer.m
9,581
utf_8
563aa5e55edffb74208cde799cd889a9
function psthViewer(spikeTimes, clu, eventTimes, window, trGroups) % function psthViewer(spikeTimes, clu, eventTimes, window, trGroups) % % Controls: % - c: dialog box to pick a new cluster ID number % - t: toggle showing psth traces for each grouping variable or just the % overall. If showing just overall, raster is...
github
xyza11808/MATLAB-master
eventsAlignedRasters2.m
.m
MATLAB-master/spikes-master/visualization/eventsAlignedRasters2.m
1,339
utf_8
09bab6ce1c6257f6fbfb2495104d0ff4
function [bins, ba] = eventsAlignedRasters2(st, eventTimes, trOrder, thisWindow, otherEvents, axRaster, axPSTH) if isempty(trOrder) trOrder = 1:numel(eventTimes); end psthBinSize = 0.0001; smoothWinStd = 0.01; smoothWin = myGaussWin(smoothWinStd, 1/psthBinSize); nTimes = length(eventTimes); windowExp = thisWind...
github
xyza11808/MATLAB-master
plotDriftmap.m
.m
MATLAB-master/spikes-master/visualization/plotDriftmap.m
4,296
utf_8
a7339aa90aa6ac6de66f302a4547d9bd
% Inputs: spikeTimes, spikeAmps, spikeYpos - names self explanatory % opt - optional, empty by default; 'mark' - will mark detected drifts, 'show' - will generate a different plot, % where only large spikes are used, and the detection of drift locations is demonstrated function plotDriftmap(spike...
github
xyza11808/MATLAB-master
eventsAlignedRastersWithGrouping.m
.m
MATLAB-master/spikes-master/visualization/eventsAlignedRastersWithGrouping.m
2,836
utf_8
6b7e3b616077c1162fdd719497d5d3a0
function eventsAlignedRastersWithGrouping(spikeTimes, eventTimes, params) % function eventsAlignedRasters(eventTimes, spikeTimes, params) % % plots rasters of the spikes aligned to each of multiple events, with % relative times of the other events indicated. % - spikeTimes is a vector % - eventTimes is cell arrays, o...
github
xyza11808/MATLAB-master
computeWFampsOverDepth.m
.m
MATLAB-master/spikes-master/visualization/computeWFampsOverDepth.m
491
utf_8
356f75ca41432ec41dfed3bc5da8a850
function [pdfs, cdfs] = computeWFampsOverDepth(spikeAmps, spikeDepths, ampBins, depthBins, recordingDur) nDbins = length(depthBins)-1; nAbins = length(ampBins)-1; pdfs = zeros(nDbins, nAbins); cdfs = zeros(nDbins, nAbins); for b = 1:length(depthBins)-1 h = histc(spikeAmps(spikeDepths>depthBins(b) & spikeDepths<=...
github
xyza11808/MATLAB-master
makepretty.m
.m
MATLAB-master/spikes-master/visualization/helpers/makepretty.m
575
utf_8
903e10baa38a3689472896dd1281f20c
function makepretty() % set some graphical attributes of the current axis set(get(gca, 'XLabel'), 'FontSize', 17); set(get(gca, 'YLabel'), 'FontSize', 17); set(gca, 'FontSize', 13); set(get(gca, 'Title'), 'FontSize', 20); ch = get(gca, 'Children'); for c = 1:length(ch) thisChild = ch(c); if strcmp('line',...
github
xyza11808/MATLAB-master
colorcet.m
.m
MATLAB-master/spikes-master/visualization/helpers/colorcet.m
510,830
utf_8
d8ee688a2a1354d858c757af2ef10600
% COLORCET - Perceptually uniform color maps % % Usage 1: Generate a colour map and apply it to the current figure. % >> colorcet(name); % % Usage 2: Return a colour map and its description. % >> [map, descriptorname, description] = colorcet(name); % % Usage 3: Get a list of all possible colour maps. % >> colorcet %...
github
xyza11808/MATLAB-master
rasterize.m
.m
MATLAB-master/spikes-master/visualization/helpers/rasterize.m
404
utf_8
82661f868e21d94797f5b97a00f7b144
function [xOut, yOut] = rasterize(timeStamps, varargin) %function [xOut, yOut] = rasterize(timeStamps[, minVal, maxVal]) if ~isempty(varargin) minVal = varargin{1}; maxVal = varargin{2}; else minVal = 0; maxVal = 1; end xOut = nan(1,length(timeStamps)*3); xOut(1:3:end) = timeStamps; xOut(2:3:end) =...
github
xyza11808/MATLAB-master
computeAndPlotWFampHist.m
.m
MATLAB-master/spikes-master/visualization/+ks/computeAndPlotWFampHist.m
2,038
utf_8
b71f8337e9ba00c1663efbcf811b20bb
function [pdfs, cdfs, ampBins, depthBins] = computeAndPlotWFampHist(ksDir, varargin) % function [pdfs, cdfs, ampBins, depthBins] = computeAndPlotWFampHist(kilosortDirectory[, ampBins, depthBins]) if ~isempty(varargin) ampBins = varargin{1}; depthBins = varargin{2}; else ampBins = []; depthBins = []; ...
github
xyza11808/MATLAB-master
sphere_sampling.m
.m
MATLAB-master/sometoolbox/toolbox_alpert/sphere_sampling.m
4,270
utf_8
266924d242f54957933e749b7181ba5c
function [Points,L,diam,topcol,botcol] = sphere_sampling(N,lrounded,angles,mrounded,ipl) % sphere_sampling - sample points on a sphere. % % [Points,L,diam] = sphere_sampling(N,lrounded,angles,mrounded,ipl) % $Revision: 1.1 $ Paul Leopardi 2003-10-13 % Make angles=1 the default % $Revision: 1.1 $ Paul Leopardi ...
github
xyza11808/MATLAB-master
load_signal.m
.m
MATLAB-master/sometoolbox/toolbox_alpert/toolbox/load_signal.m
11,947
utf_8
db55dbee0917dfa39660ddb07583f1e6
function y = load_signal(name, n, options) % load_signal - load a 1D signal % % y = load_signal(name, n, options); % % name is a string that can be : % 'regular' (options.alpha gives regularity) % 'step', 'rand', % 'gaussiannoise' (options.sigma gives width of filtering in pixels), % [natural signals] % 't...
github
xyza11808/MATLAB-master
load_image.m
.m
MATLAB-master/sometoolbox/toolbox_alpert/toolbox/load_image.m
20,337
utf_8
68382a18d724933d0ab0372f752ed2cc
function M = load_image(type, n, options) % load_image - load benchmark images. % % M = load_image(name, n, options); % % name can be: % Synthetic images: % 'chessboard1', 'chessboard', 'square', 'squareregular', 'disk', 'diskregular', 'quaterdisk', '3contours', 'line', % 'line_vertical', 'line_horiz...
github
xyza11808/MATLAB-master
perform_farthest_point_sampling.m
.m
MATLAB-master/sometoolbox/toolbox_fast_marching/perform_farthest_point_sampling.m
3,253
utf_8
271c5c1557a202369b41332981b02b64
function [points,D] = perform_farthest_point_sampling( W, points, npoints, options ) % perform_farthest_point_sampling - samples points using farthest seeding strategy % % points = perform_farthest_point_sampling( W, points, npoints ); % % points can be [] or can be a (2,npts) matrix of already computed % sam...
github
xyza11808/MATLAB-master
perform_farthest_point_sampling_mesh.m
.m
MATLAB-master/sometoolbox/toolbox_fast_marching/perform_farthest_point_sampling_mesh.m
1,797
utf_8
3e863c0d0d0a4b012240b09688d4c8ef
function [points,D] = perform_farthest_point_sampling_mesh( vertex,faces, points, nbr_iter, options ) % perform_farthest_point_sampling - samples points using farthest seeding strategy % % [points,D] = perform_farthest_point_sampling_mesh( vertex,faces, points, nbr_iter, options ); % % points can be [] or can be a (...
github
xyza11808/MATLAB-master
divgrad.m
.m
MATLAB-master/sometoolbox/toolbox_fast_marching/divgrad.m
1,749
utf_8
531f368d44593d78a30eea65ad3a8134
function G = divgrad(M,options) % divgrad - compute either gradient or divergence. % % G = divgrad(M); % % if M is a 2D array, compute gradient, % if M is a 3D array, compute divergence. % Use centered finite differences. % % Copyright (c) 2007 Gabriel Peyre options.null = 0; if size(M,3)==2 G = mydiv(...
github
xyza11808/MATLAB-master
compute_voronoi_triangulation.m
.m
MATLAB-master/sometoolbox/toolbox_fast_marching/compute_voronoi_triangulation.m
2,806
utf_8
6ed546707daebe1eb6f945f8834ceb61
function faces = compute_voronoi_triangulation(Q, vertex) % compute_voronoi_triangulation - compute a triangulation % % face = compute_voronoi_triangulation(Q); % % Q is a Voronoi partition function, computed using % perform_fast_marching. % face(:,i) is the ith face. % % Works in 2D and in 3D. % % Cop...
github
xyza11808/MATLAB-master
vol3d.m
.m
MATLAB-master/sometoolbox/toolbox_fast_marching/vol3d.m
5,700
utf_8
d4c8aeec81bea6ff37ed75bb28e20663
function [model] = vol3d(varargin) %H = VOL3D Volume render 3-D data. % VOL3D uses the orthogonal plane 2-D texture mapping technique for % volume rending 3-D data in OpenGL. Use the 'texture' option to fine % tune the texture mapping technique. This function is best used with % fast OpenGL hardware. % % H = vol3d('...
github
xyza11808/MATLAB-master
compute_geodesic_mesh.m
.m
MATLAB-master/sometoolbox/toolbox_fast_marching/compute_geodesic_mesh.m
4,234
utf_8
f3e2ddf4b7d47f9f8d9226288e74c5d7
function [path,vlist,plist] = compute_geodesic_mesh(D, vertex, face, x, options) % compute_geodesic_mesh - extract a discrete geodesic on a mesh % % [path,vlist,plist] = compute_geodesic_mesh(D, vertex, face, x, options); % % D is the set of geodesic distances. % % path is a 3D curve that is the shortest path st...
github
xyza11808/MATLAB-master
load_image.m
.m
MATLAB-master/sometoolbox/toolbox_fast_marching/toolbox/load_image.m
18,777
utf_8
46b5ed29e3aa2b0736eb6fb78a3ed113
function M = load_image(type, n, options) % load_image - load benchmark images. % % M = load_image(name, n, options); % % name can be: % Synthetic images: % 'chessboard1', 'chessboard', 'square', 'squareregular', 'disk', 'diskregular', 'quaterdisk', '3contours', 'line', % 'line_vertical', 'line_horiz...
github
xyza11808/MATLAB-master
check_face_vertex.m
.m
MATLAB-master/sometoolbox/toolbox_fast_marching/toolbox/check_face_vertex.m
630
utf_8
5112ad0482fa3700123a6c770f8eb622
function [vertex,face] = check_face_vertex(vertex,face, options) % check_face_vertex - check that vertices and faces have the correct size % % [vertex,face] = check_face_vertex(vertex,face); % % Copyright (c) 2007 Gabriel Peyre vertex = check_size(vertex); face = check_size(face); %%%%%%%%%%%%%%%%%%%%%%%%%%%%% f...
github
xyza11808/MATLAB-master
perform_dr_spingarn.m
.m
MATLAB-master/sometoolbox/toolbox_optim/perform_dr_spingarn.m
1,205
utf_8
22a1d91cc8116c7c7255f83c6faba8a7
function [x,R] = perform_dr_spingarn(x, ProxF, options) % perform_dr_spingarn - Douglas Rachford algorithm for the sum of >=2 functions % % [x,R] = perform_dr_spingarn(x,ProxF,options); % % Solves % min_x sum_i F_i(x) % where F_i are proper convex functions, with an easy to compute % proximal mapping. %...
github
xyza11808/MATLAB-master
perform_wavortho_transf.m
.m
MATLAB-master/sometoolbox/toolbox_optim/toolbox/perform_wavortho_transf.m
2,618
utf_8
916e69c67df707f99eb83398091ff107
function f = perform_wavortho_transf(f,Jmin,dir,options) % perform_wavortho_transf - compute orthogonal wavelet transform % % fw = perform_wavortho_transf(f,Jmin,dir,options); % % You can give the filter in options.h. % % Works in arbitrary dimension. % % Copyright (c) 2009 Gabriel Peyre options.null = 0; h =...
github
xyza11808/MATLAB-master
load_image.m
.m
MATLAB-master/sometoolbox/toolbox_optim/toolbox/load_image.m
20,769
utf_8
1e7385317f656bdec8213321748edab7
function M = load_image(type, n, options) % load_image - load benchmark images. % % M = load_image(name, n, options); % % name can be: % Synthetic images: % 'chessboard1', 'chessboard', 'square', 'squareregular', 'disk', 'diskregular', 'quaterdisk', '3contours', 'line', % 'line_vertical', 'line_horiz...
github
xyza11808/MATLAB-master
load_signal.m
.m
MATLAB-master/sometoolbox/toolbox_signal/load_signal.m
11,947
utf_8
db55dbee0917dfa39660ddb07583f1e6
function y = load_signal(name, n, options) % load_signal - load a 1D signal % % y = load_signal(name, n, options); % % name is a string that can be : % 'regular' (options.alpha gives regularity) % 'step', 'rand', % 'gaussiannoise' (options.sigma gives width of filtering in pixels), % [natural signals] % 't...
github
xyza11808/MATLAB-master
perform_kmeans.m
.m
MATLAB-master/sometoolbox/toolbox_signal/perform_kmeans.m
15,346
utf_8
18099d3ffa3630eef50cad1030080937
function [B,seeds,E] = perform_kmeans(X,nbCluster,options) % perform_kmeans - perform the k-means clustering algorithm. % % [B,seeds] = perform_kmeans(X,nbCluster,options); % % 'X' is a [d,n] matrix where d is the dimension of the space % and n is the number of points (that live in R^d). % 'nbCluster' is t...
github
xyza11808/MATLAB-master
perform_dct_transform.m
.m
MATLAB-master/sometoolbox/toolbox_signal/perform_dct_transform.m
7,750
utf_8
07f7ce84cf4f6dfc91ad645a17eab05c
function y = perform_dct_transform(x,dir) % perform_dct_transform - discrete cosine transform % % y = perform_dct_transform(x,dir); % % Copyright (c) 2006 Gabriel Peyre if size(x,1)==1 || size(x,2)==1 % 1D transform if dir==1 y = dct(x); else y = idct(x); end else if dir==1 ...
github
xyza11808/MATLAB-master
compute_skewness.m
.m
MATLAB-master/sometoolbox/toolbox_signal/compute_skewness.m
2,307
utf_8
d2c1ae20ba7df193f8d0fbc04183a069
function s = compute_skewness(x,center_mean) % compute_skewness compute the Skewness. % returns the sample skewness of the values in X. For a % vector input, S is the third central moment of X, divided by the cube % of its standard deviation. For a matrix input, S is a row vector % containing the sample ske...
github
xyza11808/MATLAB-master
compute_kurtosis.m
.m
MATLAB-master/sometoolbox/toolbox_signal/compute_kurtosis.m
2,413
utf_8
787c7a07ebed6e9c2396228b98b42bae
function k = compute_kurtosis(x, center_mean) %compute_kurtosis - compute the Kurtosis. % % returns the sample kurtosis of the values in X. For a % vector input, K is the fourth central moment of X, divided by fourth % power of its standard deviation. For a matrix input, K is a row vector % containing the sa...
github
xyza11808/MATLAB-master
compute_histogram_distance.m
.m
MATLAB-master/sometoolbox/toolbox_signal/compute_histogram_distance.m
1,926
utf_8
8d2e4fb98f34f913571462dc3fec7fe2
function D = compute_histogram_distance(H, options) % compute_histogram_distance - compute distance between histograms % % D = compute_histogram_distance(H, options); % % H(:,i) is the ith histogram. % D(i,g) is the distance between histogram i and j. % % options.histmetric is the metric used to compute the distan...
github
xyza11808/MATLAB-master
compute_histogram_rbf.m
.m
MATLAB-master/sometoolbox/toolbox_signal/compute_histogram_rbf.m
2,360
utf_8
db90055f55a69747e4b061c873ac0365
function h = compute_histogram_rbf(f, sigma, x, options) % compute_histogram_rbf - parzen windows density estimation % % h = compute_histogram_rbf(f, sigma, x); % % f is the signal, h is an estimate of the histogram, % where h(i) is the density of the estimation around value x(i). % % sigma is the bandwidth u...
github
xyza11808/MATLAB-master
compute_distance_matrix.m
.m
MATLAB-master/sometoolbox/toolbox_signal/compute_distance_matrix.m
2,221
utf_8
f3352ca2f82567aeeb83e8713deb91f5
function dist = compute_distance_matrix(X,x) % compute_distance_matrix - compute pairwise distance matrix. % % D = compute_distance_matrix(X); % or % D = compute_distance_matrix(X,x, metric); % (set x=X) % % We have D(i,j)=|X(:,i)-x(:,j)|^2. % % Copyright (c) 2004 Gabriel Peyre [D,N] = size(X); try ...
github
xyza11808/MATLAB-master
mad.m
.m
MATLAB-master/sometoolbox/toolbox_signal/mad.m
7,680
utf_8
1fff5e4e7dffd038def5d5f2dfbdf111
function y = mad(x,flag) %MAD Mean/median absolute deviation. % Y = MAD(X) returns the mean absolute deviation of the values in X. For % vector input, Y is MEAN(ABS(X-MEAN(X)). For a matrix input, Y is a row % vector containing the mean absolute deviation of each column of X. For % N-D arrays, MAD operates ...
github
xyza11808/MATLAB-master
perform_moment_equalization.m
.m
MATLAB-master/sometoolbox/toolbox_signal/perform_moment_equalization.m
11,438
utf_8
56f1977353f73c1b7af33015235c9826
function x = perform_moment_equalization(x,y,numdim, options) % perform_kurtosis_equalization - equalize moments of order 1,2,3,4. % % x = perform_moment_equalization(x,y,numdim,options); % % (numdim=1 by default). % % Equalizes the mean, variance, skewness and kurtosis. % Set options.xx=0 to avoid equalizing ...