Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit a9c986dc authored by Gustavo Pinzon's avatar Gustavo Pinzon
Browse files

Merge branch 'master' of https://gricad-gitlab.univ-grenoble-alpes.fr/ttk/spam into ddicTools

parents 93d8d383 2c36367f
......@@ -63,3 +63,6 @@ ttkvenv
# latex
*.aux
*.log
# code OSS
.vscode
......@@ -66,6 +66,8 @@ Changelog
+----------------+------------+--------------------------------------------------------------------------------------------------------------------------------------+
| Version | Date | Notes |
+================+============+======================================================================================================================================+
| Version 0.5.3.2| 2020-10-27 | spam-ereg-discrete mask option reinstated, many fixes for spam-ldic and registerMultiscale() for 2D images |
+----------------+------------+--------------------------------------------------------------------------------------------------------------------------------------+
| Version 0.5.3.1| 2020-10-23 | spam-ereg-discrete make safer with slicePadded and moveGrains now renamed to moveLabels and proposed as function with erodeLabels |
+----------------+------------+--------------------------------------------------------------------------------------------------------------------------------------+
| Version 0.5.3 | 2020-10-07 | Improvements in edge cases in spam-ldic and spam-ddic, thanks to a helper function called spam.helpers.slicePadded(). |
......
......@@ -75,7 +75,7 @@ System dependencies for Debian/Ubuntu Linux
$ sudo apt install git python3-dev python3-virtualenv python3-tk gcc g++ libeigen3-dev r-base libicu-dev libgmp-dev libmpfr-dev mpi-default-bin mpi-default-dev libcgal-dev gmsh libfreetype6-dev libxml2-dev libxslt-dev
Please see note for version 20.04 of Ubuntu [*]_. Now you're ready to go to: :ref:`installVenv`
Now you're ready to go to: :ref:`installVenv`
|
|
......@@ -216,20 +216,25 @@ System dependencies for Windows 10
If you're on Windows 10, please install `Ubuntu 18.04 WSL`_ (Windows Subsystem for Linux), and follow :ref:`debianDepends`.
In order for graphs and images to appear with `matplotlib` you need to first install `XMing`_ and have it running.
In order for graphs and images to appear with `matplotlib` you need to first install `VcXsrv`_ and have it running (otherwise `XMing`_ can also work).
In your Ubuntu subsystem you must then run the following in the terminal:
.. _Ubuntu 18.04 WSL: https://www.microsoft.com/en-us/p/ubuntu-1804-lts/9n9tngvndl3q
.. _XMing: https://sourceforge.net/projects/xming/
.. code-block:: bash
echo "export DISPLAY=:0;" >> ~/.bashrc
Now you're ready to go to: :ref:`installVenv`
Now you're ready to go to: :ref:`installVenv`.
Note: If you'd like to run VSCode in Windows 10 and run spam in WSL it is possible, please follow `these`_ `three`_ `links`_.
.. _Ubuntu 18.04 WSL: https://www.microsoft.com/en-us/p/ubuntu-1804-lts/9n9tngvndl3q
.. _XMing: https://sourceforge.net/projects/xming/
.. _VcXsrv: https://sourceforge.net/projects/vcxsrv/
.. _these: https://code.visualstudio.com/docs/remote/wsl-tutorial
.. _three: https://code.visualstudio.com/docs/python/python-tutorial
.. _links: https://code.visualstudio.com/docs/python/environments
|
|
|
......@@ -490,8 +495,3 @@ Longer and cleaner solution :
...
adding 'tifffile/_tifffile.so'
...
.. [*] There is a temporary problem in generating builds consistent with PyPi with this version.
The easiest fix is to uncomment the ==N.M.O.P values from requirements.txt for the following: numpy, tifffile, SimpleITK, mpi4py, pybind11, opencv-python, lxml
......@@ -98,6 +98,7 @@ class MainWindow(QWidget):
nonConvergedGrain = self.nonConvergedGrains[self.N]
print("\tGrain {}".format(nonConvergedGrain))
print("\t\tPosition in reference image: {}".format(REFlabCOM[nonConvergedGrain]))
Phi = DDIC['PhiField'][nonConvergedGrain]
......@@ -112,6 +113,7 @@ class MainWindow(QWidget):
boundingBoxes=REFlabBB, centresOfMass=REFlabCOM,
labelDilate=args.LABEL_DILATE, margin=args.margin,
maskOtherLabels=args.MASK)
# 2020-10-23: EA on Issue #186: using spam.helpers.slicePadded
REFsubvol = spam.helpers.slicePadded(REFgrey, REFgl['boundingBox']+numpy.array([0,1,0,1,0,1]))
......@@ -120,7 +122,6 @@ class MainWindow(QWidget):
REFsubvol[REFgl['subvol'] == 0] = 0
# 2020-10-23: EA on Issue #186: using spam.helpers.slicePadded
REFsubvol = spam.helpers.slicePadded(REFgrey, REFgl['boundingBox']+numpy.array([0,1,0,1,0,1]))
DEFsubvol = spam.helpers.slicePadded(DEFgrey, REFgl['boundingBox']+
numpy.array([0,1,0,1,0,1])+
numpy.array([displacementInt[0], displacementInt[0],
......
......@@ -122,7 +122,10 @@ if not args.Q8:
fileNameBase = args.OUT_DIR+"/"+args.PREFIX+"-strain-Geers"
mode = "Geers"
else:
fileNameBase = args.OUT_DIR+"/"+args.PREFIX+"-strain-Q8"
if twoD:
fileNameBase = args.OUT_DIR+"/"+args.PREFIX+"-strain-Q4"
else:
fileNameBase = args.OUT_DIR+"/"+args.PREFIX+"-strain-Q8"
mode = "Q8"
# Save strain fields
......
......@@ -99,7 +99,7 @@ name = 'spam'
description = 'Software for the Practical Analysis of Materials'
long_description = readReadMe('README.rst')
long_description_content_type = 'text/x-rst'
version = '0.5.3.1'
version = '0.5.3.2'
author = 'SPAM authors'
author_email = 'edward.ando@3sr-grenoble.fr'
copyright = 'SPAM authors 2020'
......
"""
"""
Library of SPAM functions for dealing with fields of Phi or fields of F
Copyright (C) 2020 SPAM Contributors
......@@ -187,7 +187,6 @@ def FfieldRegularGeers(displacementField, nodeSpacing, neighbourRadius=1.5, mask
FfieldFlat = numpy.zeros((nNodes, 3, 3))
#Define field coordinates for KD-tree distance calculation, warning, the top point is at zero
fieldCoordsFlat = numpy.mgrid[0:dims[0],0:dims[1],0:dims[2]].reshape(3, nNodes).T*nodeSpacing
fieldCoordsFlat = numpy.mgrid[nodeSpacing[0]:dims[0]*nodeSpacing[0]+nodeSpacing[0]:nodeSpacing[0],
nodeSpacing[1]:dims[1]*nodeSpacing[1]+nodeSpacing[1]:nodeSpacing[1],
nodeSpacing[2]:dims[2]*nodeSpacing[2]+nodeSpacing[2]:nodeSpacing[2]].reshape(3, nNodes).T
......@@ -211,7 +210,6 @@ def FfieldRegularGeers(displacementField, nodeSpacing, neighbourRadius=1.5, mask
treeCoord = scipy.spatial.KDTree(fieldCoordsFlatGood)
FfieldFlatGood = numpy.zeros_like(FfieldFlat[goodPointsMask])
#for n in pbar(range(nNodes)):
for goodPoint in pbar(range(fieldCoordsFlatGood.shape[0])):
#This is for the linear model, equation 15 in Geers
centralNodePosition = fieldCoordsFlatGood[goodPoint]
......@@ -256,7 +254,7 @@ def FfieldRegularGeers(displacementField, nodeSpacing, neighbourRadius=1.5, mask
for v in range(3):
#sX0X0[u, v] += nodalRelativePositionsRef[neighbour, u] * nodalRelativePositionsRef[neighbour, v]
#sX0Xt[u, v] += nodalRelativePositionsRef[neighbour, u] * nodalRelativePositionsDef[neighbour, v]
# Proposed solution for #142
# Proposed solution for #142 for direction of rotation
sX0X0[v, u] += nodalRelativePositionsRef[neighbour, u] * nodalRelativePositionsRef[neighbour, v]
sX0Xt[v, u] += nodalRelativePositionsRef[neighbour, u] * nodalRelativePositionsDef[neighbour, v]
......@@ -416,14 +414,19 @@ def decomposeFfield(Ffield, components, twoD=False):
output = {}
for component in components:
output[component] = []
if component == 'vol' or component == 'dev' or component == 'volss' or component == 'devss':
output[component] = numpy.zeros(fieldRavelLength)
if component == 'r' or component == 'z':
output[component] = numpy.zeros((fieldRavelLength, 3))
if component == 'U' or component == 'e':
output[component] = numpy.zeros((fieldRavelLength, 3, 3))
# Iterate through flat field of Fs
for n in pbar(range(FfieldFlat.shape[0])):
F = FfieldFlat[n]
decomposedF = spam.deformation.decomposeF(F, twoD=twoD)
for component in components:
output[component].append(decomposedF[component])
output[component][n] = decomposedF[component]
# Reshape on the output
for component in components:
......@@ -476,14 +479,19 @@ def decomposePhiField(PhiField, components, twoD=False):
output = {}
for component in components:
output[component] = []
if component == 'vol' or component == 'dev' or component == 'volss' or component == 'devss':
output[component] = numpy.zeros(fieldRavelLength)
if component == 't' or component == 'r' or component == 'z':
output[component] = numpy.zeros((fieldRavelLength, 3))
if component == 'U' or component == 'e':
output[component] = numpy.zeros((fieldRavelLength, 3, 3))
# Iterate through flat field of Fs
# Iterate through flat field of Phis
for n in pbar(range(PhiFieldFlat.shape[0])):
Phi = PhiFieldFlat[n]
decomposedPhi = spam.deformation.decomposePhi(Phi, twoD=twoD)
for component in components:
output[component].append(decomposedPhi[component])
output[component][n] = decomposedPhi[component]
# Reshape on the output
for component in components:
......
......@@ -84,7 +84,7 @@ def covarianceAlongAxis(im, d, mask=None, axis=[0, 1, 2]):
print('spam.measurements.covariance.covarianceAlongAxis: d={}. Should be a list of integers.'.format(type(d[0])))
print('exit function.')
return -1
if max(d) >= im.shape[0] or max(d) >= im.shape[1] or max(d) >= im.shape[2]:
if any([max(d) >= im.shape[i] for i in axis]):
print('spam.measurements.covariance.covarianceAlongAxis: max(d)={}. Should be smaller than the image.'.format(max(d)))
print('exit function.')
return -1
......@@ -115,8 +115,7 @@ def covarianceAlongAxis(im, d, mask=None, axis=[0, 1, 2]):
im_multi = numpy.multiply(im_multi, mask_eff, dtype=numpy.float32)
else:
# Step 2.1: Compute the pairs of numbers
size = im.shape[a]
n = (size - x) * size**2
n = (im.shape[a] - x) * numpy.prod([s for i, s in enumerate(im.shape) if i != a]) #
# Step 2.2: Multiply the image
im_multi = numpy.multiply(im, spam.helpers.singleShift(im, x, a, sub=0), dtype=numpy.float32)
# n_multi = numpy.sum(im_multi)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment