Skip to content

Commit 07afbb2

Browse files
authored
Merge branch 'master' into glm
2 parents 4ed23cb + 3adf6dc commit 07afbb2

File tree

718 files changed

+949
-181905
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

718 files changed

+949
-181905
lines changed

.github/workflows/mac.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ jobs:
4949
name: SCIRunMacInstaller
5050
path: bin/SCIRun/SCIRun-5.0.beta.*-Darwin.pkg
5151

52-
- name: Deploy
53-
id: deploy
54-
if: github.ref == 'refs/heads/master'
55-
uses: marvinpinto/action-automatic-releases@latest
56-
with:
57-
repo_token: "${{ secrets.GITHUB_TOKEN }}"
58-
automatic_release_tag: "dev-mac"
59-
prerelease: true
60-
title: "Development Build for Mac"
61-
files: |
62-
bin/SCIRun/SCIRun-5.0.beta.*-Darwin.pkg
52+
# - name: Deploy
53+
# id: deploy
54+
# if: github.ref == 'refs/heads/master'
55+
# uses: marvinpinto/action-automatic-releases@latest
56+
# with:
57+
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
58+
# automatic_release_tag: "dev-mac"
59+
# prerelease: true
60+
# title: "Development Build for Mac"
61+
# files: |
62+
# bin/SCIRun/SCIRun-5.0.beta.*-Darwin.pkg
6363

6464
mac-build-headless:
6565

.github/workflows/windows.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ jobs:
120120
name: SCIRunWindowsPythonInstaller
121121
path: bin/SCIRun/SCIRun-5.0.beta.*-win64.exe
122122

123-
- name: Deploy
124-
if: github.ref == 'refs/heads/master'
125-
uses: marvinpinto/action-automatic-releases@latest
126-
with:
127-
repo_token: "${{ secrets.GITHUB_TOKEN }}"
128-
automatic_release_tag: "dev-windows"
129-
prerelease: true
130-
title: "Development Build for Windows"
131-
files: |
132-
bin/SCIRun/SCIRun-5.0.beta.*-win64.exe
123+
# - name: Deploy
124+
# if: github.ref == 'refs/heads/master'
125+
# uses: marvinpinto/action-automatic-releases@latest
126+
# with:
127+
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
128+
# automatic_release_tag: "dev-windows"
129+
# prerelease: true
130+
# title: "Development Build for Windows"
131+
# files: |
132+
# bin/SCIRun/SCIRun-5.0.beta.*-win64.exe

docs/_includes/modules/CalculateFieldData.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The output needs to be stored in the variable ```RESULT```.
4545

4646
#### Available Functions
4747

48-
A list of available functions is available in the GUI of the module. The ***Parser Help*** button brings up a list of available functions to do scalar/vector/tensor algebra and to view the functions that can be applied to the ```ELEMENT``` variable.
48+
A list of available functions is available in the GUI of the module. The [Parser Help](/SCIRun/parserhelp.html)button brings up a list of available functions to do scalar/vector/tensor algebra and to view the functions that can be applied to the ```ELEMENT``` variable.
4949

5050
#### Input Ports
5151

@@ -63,7 +63,7 @@ Suppose one wants to set the data values to a certain value:
6363
RESULT = 2;
6464
```
6565

66-
This will set every data value inside the Field equal to the value 2.
66+
This will set every data value inside the Field equal to the value 2.
6767

6868
Similarly one can set the data value to a value specified inside the first Matrix on the input ports:
6969

docs/_includes/modules/CalculateMeshNodes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This module allows the computation of a new position for each node in the input
4444

4545
#### Available Functions
4646

47-
A list of available functions is available in the GUI of the module. The ***Parser Help*** button brings up a list of available functions to do scalar/vector/tensor algebra.
47+
A list of available functions is available in the GUI of the module. The [Parser Help](/SCIRun/parserhelp.html) button brings up a list of available functions to do scalar/vector/tensor algebra.
4848

4949
#### Input Ports
5050

docs/_includes/modules/ClipFieldByFunction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ This module selects a subset of a field.
2424

2525
The ClipFieldByFunction module clips out a subset of a field by preserving all of the elements in the input field for which the user specified expression evaluates to true at the specified test location. As a side effect of this algorithm is that any degenerate non-element items in the input field are discarded by the clip.
2626

27-
The type of the field is preserved in the clip, as well as the data values if possible. Some field types are structured and thus not clippable. This includes the LatVolField, ImageField, and Scanline field types.
27+
The type of the field is preserved in the clip, as well as the data values if possible. Some field types are structured and thus not clippable. This includes the LatVolField, ImageField, and Scanline field types.
2828

29-
The expression should be a SCIRun parser expression. The module UI has a help button that will bring up documentation for the parser. For node centered data, select clipping location from One Node, Most Nodes or All Nodes. For cell centered data, select Element Center.
29+
The expression should be a SCIRun parser expression. The module UI has a help button that will bring up documentation for the parser which can also be found [here](/SCIRun/parserhelp.html). For node centered data, select clipping location from One Node, Most Nodes or All Nodes. For cell centered data, select Element Center.
3030

3131
The ClipFieldByFunction module takes an **input** field, and optionally a function string and/or one or more additional matrices that may be used in the function.
3232

docs/parserhelp.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
---
2+
title: Parser Help
3+
category: info
4+
tags: parser
5+
layout: default_toc
6+
---
7+
8+
<link rel="stylesheet" href="css/main.css">
9+
10+
## Parser Description
11+
12+
13+
### Overview
14+
15+
The SCIRun parser is designed to give the user the ability to evaluate almost any expression at the elements of a matrix or field. The underlying engine of the parser assumes that every field or matrix can be represented by an array of scalars, vectors, or tensors. For example a field can be represented by an array of scalars for the field data and an array of vectors for the locations of the nodes. In order to maintain a reasonable performance while interpreting a user defined function, the engine will apply each mathematical operations to the full array at same time. The logic of the parser will allow the user to write several expression at the same time, which will optimized to remove any duplicate function calls and the operations will be untangled in a series of elementary operations that have to be executed.
16+
17+
18+
### Using the parser
19+
20+
Each parser has several preloaded variables available to the user. These preloaded variables in SCIRun are always denoted with an upper case variable name. For example for the [CalculateFieldData](modules.html#CalculateFieldData) has the following variables available:
21+
22+
`DATA, X,Y,Z, POS`
23+
24+
The variables can be used in the user to construct a new variable. For example, one can write the following equation:
25+
26+
`MYDATA = sin(X)+cos(Y);`
27+
28+
This will assign the value of `sin(X) + cos(Y)` to `MYDATA`, where `X` and `Y` are the arrays containing the `X` and `Y` positions of the nodes. Note that to generate a new variable, no new variable type needs to be declared. The parser will automatically derive the type of the output variable. For example the following case will generate vector data:
29+
30+
`MYDATA = vector(Y,X,2*Z);`
31+
32+
As the output of the expression is a vector `MYDATA` will now be an array of vectors instead of an array of scalars as in the previous example.
33+
34+
To assign any data to the output of a module, certain variables need to be assigned. For example in case of the [CalculateFieldData](modules.html#CalculateFieldData), the output variable is called `RESULT` and hence a second expression can be added to assign the newly created vector to the output:
35+
36+
`MYDATA = vector(Y,X,2*Z); RESULT = MYDATA;`
37+
38+
Now this expression could have been simplified to one expression, which would result in the same operation:
39+
40+
`RESULT = vector(Y,X,2*Z);`
41+
42+
From a performance perspective both would be evaluated equally fast as, copying operations are generally removed by the internal optimizer. However to increase user readability one can split an expression in as many pieces as one wants. For example, the following expression is a perfectly valid expression:
43+
44+
`DX = X-3; DY = Y-4; DZ = Z - 2; RESULT = norm(vector(DX,DY,DZ));`
45+
46+
Hence the general grammar of the expression is:
47+
48+
`VAR1 = function(...);` `VAR2 = function(...);` `VAR3 = function(...);` ... etc
49+
50+
The array parser generally allows two types of input, an array with one element, or an array with many elements. When combining multiple fields or matrices, the arrays with many elements are required to have the same number of elements and the math operations are done by taking corresponding elements from each array. However an array with one element is treated special, and its value is used for every element for the arrays that have many arrays. For example, assume matrix `A = [1]`, and `B = [1,2,3,4]`. We can now evaluate the following expression:
51+
52+
`RESULT = A+B;`
53+
54+
In this case `RESULT` will be `[1+1,2+1,3+1,4+1]` and hence allows for scalar parameters to be added into the expressions.
55+
56+
57+
58+
### Available functions
59+
60+
The following basic operators have been implemented for Scalars, Vectors, and Tensors:
61+
62+
`+`, `-`, `*`, `/`, `==`, `!=`, `!`, `&&`, `||`
63+
64+
In addition to these operators the following functions are available:
65+
66+
- `add()`
67+
- `sub()`
68+
- `mult()`
69+
- `div()`
70+
- `exp()`
71+
- `log()`
72+
- `ln()`
73+
- `log2()`
74+
- `log10()`
75+
- `sin()`
76+
- `cos()`
77+
- `tan()`
78+
- `asin()`
79+
- `acos()`
80+
- `atan()`
81+
- `sinh()`
82+
- `cosh()`
83+
- `asinh()`
84+
- `acosh()`
85+
- `pow()`
86+
- `ceil()`
87+
- `floor()`
88+
- `round()`
89+
- `boolean()`
90+
- `norm()`
91+
- `isnan()`
92+
- `isfinite()`
93+
- `isinfinite()`
94+
- `select()`
95+
- `sign()`
96+
- `sqrt()`
97+
- `not()`
98+
- `inv()`
99+
- `abs()`
100+
- `and()`
101+
- `or()`
102+
- `eq()`
103+
- `neq()`
104+
105+
106+
107+
**For vectors the following functions are available:**
108+
109+
To construct a vector use the following function:
110+
111+
`MYVECTOR = vector(X,Y,Z);`
112+
113+
To access the components of a vector use the following functions:
114+
115+
`X = x(MYVECTOR);` `Y = y(MYVECTOR);` `Z = z(MYVECTOR);`
116+
117+
The following vector specific functions are available:
118+
119+
- `dot()`
120+
- `cross()`
121+
- `normalize()`
122+
- `find_normal1()`
123+
- `find_normal2()`
124+
125+
**For tensors the following functions are available:**
126+
127+
To construct a tensor use the following functions:
128+
129+
`MYTENSOR = tensor(XX,XY,XZ,YY,YZ,ZZ);`
130+
131+
`MYTENSOR = tensor(SCALAR);`
132+
133+
`MYTENSOR = tensor(EIGVEC1,EIGVEC2,EIGVAl1,EIGVAL2,EIGVAL3);`
134+
135+
To access the components of a tensor use the following functions:
136+
137+
`XX = xx(MYTENSOR); XY = xy(MYTENSOR); XZ = xz(MYTENSOR);`
138+
139+
`YY = yy(MYTENSOR); YZ = yz(MYTENSOR); ZZ = zz(MYTENSOR);`
140+
141+
`EIGVEC1 = eigvec1(MYTENSOR); EIGVEC2 = eigvec2(MYTENSOR); EIGVEC3 = eigvec3(MYTENSOR)`
142+
143+
`EIGVAL1 = eigval1(MYTENSOR); EIGVAL2 = eigval2(MYTENSOR); EIGVAL3 = eigval3(MYTENSOR);`
144+
145+
146+
147+
**The following tensor specific functions are available:**
148+
149+
`quality()`, `trace`, `det()`, `frobenius()`, `frobenius2()`, `fracanisotropy()`
150+
151+
For converting any Scalar, Vector or Tensor in to a boolean, e.g. whether all components are equal to zero or not, the function `boolean()` provided:
152+
153+
`RESULT = boolean(vector(X,0,Z));`
154+
155+
`RESULT = boolean(vector(X,0,Z)) || boolean(tensor(4)*0);`
156+
157+
The `select()` function works like the C/C++ ternary `?:` operator:
158+
159+
`RESULT = select(X>2,1,0);`
160+
161+
To insert a random number two functions are provided, `rand()` and `randv()`. Neither of them take any input. The first one just render a single random number and the second renders an array of the same size as the other arrays. For example to render uniform distributed noise between 0 and 2 for a field, use the following expression:
162+
163+
`RESULT = 2*randv();`
164+
165+
If on the other hand all the values need to be the same, but one random value, use :
166+
167+
`RESULT = rand();`
168+
169+
Finally, we have an object called element, which refers to the element of a mesh. The latter only exists as an input object, but allows the user to query, properties like element quality metrics and sizes. Currently the following functions are implemented:
170+
171+
`center()`,`volume()`,`size()`,`length()`,`area()`,`dimension()`

docs/user.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ layout: default
88
### User Guide
99

1010
- [Python API 0.2](python.html)
11+
- [Parser Help](parserhelp.html)
1112

1213
### Tutorials
1314
- [Basic Tutorial](BasicTutorial.html)

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,6 @@ IF(BUILD_TESTING)
861861
ENDIF()
862862
ENDIF()
863863

864-
SET_PROPERTY(TARGET cleaver PROPERTY FOLDER "Externals")
865864
SET_PROPERTY(TARGET xml2 PROPERTY FOLDER "Externals")
866865

867866
IF(BUILD_WITH_PYTHON)

src/Core/Algorithms/Factory/HardCodedAlgorithmFactory.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
#include <Core/Algorithms/BrainStimulator/GenerateROIStatisticsAlgorithm.h>
8787
#include <Core/Algorithms/BrainStimulator/SetupRHSforTDCSandTMSAlgorithm.h>
8888
#include <Core/Algorithms/BrainStimulator/SimulateForwardMagneticFieldAlgorithm.h>
89-
#include <Core/Algorithms/Field/InterfaceWithCleaverAlgorithm.h>
9089
#include <Core/Algorithms/Legacy/Fields/Mapping/ApplyMappingMatrix.h>
9190
#include <Core/Algorithms/Legacy/Fields/ClipMesh/ClipMeshBySelection.h>
9291
#include <Core/Algorithms/Legacy/Fields/FieldData/SetFieldDataToConstantValue.h>
@@ -143,7 +142,6 @@ void HardCodedAlgorithmFactory::addToMakerMap()
143142
ADD_MODULE_ALGORITHM(AddKnownsToLinearSystem, AddKnownsToLinearSystemAlgo)
144143
ADD_MODULE_ALGORITHM(CalculateVectorMagnitudes, CalculateVectorMagnitudesAlgo)
145144
ADD_MODULE_ALGORITHM(BuildFEMatrix, BuildFEMatrixAlgo)
146-
ADD_MODULE_ALGORITHM(InterfaceWithCleaver, InterfaceWithCleaverAlgorithm)
147145
ADD_MODULE_ALGORITHM(GetFieldData, GetFieldDataAlgo)
148146
ADD_MODULE_ALGORITHM(SetFieldData, SetFieldDataAlgo)
149147
ADD_MODULE_ALGORITHM(GetMatrixSlice, GetMatrixSliceAlgo)

src/Core/Algorithms/Field/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@
2828

2929
SET(Algorithms_Field_SRCS
3030
ReportFieldInfoAlgorithm.cc
31-
InterfaceWithCleaverAlgorithm.cc
3231
InterfaceWithCleaver2Algorithm.cc
3332
CalculateNodeLocationFrequencyAlgorithm.cc
3433
RefineTetMeshLocallyAlgorithm.cc
3534
)
3635

3736
SET(Algorithms_Field_HEADERS
3837
ReportFieldInfoAlgorithm.h
39-
InterfaceWithCleaverAlgorithm.h
4038
InterfaceWithCleaver2Algorithm.h
4139
CalculateNodeLocationFrequencyAlgorithm.h
4240
RefineTetMeshLocallyAlgorithm.h
@@ -52,7 +50,6 @@ TARGET_LINK_LIBRARIES(Algorithms_Field
5250
Core_Datatypes
5351
Core_Datatypes_Legacy_Field
5452
Algorithms_Base
55-
cleaver
5653
Core_Algorithms_Legacy_Fields
5754
${SCI_BOOST_LIBRARY}
5855
${SCI_CLEAVER2_LIBRARY}

0 commit comments

Comments
 (0)