Skip to content

Commit f276c78

Browse files
authored
Merge pull request #1732 from moritzdannhauer/TMS
TMS_modules
2 parents 5faa300 + d047060 commit f276c78

31 files changed

+7332
-0
lines changed

src/Core/Algorithms/BrainStimulator/BiotSavartSolverAlgorithm.cc

Lines changed: 831 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
For more information, please see: http://software.sci.utah.edu
3+
4+
The MIT License
5+
6+
Copyright (c) 2015 Scientific Computing and Imaging Institute,
7+
University of Utah.
8+
9+
License for the specific language governing rights and limitations under
10+
Permission is hereby granted, free of charge, to any person obtaining a
11+
copy of this software and associated documentation files (the "Software"),
12+
to deal in the Software without restriction, including without limitation
13+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+
and/or sell copies of the Software, and to permit persons to whom the
15+
Software is furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included
18+
in all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26+
DEALINGS IN THE SOFTWARE.
27+
*/
28+
29+
#ifndef ALGORITHMS_MATH_BiotSavartSolverAlgorithm_H
30+
#define ALGORITHMS_MATH_BiotSavartSolverAlgorithm_H
31+
32+
#include <Core/Datatypes/Legacy/Field/Mesh.h>
33+
#include <Core/Datatypes/Legacy/Field/Field.h>
34+
#include <Core/Datatypes/Matrix.h>
35+
36+
#include <Core/Algorithms/Base/AlgorithmBase.h>
37+
#include <Core/Algorithms/BrainStimulator/share.h>
38+
39+
///@file BiotSavartSolverAlgorithm
40+
///@brief
41+
///
42+
///
43+
///@author
44+
/// Implementation: Petar Petrov for SCIRun 4.7
45+
/// Converted to SCIRun5 by Moritz Dannhauer
46+
///@details
47+
///
48+
///
49+
50+
namespace SCIRun {
51+
namespace Core {
52+
namespace Algorithms {
53+
namespace BrainStimulator {
54+
55+
ALGORITHM_PARAMETER_DECL(Mesh);
56+
ALGORITHM_PARAMETER_DECL(Coil);
57+
ALGORITHM_PARAMETER_DECL(VectorBField);
58+
ALGORITHM_PARAMETER_DECL(VectorAField);
59+
ALGORITHM_PARAMETER_DECL(OutType);
60+
61+
class SCISHARE BiotSavartSolverAlgorithm : public AlgorithmBase
62+
{
63+
public:
64+
BiotSavartSolverAlgorithm()
65+
{
66+
istep=0.0;
67+
tfactor = 0;
68+
addParameter(Parameters::OutType,0);
69+
}
70+
AlgorithmOutput run(const AlgorithmInput& input) const override;
71+
bool run(FieldHandle mesh, FieldHandle coil, Datatypes::MatrixHandle &outdata, int outtype) const;
72+
73+
private:
74+
double istep;
75+
unsigned int tfactor;
76+
77+
};
78+
79+
}}}}
80+
81+
#endif

src/Core/Algorithms/BrainStimulator/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ SET(Algorithms_BrainStimulator_SRCS
3232
GenerateROIStatisticsAlgorithm.cc
3333
SetupRHSforTDCSandTMSAlgorithm.cc
3434
SimulateForwardMagneticFieldAlgorithm.cc
35+
BiotSavartSolverAlgorithm.cc
36+
ModelGenericCoilAlgorithm.cc
3537
)
3638

3739
SET(Algorithms_BrainStimulator_HEADERS
@@ -40,6 +42,8 @@ SET(Algorithms_BrainStimulator_HEADERS
4042
GenerateROIStatisticsAlgorithm.h
4143
SetupRHSforTDCSandTMSAlgorithm.h
4244
SimulateForwardMagneticFieldAlgorithm.h
45+
BiotSavartSolverAlgorithm.h
46+
ModelGenericCoilAlgorithm.h
4347
share.h
4448
)
4549

0 commit comments

Comments
 (0)