Skip to content

idea: kilosort installer #17

@stevevanhooser

Description

@stevevanhooser

I wrote this when I was testing, just putting it here for safe-keeping

function installKilosort(vers, localpath)
% INSTALLKILOSORT - install Kilosort on Windows
%
% INSTALLKILOSORT()
%
% Installs v3.0.2 of Kilosort in a subdirectory called 'tools'
% of the user's userpath.
%
% INSTALLKILOSORT(VERS)
%
% Installs a particular Kilsort version (e.g., 'v.3.0.2').
%
% INSTALLKILOSORT(VERS, LOCALPATH)
%
% Installs a particular Kilosort version at LOCALPATH instead
% of [userpath filesep 'tools'].
%
%

if nargin<2
    localpath = [userpath filesep 'tools'];
end;

if nargin<1
    vers = 'v.3.0.2';
end;

 % now do the installation

if ~isfolder(localpath)
    mkdir(localpath);
end

filename = [localpath filesep vers '.zip'];
remoteFilename = ['https://github.com/MouseLand/Kilosort/archive/refs/tags/' vers '.zip'];

websave(filename, remoteFilename);

currentwd = pwd;

try
    cd(localpath);
    unzippedFiles = unzip(filename);
    cd(currentwd);
catch
    cd(currentwd);
    error([lasterr]);
end;
   
kilosortParentDir = fileparts(unzippedFiles{1});

addpath(genpath(kilosortParentDir));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions