Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renames NeuroField to NFTsim #146

Merged
merged 24 commits into from
Feb 5, 2018
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1bc502f
Changes neurofield to nftsim in Makefile.
stuart-knock Feb 2, 2018
183064e
Changes neurofield to nftsim in Matlab interface.
stuart-knock Feb 2, 2018
b2b6b7d
Changes neurofield to nftsim in src.
stuart-knock Feb 2, 2018
061f674
Changes neurofield to nftsim in documentation.
stuart-knock Feb 2, 2018
489642e
Changes NeuroField to NFTsim in user-manual.
stuart-knock Feb 2, 2018
2fc6e0a
Changes NEUROFIELD to NFTSIM in header guards.
stuart-knock Feb 2, 2018
eb5b27e
Changes variables neurofield_* to nftsim_* in Matlab interface.
stuart-knock Feb 2, 2018
d501376
Changes remaining neurofield to nftsim in Matlab interface.
stuart-knock Feb 2, 2018
f43d650
Changes Neurofield to nftsim in main() header and help message.
stuart-knock Feb 2, 2018
d8180a5
Changes neurofield to nftsim in Python interface.
stuart-knock Feb 2, 2018
6ee6f73
Changes Python class file-name from neurofield to nftsim.
stuart-knock Feb 2, 2018
0d4657b
Changes neurofield to nftsim in nf_configs.
stuart-knock Feb 2, 2018
ec850b9
Changes NeuroField to NFTsim in noise doc.
stuart-knock Feb 2, 2018
9a77856
Changes neurofield to nftsim in nf_benchmarks.
stuart-knock Feb 2, 2018
2d83d62
Changes remaining, scattered, neurofield references to nftsim.
stuart-knock Feb 2, 2018
ba47ca7
Updates user-guide pdf with recent changes.
stuart-knock Feb 2, 2018
88c6453
Document input and output arguments
Feb 4, 2018
b7496f8
Improve comments
Feb 4, 2018
2a7aa33
Fix spatial coordinates of grid points.
Feb 5, 2018
5ae6a87
Updates variable names used for array size
Feb 5, 2018
8525a56
Update inline TODO
Feb 5, 2018
77f1ff6
Update inline TODO
Feb 5, 2018
358f3ad
Document input and output arguments
Feb 5, 2018
8d5b9ae
Update conditions text; link to preprint
Feb 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions +nf/extract.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
%% Extract a specific subset of data from a neurofield output struct.
%% Extract a specific subset of data from a nftsim output struct.
%
% The subset can be specified in terms of: traces; times; and nodes.
%
% ARGUMENTS:
% obj -- A neurofield output struct (a Matlab struct containing data
% obj -- A nftsim output struct (a Matlab struct containing data
% from a simulation).
% traces -- A cell array or a comma separated string of the traces
% you want to extract, e.g. 'Propagator.2.phi, Coupling.2.nu'.
Expand Down Expand Up @@ -35,7 +35,7 @@
% If no nodes are provided, output all nodes
if ~isstruct(obj) || ~isfield(obj, 'data')
error(['nf:' mfilename ':BadArgument'], ...
'The first argument must be a neurofield output struct.');
'The first argument must be a nftsim output struct.');
end

if nargin < 4 || isempty(nodes)
Expand Down
4 changes: 2 additions & 2 deletions +nf/grid.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% output all nodes), or the number of nodes is not a perfect square..
%
% ARGUMENTS:
% obj -- A neurofield output struct (a Matlab struct containing data
% obj -- A nftsim output struct (a Matlab struct containing data
% from a simulation).
% trace -- A string with the name of the array to reshape.
%
Expand All @@ -35,7 +35,7 @@

if output_nodes ~= obj.input_nodes
error(['nf:' mfilename ':IncompatibleOutput'], ...
'Output from NeuroField must be for all nodes')
'Output from NFTsim must be for all nodes')
end

data = nf.extract(obj, trace);
Expand Down
4 changes: 2 additions & 2 deletions +nf/plot_timeseries.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
% figure_handles -- cell array of figure handles.
%
% REQUIRES:
% nf.extract() -- Extract a specific subset of data from a neurofield
% nf.extract() -- Extract a specific subset of data from a nftsim
% output struct.
%
% AUTHOR:
Expand All @@ -28,7 +28,7 @@
%{
%Either run a simulation:
nf_obj = nf.run('./configs/eirs-corticothalamic.conf')
%Or load some neurofield output data
%Or load some nftsim output data
nf_obj = nf.read('./configs/eirs-corticothalamic.output')

%Plot every fourth node for the trace 'Propagator.1.phi'.
Expand Down
6 changes: 3 additions & 3 deletions +nf/read.m
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
%% Read a neurofield output file and return a neurofield output struct.
%% Read a nftsim output file and return a nftsim output struct.
%
% ARGUMENTS:
% fname -- The name of the neurofield output file to read (absolute
% fname -- The name of the nftsim output file to read (absolute
% or relative path).
%
% OUTPUT:
% obj -- A neurofield output struct. A Matlab struct containing data
% obj -- A nftsim output struct. A Matlab struct containing data
% and parameters from a simulation.
%
% AUTHOR:
Expand Down
6 changes: 3 additions & 3 deletions +nf/report.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%% Given a neurofield output struct, print some information about it.
%% Given a nftsim output struct, print some information about it.
%
% ARGUMENTS:
% obj -- A neurofield output struct (a Matlab struct containing data
% obj -- A nftsim output struct (a Matlab struct containing data
% from a simulation).
%
% OUTPUT: Prints to terminal.
Expand All @@ -16,7 +16,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function report(obj)
fprintf(1, 'Output for: neurofield -i "%s"\n', obj.conf_file)
fprintf(1, 'Output for: nftsim -i "%s"\n', obj.conf_file)
fprintf(1, 'Traces: ');
for j = 1:length(obj.fields)
fprintf(1, '%s ', obj.fields{j});
Expand Down
50 changes: 25 additions & 25 deletions +nf/run.m
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
%% Function to run neurofield and return a neurofield output struct.
%% Function to run nftsim and return a nftsim output struct.
%
% Provided a configuration file-name (fname.conf), run the neurofield
% Provided a configuration file-name (fname.conf), run the nftsim
% executable, generating an output file (fname.output). Optionally, if an
% output argument is provided then, parse the output file and return a
% neurofield output struct containing the simulation results.
% nftsim output struct containing the simulation results.
%
%
% ARGUMENTS:
% fname -- Name of the configuration file, it can be with or without
% the .conf extension.
% time_stamp -- boolean flag to use a time_stamp YYYY-MM-DDTHHMMSS
% in the output file name.
% neurofield_path -- neurofield executable (full or relative path).
% nftsim_path -- nftsim executable (full or relative path).
%
% OUTPUT: Writes a .output file in the same location as the .conf file.
% obj -- A neurofield output struct (a Matlab struct containing
% obj -- A nftsim output struct (a Matlab struct containing
% data from a simulation).
%
% REQUIRES:
% neurofield -- The neurofield executable, must be in your path.
% nf.read -- Read a neurofield output file and return a neurofield
% nftsim -- The nftsim executable, must be in your path.
% nf.read -- Read a nftsim output file and return a nftsim
% output struct.
%
% AUTHOR:
% Romesh Abeysuriya (2012-03-22).
%
% USAGE:
%{
%At a matlab command promt, from neurofield's main directory:
%At a matlab command promt, from nftsim's main directory:
nf_obj = nf.run('./configs/eirs-corticothalamic.conf')
%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function obj = run(fname, time_stamp, neurofield_path)
function obj = run(fname, time_stamp, nftsim_path)
%
tic;
fname = strrep(fname, '.conf', ''); %Strip any .conf suffix.
Expand All @@ -41,39 +41,39 @@
if nargin < 2
time_stamp = false;
end
% If we were not provided a path to neurofield, try to determine one.
if nargin < 3 || isempty(neurofield_path)
% If we were not provided a path to nftsim, try to determine one.
if nargin < 3 || isempty(nftsim_path)
% Check typical locations, the first path that exists will be selected.
locations = {'neurofield', ...
'./bin/neurofield', ...
'./neurofield/bin/neurofield', ...
'neurofield.exe'};
locations = {'nftsim', ...
'./bin/nftsim', ...
'./nftsim/bin/nftsim', ...
'nftsim.exe'};
selected_path = find(cellfun(@(name) exist(name, 'file')==2, locations), 1, 'first');
if ~isempty(selected_path)
neurofield_path = locations{selected_path};
nftsim_path = locations{selected_path};
else
error(['nf:' mfilename ':BadPath'], ...
'neurofield not found. Either change into the neurofield base directory or make a symlink to neurofield in the current directory.');
'nftsim not found. Either change into the nftsim base directory or make a symlink to nftsim in the current directory.');
end
% If we were provided a path, check that it is valid.
elseif ~exist(neurofield_path, 'file')
elseif ~exist(nftsim_path, 'file')
error(['nf:' mfilename ':BadPath'], ...
'The neurofield_path you provided is incorrect:"%s".',neurofield_path);
'The nftsim_path you provided is incorrect:"%s".',nftsim_path);
end

if ~time_stamp
neurofield_cmd = sprintf('%s -i %s.conf -o %s.output', neurofield_path, fname, fname);
nftsim_cmd = sprintf('%s -i %s.conf -o %s.output', nftsim_path, fname, fname);
else
neurofield_cmd = sprintf('%s -i %s.conf -t', neurofield_path, fname);
nftsim_cmd = sprintf('%s -i %s.conf -t', nftsim_path, fname);
end
fprintf('INFO: Executing command:\n')
fprintf('%s\n', neurofield_cmd);
[status, cmdout] = system(neurofield_cmd);
fprintf('%s\n', nftsim_cmd);
[status, cmdout] = system(nftsim_cmd);

string(cmdout)
if status ~= 0
error(['nf:' mfilename ':NeurofieldError'], ...
'An error occurred while running neurofield!');
error(['nf:' mfilename ':NFTsimError'], ...
'An error occurred while running nftsim!');
end

fprintf(1, 'INFO: tic-toc: Took about %.3f seconds\n', toc);
Expand Down
10 changes: 5 additions & 5 deletions +nf/spectrum.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%% Return the frequency and frequency spectrum of given neurofield output.
%% Return the frequency and frequency spectrum of given nftsim output.
%
% ARGUMENTS:
% obj -- A neurofield output struct (a Matlab struct containing data
% obj -- A nftsim output struct (a Matlab struct containing data
% from a simulation).
% traces -- traces to use
% n_windows -- number of windows (Default=8).
Expand All @@ -12,7 +12,7 @@
%
% REQUIRES:
% nf.partition() -- Partition a list of n items into m groups.
% nf.extract() -- Extract a specific subset of data from a neurofield output struct.
% nf.extract() -- Extract a specific subset of data from a nftsim output struct.
% nf.rfft() -- Fourier transform.
%
% REFERENCES:
Expand All @@ -22,7 +22,7 @@
%
% USAGE:
%{
%Load some neurofield output data.
%Load some nftsim output data.
obj = nf.read('./configs/example.output')
%Calculate the mean power spectrum.
[f, P] = nf.spectrum(obj, 'Propagator.1.phi', [], true, true);
Expand All @@ -36,7 +36,7 @@
function [f, P] = spectrum(obj, traces, n_windows, windowed, detrended)
if ~isstruct(obj)
error(['nf:' mfilename ':BadArgument'], ...
'The first argument must be a neurofield simulation struct.')
'The first argument must be a nftsim simulation struct.')
end

if nargin < 2 || isempty(traces)
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Makefile text

# The executable.
neurofield binary
nftsim binary

#Configuration files
*.conf text
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dep/
doc/html/
doc/latex/

# Ignore NeuroField output files
# Ignore NFTsim output files
*.output
*.mat

Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "Neurofield"
PROJECT_NAME = "NFTsim"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Makefile for neurofield
#Makefile for nftsim
#
# Type 'make help' for a list of possible targets with brief descriptions.
# If you're having problems, the Makefile itself can be debugged using the
Expand All @@ -14,7 +14,7 @@ DOCDIR := doc/
DEPDIR := dep/

#Default to *nix, suffix-less, binary.
BIN := neurofield
BIN := nftsim

#User-manual files
USER_MANUAL := NFTsimManual.pdf
Expand Down Expand Up @@ -58,18 +58,18 @@ NO_DEPS += clean-user-manual clean-reference-manual clean-docs clean-deps clean-
# Define our suffix list
.SUFFIXES: .o .d .cpp .h .tex

.PHONY: neurofield debug all clang make_bin_dir make_obj_dir make_dep_dir help help-dev info docs user-manual reference-manual \
.PHONY: nftsim debug all clang make_bin_dir make_obj_dir make_dep_dir help help-dev info docs user-manual reference-manual \
clean-user-manual clean-reference-manual clean-docs clean-deps clean-objs clean-bin clean clean-all

# target: neurofield - Compile neurofield placing the executable in the bin directory.
neurofield: $(BINDIR)$(BIN)
# target: nftsim - Compile nftsim placing the executable in the bin directory.
nftsim: $(BINDIR)$(BIN)

# target: debug - Compile neurofield with debugging enabled.
# target: debug - Compile nftsim with debugging enabled.
debug: CXXFLAGS := $(DEBUG)
debug: neurofield
debug: nftsim

# target: all - Compile neurofield and build all documentation.
all: neurofield docs
# target: all - Compile nftsim and build all documentation.
all: nftsim docs

# target: gcc - Build using gcc, unnecessary on Linux as gcc is default.
ifeq ($(MAKECMDGOALS), gcc)
Expand All @@ -80,7 +80,7 @@ ifeq ($(MAKECMDGOALS), gcc)
CXXFLAGS := -std=c++11 -lm -Wall -Wextra -pedantic -msse -msse2 -msse3 -mfpmath=sse -march=native -mtune=native -funroll-loops -flto -O3
DEPFLAGS = -std=c++11 -MM -MP -MT $(OBJDIR)$*.o
endif
gcc: neurofield
gcc: nftsim

# target: clang - Build using clang++, unnecessary on MacOS unless you want extra warnings as clang++ is default.
ifeq ($(MAKECMDGOALS), clang)
Expand All @@ -91,7 +91,7 @@ ifeq ($(MAKECMDGOALS), clang)
CXXFLAGS := -std=c++11 -Weverything -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -fdiagnostics-fixit-info -Wdocumentation -march=native -funroll-loops -flto -O3
DEPFLAGS = -std=c++11 -MM -MP -MT $(OBJDIR)$*.o
endif
clang: neurofield
clang: nftsim

# target: intel - Build using intel C++ compiler.
ifeq ($(MAKECMDGOALS), intel)
Expand All @@ -104,13 +104,13 @@ ifeq ($(MAKECMDGOALS), intel)
CXXFLAGS := -std=c++11 -Wall -Wremarks -Wchecks -Weffec++ -xHost -funroll-loops -ipo -O3
DEPFLAGS = -std=c++11 -MM -MP -MT $(OBJDIR)$*.o
endif
intel: neurofield
intel: nftsim

# target: $(BINDIR)$(BIN) - Main target for the final build, linking objects into an executable.
$(BINDIR)$(BIN): $(OBJ) | make_bin_dir
$(CXX) $(CXXFLAGS) $(OBJ) -o $@
@$(CAT) conditions.txt
@echo "USE OF NEUROFIELD CONSTITUTES ACCEPTANCE OF THE APACHE 2.0 LICENSE"
@echo "USE OF NFTSIM CONSTITUTES ACCEPTANCE OF THE APACHE 2.0 LICENSE"

# target: make_bin_dir - Create the directory $BINDIR if it doesn't already exist.
make_bin_dir:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ To build the executable on Linux or MacOS, open a terminal in the `nftsim` direc

make

this produces the executable `bin/neurofield` and autogenerates the documentation.
this produces the executable `bin/nftsim` and autogenerates the documentation.

To build only the reference manual type:

Expand All @@ -57,7 +57,7 @@ Example configurations including examples for published results are available in

To run the basic example type

./bin/neurofield -i ./configs/eirs-corticothalamic.conf -o eirs-corticothalamic.output
./bin/nftsim -i ./configs/eirs-corticothalamic.conf -o eirs-corticothalamic.output

## Troubleshooting

Expand Down
Loading