Permalink
Browse files

Updated the naming convention and switched to the Random_stream header

  • Loading branch information...
1 parent baf0818 commit a3bfdaeaad81b9eeae393373bf9353a195e21b42 @miscco committed Feb 1, 2016
Showing with 378 additions and 384 deletions.
  1. +30 −45 Data_Storage.h
  2. +8 −8 NM_Thalamus.pro
  3. +5 −5 Plots.m
  4. +23 −28 Random_Stream.h
  5. +31 −31 Stimulation.h
  6. +107 −116 Thalamic_Column.cpp
  7. +84 −79 Thalamic_Column.h
  8. +43 −42 Thalamus.cpp
  9. +47 −30 Thalamus_mex.cpp
View
@@ -1,32 +1,32 @@
/*
-* Copyright (c) 2015 Michael Schellenberger Costa
-*
-* Permission is hereby granted, free of charge, to any person obtaining a copy
-* of this software and associated documentation files (the "Software"), to deal
-* in the Software without restriction, including without limitation the rights
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-* THE SOFTWARE.
-*
-* AUTHORS: Michael Schellenberger Costa: mschellenbergercosta@gmail.com
-*
-* Based on: A thalamocortical neural mass model of the EEG during NREM sleep and its response
-* to auditory stimulation.
-* M Schellenberger Costa, A Weigenand, H-VV Ngo, L Marshall, J Born,
-* T Martinetz, JC Claussen.
-* PLoS Compuational Biology (in review)
-*/
+ * Copyright (c) 2015 University of Lübeck
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * AUTHORS: Michael Schellenberger Costa: mschellenbergercosta@gmail.com
+ *
+ * Based on: A thalamocortical neural mass model of the EEG during NREM sleep and its response
+ * to auditory stimulation.
+ * M Schellenberger Costa, A Weigenand, H-VV Ngo, L Marshall, J Born, T Martinetz,
+ * JC Claussen.
+ * PLoS Computational Biology In Review (in review).
+ */
/****************************************************************************************************/
/* Functions for data storage */
@@ -37,26 +37,11 @@
/****************************************************************************************************/
/* Save data */
/****************************************************************************************************/
-inline void get_data(int counter, Thalamic_Column& Col, double* Vt, double* Vr, double* ah) {
+void get_data(int counter, Thalamic_Column& Col, double* Vt, double* Vr, double* ah) {
Vt [counter] = Col.Vt [0];
Vr [counter] = Col.Vr [0];
ah [counter] = Col.act_h ();
}
/****************************************************************************************************/
/* end */
-/****************************************************************************************************/
-
-
-/****************************************************************************************************/
-/* Create MATLAB data container */
-/****************************************************************************************************/
-mxArray* SetMexArray(int N, int M) {
- mxArray* Array = mxCreateDoubleMatrix(0, 0, mxREAL);
- mxSetM(Array, N);
- mxSetN(Array, M);
- mxSetData(Array, mxMalloc(sizeof(double)*M*N));
- return Array;
-}
-/****************************************************************************************************/
-/* end */
-/****************************************************************************************************/
+/****************************************************************************************************/
View
@@ -3,17 +3,17 @@ CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
-TARGET = Thalamus.cpp
+TARGET = Thalamus.cpp
SOURCES += Thalamic_Column.cpp \
- Thalamus_mex.cpp \
- Thalamus.cpp
+ Thalamus.cpp \
+ Thalamus_mex.cpp
-HEADERS += Data_Storage.h \
- ODE.h \
- Random_Stream.h \
- Stimulation.h \
- Thalamic_Column.h
+HEADERS += ODE.h \
+ Data_Storage.h \
+ Random_Stream.h \
+ Stimulation.h \
+ Thalamic_Column.h
QMAKE_CXXFLAGS += -std=c++11 -O3
View
10 Plots.m
@@ -1,11 +1,11 @@
% mex command is given by:
-% mex CXXFLAGS="\$CXXFLAGS -std=c++11 -O3" Thalamus.cpp Thalamic_Column.cpp
+% mex CXXFLAGS="\$CXXFLAGS -std=c++11 -O3" Thalamus_mex.cpp Thalamic_Column.cpp
function Plots(T)
if nargin == 0
- Con = [ 0.063; % g_h
- 0.02; % g_LK_t
+ Con = [ 0.01; % g_h
+ 0.05; % g_LK
3; % N_tr
5; % N_rt
30]; % N_rr
@@ -23,9 +23,9 @@ function Plots(T)
70; % duration of the stimulus in ms
5; % time between stimuli in s
1]; % time until stimuli after min in ms
- T = 30; % duration of the simulation
+ T = 90; % duration of the simulation
end
-[Vt, Vr, ah] = Thalamus(T, Con, var_stim);
+[Vt, Vr, ah] = Thalamus_mex(T, Con, var_stim);
L = max(size(Vt));
timeaxis = linspace(0,T,L);
View
@@ -1,32 +1,27 @@
/*
-* Copyright (c) 2015 Michael Schellenberger Costa
-*
-* Permission is hereby granted, free of charge, to any person obtaining a copy
-* of this software and associated documentation files (the "Software"), to deal
-* in the Software without restriction, including without limitation the rights
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-* THE SOFTWARE.
-*
-* AUTHORS: Michael Schellenberger Costa: mschellenbergercosta@gmail.com
-*
-* Based on: A thalamocortical neural mass model of the EEG during NREM sleep and its response
-* to auditory stimulation.
-* M Schellenberger Costa, A Weigenand, H-VV Ngo, L Marshall, J Born,
-* T Martinetz, JC Claussen.
-* PLoS Compuational Biology (in review)
-*/
+ * Copyright (c) 2015 University of Lübeck
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * AUTHORS: Michael Schellenberger Costa: mschellenbergercosta@gmail.com
+ * Stefanie Gareis: gareis@inb.uni-luebeck.de
+ */
/****************************************************************************************************/
/* Random number streams */
View
@@ -1,32 +1,32 @@
/*
-* Copyright (c) 2015 Michael Schellenberger Costa
-*
-* Permission is hereby granted, free of charge, to any person obtaining a copy
-* of this software and associated documentation files (the "Software"), to deal
-* in the Software without restriction, including without limitation the rights
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-* THE SOFTWARE.
-*
-* AUTHORS: Michael Schellenberger Costa: mschellenbergercosta@gmail.com
-*
-* Based on: A thalamocortical neural mass model of the EEG during NREM sleep and its response
-* to auditory stimulation.
-* M Schellenberger Costa, A Weigenand, H-VV Ngo, L Marshall, J Born,
-* T Martinetz, JC Claussen.
-* PLoS Compuational Biology (in review)
-*/
+ * Copyright (c) 2015 University of Lübeck
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * AUTHORS: Michael Schellenberger Costa: mschellenbergercosta@gmail.com
+ *
+ * Based on: A thalamocortical neural mass model of the EEG during NREM sleep and its response
+ * to auditory stimulation.
+ * M Schellenberger Costa, A Weigenand, H-VV Ngo, L Marshall, J Born, T Martinetz,
+ * JC Claussen.
+ * PLoS Computational Biology In Review (in review).
+ */
/****************************************************************************************************/
/* Implementation of the stimulation protocol */
@@ -117,9 +117,9 @@ class Stim {
/* Create MATLAB container for marker storage */
mxArray* get_marker(void) {
mxArray* Marker = mxCreateDoubleMatrix(0, 0, mxREAL);
- mxSetM(Marker, 1);
- mxSetN(Marker, marker_stimulation.size());
- mxSetData(Marker, mxMalloc(sizeof(double)*marker_stimulation.size()));
+ mxSetM(Marker, 1);
+ mxSetN(Marker, marker_stimulation.size());
+ mxSetData(Marker, mxMalloc(sizeof(double)*marker_stimulation.size()));
double* Pr_Marker = mxGetPr(Marker);
for(unsigned i=0; i<marker_stimulation.size(); ++i) {
Pr_Marker[i] = marker_stimulation[i];
Oops, something went wrong.

0 comments on commit a3bfdae

Please sign in to comment.