From baf0818649b1f19cc616014df3f52a9db56800bd Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Tue, 29 Dec 2015 21:32:46 +0100 Subject: [PATCH] General code cleanup. Updated the license. Removed dependency on boost libraries --- Data_Storage.h | 10 +++++++++- Random_Stream.h | 52 ++++++++++++++++++++++++++++------------------------ Stimulation.h | 10 +++++++++- Thalamic_Column.cpp | 14 +++++++++++--- Thalamic_Column.h | 12 ++++++++++-- Thalamus.cpp | 10 +++++++++- Thalamus_mex.cpp | 12 ++++++++++-- 7 files changed, 86 insertions(+), 34 deletions(-) diff --git a/Data_Storage.h b/Data_Storage.h index ff7c3a3..ed0d682 100644 --- a/Data_Storage.h +++ b/Data_Storage.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2014 Michael Schellenberger Costa +* 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 @@ -18,6 +18,14 @@ * 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) */ /****************************************************************************************************/ diff --git a/Random_Stream.h b/Random_Stream.h index abd6c10..b4e7270 100644 --- a/Random_Stream.h +++ b/Random_Stream.h @@ -1,28 +1,32 @@ /* - * 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 - * - */ +* 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) +*/ /****************************************************************************************************/ /* Random number streams */ diff --git a/Stimulation.h b/Stimulation.h index b00fa70..39786b8 100644 --- a/Stimulation.h +++ b/Stimulation.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2014 Michael Schellenberger Costa +* 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 @@ -18,6 +18,14 @@ * 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) */ /****************************************************************************************************/ diff --git a/Thalamic_Column.cpp b/Thalamic_Column.cpp index 80371c0..7fc94a3 100644 --- a/Thalamic_Column.cpp +++ b/Thalamic_Column.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2014 Michael Schellenberger Costa +* 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 @@ -18,6 +18,14 @@ * 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) */ /****************************************************************************************************/ @@ -265,8 +273,8 @@ void Thalamic_Column::set_RK (int N) { y_rr [N+1] = y_rr [0] + A[N]*dt*(x_rr[N]); x_et [N+1] = x_et [0] + A[N]*dt*(pow(gamma_e, 2) * ( - y_et[N]) - 2 * gamma_e * x_et[N]) + noise_xRK(N,0); x_er [N+1] = x_er [0] + A[N]*dt*(pow(gamma_e, 2) * (N_tr * get_Qt(N) - y_er[N]) - 2 * gamma_e * x_er[N]); - x_rt [N+1] = x_rt [0] + A[N]*dt*(pow(gamma_i, 2) * (N_rt * get_Qr(N) - y_rt[N]) - 2 * gamma_i * x_rt[N]); - x_rr [N+1] = x_rr [0] + A[N]*dt*(pow(gamma_i, 2) * (N_rr * get_Qr(N) - y_rr[N]) - 2 * gamma_i * x_rr[N]); + x_rt [N+1] = x_rt [0] + A[N]*dt*(pow(gamma_r, 2) * (N_rt * get_Qr(N) - y_rt[N]) - 2 * gamma_r * x_rt[N]); + x_rr [N+1] = x_rr [0] + A[N]*dt*(pow(gamma_r, 2) * (N_rr * get_Qr(N) - y_rr[N]) - 2 * gamma_r * x_rr[N]); } /****************************************************************************************************/ /* end */ diff --git a/Thalamic_Column.h b/Thalamic_Column.h index 70a288c..59e201e 100644 --- a/Thalamic_Column.h +++ b/Thalamic_Column.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2014 Michael Schellenberger Costa +* 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 @@ -18,6 +18,14 @@ * 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) */ /************************************************************************************************/ @@ -152,7 +160,7 @@ class Thalamic_Column { /* PSP rise time in ms^-1 */ const double gamma_e = 70E-3; - const double gamma_i = 100E-3; + const double gamma_r = 100E-3; /* Conductivities in mS/cm^-2 */ /* Leak current */ diff --git a/Thalamus.cpp b/Thalamus.cpp index 1b63c2b..49ca487 100644 --- a/Thalamus.cpp +++ b/Thalamus.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2014 Michael Schellenberger Costa +* 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 @@ -18,6 +18,14 @@ * 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) */ /****************************************************************************************************/ diff --git a/Thalamus_mex.cpp b/Thalamus_mex.cpp index ed2bc1b..ff2f1ab 100644 --- a/Thalamus_mex.cpp +++ b/Thalamus_mex.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2014 Michael Schellenberger Costa +* 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 @@ -18,12 +18,20 @@ * 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) */ /****************************************************************************************************/ /* Implementation of the simulation as MATLAB routine (mex compiler) */ /* mex command is given by: */ -/* mex CXXFLAGS="\$CXXFLAGS -std=gnu++0x -fpermissive" Thalamus_mew.cpp Thalamic_Column.cpp */ +/* mex CXXFLAGS="\$CXXFLAGS -std=gnu++0x -fpermissive" Thalamus_mex.cpp Thalamic_Column.cpp */ /****************************************************************************************************/ #include "mex.h" #include "matrix.h"