Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ttk
spam
Commits
8ed1f7eb
Commit
8ed1f7eb
authored
Nov 29, 2017
by
Edward Andò
Browse files
Client fixes
parent
8e5606cf
Pipeline
#1383
passed with stages
in 1 minute and 23 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
clients/DICregularGridClientIncremental.py
View file @
8ed1f7eb
...
...
@@ -55,7 +55,7 @@ for im1number in range( im4D.shape[0]-1 ):
im1
=
im4D
[
im1number
]
im2
=
im4D
[
im1number
+
1
]
nodePositions
=
randomwaffle
.
DIC
.
grid
.
makeGrid
(
im1
.
shape
,
args
.
NS
)
nodePositions
,
nodesDim
=
randomwaffle
.
DIC
.
grid
.
makeGrid
(
im1
.
shape
,
args
.
NS
)
# Initialise field of Fs with the identity matrix
Ffield
=
numpy
.
zeros
(
(
nodePositions
.
shape
[
0
],
4
,
4
)
)
...
...
@@ -96,9 +96,10 @@ for im1number in range( im4D.shape[0]-1 ):
if
args
.
VTK
:
cellData
=
{
'pixelSearch-CC'
:
pixelSearchCC
,
'subpixel-displacements-xyz'
:
Ffield
[
:,
-
2
::
-
1
,
3
],
'subpixel-error'
:
subpixelError
,
'subpixel-iterations'
:
subpixelIterations
,
'subpixel-returnStatus'
:
subpixelReturnStatus
,
'subpixel-error'
:
subPixelReturns
[
'subpixelError'
],
'subpixel-iterations'
:
subPixelReturns
[
'subpixelIterations'
],
'subpixel-returnStatus'
:
subPixelReturns
[
'subpixelReturnStatus'
],
'subpixel-deltaFnorm'
:
subPixelReturns
[
'subpixelDeltaFnorm'
]
}
randomwaffle
.
helpers
.
rwvtk
.
write_structured_grid
(
(
numpy
.
array
(
nodesDim
)
+
1
)[::
-
1
],
cell_data
=
cellData
,
filename
=
args
.
OUT_DIR
+
"/"
+
args
.
PREFIX
+
"-"
+
step
+
'.vtk'
)
...
...
@@ -109,26 +110,31 @@ for im1number in range( im4D.shape[0]-1 ):
# F[0:3,0:2]
# Pixel-search CC
# SubPixError, SubPixIterations, SubPixelReturnStatus
outMatrix
=
numpy
.
array
(
[
numpy
.
array
(
range
(
nodePositions
.
shape
[
0
]
)),
nodePositions
[:,
0
],
nodePositions
[:,
1
],
nodePositions
[:,
2
],
Ffield
[:,
0
,
3
],
Ffield
[:,
1
,
3
],
Ffield
[:,
2
,
3
],
Ffield
[:,
0
,
0
],
Ffield
[:,
0
,
1
],
Ffield
[:,
0
,
2
],
Ffield
[:,
1
,
0
],
Ffield
[:,
1
,
1
],
Ffield
[:,
1
,
2
],
Ffield
[:,
2
,
0
],
Ffield
[:,
2
,
1
],
Ffield
[:,
2
,
2
],
pixelSearchCC
,
subpixelError
,
subpixelIterations
,
subpixelReturnStatus
]
).
T
TSVheader
=
"NodeNumber
\t
Zpos
\t
Ypos
\t
Xpos
\t
Zdisp
\t
Ydisp
\t
Xdisp
\t
F11
\t
F12
\t
F13
\t
F21
\t
F22
\t
F23
\t
F31
\t
F32
\t
F33"
outMatrix
=
numpy
.
array
(
[
numpy
.
array
(
range
(
nodePositions
.
shape
[
0
]
)),
nodePositions
[:,
0
],
nodePositions
[:,
1
],
nodePositions
[:,
2
],
Ffield
[:,
0
,
3
],
Ffield
[:,
1
,
3
],
Ffield
[:,
2
,
3
],
Ffield
[:,
0
,
0
],
Ffield
[:,
0
,
1
],
Ffield
[:,
0
,
2
],
Ffield
[:,
1
,
0
],
Ffield
[:,
1
,
1
],
Ffield
[:,
1
,
2
],
Ffield
[:,
2
,
0
],
Ffield
[:,
2
,
1
],
Ffield
[:,
2
,
2
]
]
).
T
if
args
.
PS
:
outMatrix
=
numpy
.
hstack
(
[
outMatrix
,
numpy
.
array
([
pixelSearchCC
]).
T
]
)
TSVheader
=
TSVheader
+
"
\t
PSCC"
if
args
.
SUBPIXEL
:
outMatrix
=
numpy
.
hstack
([
outMatrix
,
numpy
.
array
(
[
subPixelReturns
[
'subpixelError'
],
subPixelReturns
[
'subpixelIterations'
],
subPixelReturns
[
'subpixelReturnStatus'
],
subPixelReturns
[
'subpixelDeltaFnorm'
]
]
).
T
]
)
TSVheader
=
TSVheader
+
"
\t
SubPixError
\t
SubPixIterations
\t
SubPixReturnStat
\t
SubPixDeltaFnorm"
numpy
.
savetxt
(
args
.
OUT_DIR
+
"/"
+
args
.
PREFIX
+
"-"
+
step
+
".tsv"
,
outMatrix
,
fmt
=
'%.7f'
,
delimiter
=
'
\t
'
,
newline
=
'
\n
'
,
comments
=
''
,
header
=
"NodeNumber
\t
Zpos
\t
Ypos
\t
Xpos
\t
"
+
"Zdisp
\t
Ydisp
\t
Xdisp
\t
"
+
"F11
\t
F12
\t
F13
\t
"
+
"F21
\t
F22
\t
F23
\t
"
+
"F31
\t
F32
\t
F33
\t
"
+
"PS-CC
\t
SubPixError
\t
SubPixIterations
\t
SubPixReturnStat"
)
header
=
TSVheader
)
if
args
.
TIF
:
...
...
clients/tsvToTIFF.py
View file @
8ed1f7eb
...
...
@@ -43,7 +43,7 @@ if __name__ == "__main__":
fileName
=
sys
.
argv
[
1
]
if
os
.
path
.
isfile
(
fileName
):
tsvToTIFF
(
fileName
)
tsvToTIFF
(
fileName
,
prefix
=
os
.
path
.
basename
(
fileName
)[
0
:
-
4
]
)
else
:
print
(
"
\t
tsvToTIFF(): {} is not a file"
.
format
(
fileName
)
)
...
...
tools/DIC/grid.py
View file @
8ed1f7eb
...
...
@@ -44,7 +44,7 @@ def makeGrid( imageSize, nodeSpacing ):
nodePositions
[:,
1
]
=
nodesMgrid
[
1
].
ravel
()
nodePositions
[:,
2
]
=
nodesMgrid
[
2
].
ravel
()
return
nodePositions
return
nodePositions
,
nodesDim
...
...
@@ -326,5 +326,5 @@ def subPixel( im1, im2,
"subpixelError"
:
subpixelError
,
"subpixelIterations"
:
subpixelIterations
,
"subpixelReturnStatus"
:
subpixelReturnStatus
,
"subpixelDeltaFnorm"
:
subpixelDeltaFnorm
"subpixelDeltaFnorm"
:
subpixelDeltaFnorm
,
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment