@@ -119,7 +119,7 @@ Here is a graphical toolkit to help with initial alignment and other functions s

Example of the first step of `spam-mmr-graphical`

Label toolkit

...

...

@@ -129,12 +129,12 @@ Tools to deal with labelled images (of particles) where 3D images are provided.

In these images, voxels are "labelled" with integer values that indicate what particle they belong to.

Please see the :ref:`labelToolkitTutorial`.

For example we offer a rapid calculation of bounding boxes like ``scipy.ndimage.find_objects`` but faster.

For example we offer a significantly faster (and much less memory demanding) calculation of centres of mass in a labelled image compared to ``scipy.ndimage.center_of_mass``.

Also offered are calculations of:

* the volume of each label

* the centre of mass of each label

* the eigen-vectors and eigen values of the moment of intertia tensor of each label (convenient for orienting simple shapes in 3D)

* the eigen-vectors and eigen values of the moment of inertia tensor of each label (convenient for orienting simple shapes in 3D)

* the length of the half-axes of an ellipse fitting the particle

Difference image for VEC4 data in binning 2 with successive iterations of register

This appears to be a good initial guess. We will save it to a file so that we can run our external DVC script::

The registration is successful, getting below the desired *deltaPhiNorm* of 0.001 after 14 iterations.

The total computation time for this registration of two 275x275x380 volumes was 1 minute and 48 seconds on a 2014 laptop.

This appears to be a good initial guess of the deformation of the sample. We will save it to a file so that we can run our external DVC script::

# following from above

import spam.helpers

...

...

@@ -268,6 +286,8 @@ There are a (large) number of options for the ``spam-ldic`` script which are lis

Please see: :ref:`ldic` for more information on the script.

The choice of a half-window size of 10 pixels in this case is made based on the texture.

The spacing of the measurement nodes is set so the default case, double of the half-window size, so as not to have overlapping correlation windows (see also this_ note).

Furthermore, since (as you've seen) there is a rigid-body motion of a 3° z-rotation that we've captured with the registration, we'll ask for the Phi field to have this rigid motion subtracted from the displacement field.

The following computation takes about 6 minutes on a 2014 laptop.

@@ -348,11 +369,12 @@ Let's go and see what's in output:

# -rw-r--r-- 1 ed ed 113164 Mar 13 03:40 VEC4-01-b1-VEC4-02-b1-iterations.tif

# -rw-r--r-- 1 ed ed 113164 Mar 13 03:40 VEC4-01-b1-VEC4-02-b1-returnStatus.tif

# -rw-r--r-- 1 ed ed 5624436 Mar 13 03:40 VEC4-01-b1-VEC4-02-b1.tsv

# -rw-r--r-- 1 ed ed 2218369 Mar 13 03:40 VEC4-01-b1-VEC4-02-b1.vtk

# -rw-r--r-- 1 ed ed 113164 Mar 13 03:40 VEC4-01-b1-VEC4-02-b1-Xdisp.tif

# -rw-r--r-- 1 ed ed 113164 Mar 13 03:40 VEC4-01-b1-VEC4-02-b1-Ydisp.tif

# -rw-r--r-- 1 ed ed 113164 Mar 13 03:40 VEC4-01-b1-VEC4-02-b1-Zdisp.tif

Here you can see a big TSV file, which contains all the correlation information for all nodes.

Here you can see big TSV and VTK files, which contains all the correlation information for all nodes.

You can also see a number of other TIFF files, which contain 3D fields encoding the results of the correlation, and a number of "disp" TIFF files which show the displacement field (extracted from each local Φ).

Let's look at the returnStatus file -- here we will load it in Fiji and look at a vertical slice:

...

...

@@ -363,7 +385,7 @@ Let's look at the returnStatus file -- here we will load it in Fiji and look at

The fact that there are some points that have been stopped with the maximum number of iterations 10 is a pity.

Let's relaunch the calculation with more iterations, without the line *-gpi 10* to the command line above.

Now the default number of iterations (which is set to 50) is considered.

Now the default number of iterations (which is set to 50) is considered, so we rerun the *spam-ldic* script above with *-gpi 50*, which practically doesn't increase the computation time since few points require more iterations.

Central vertical slice through Z (vertical) displacement field shown with the "fire" LUT.

Values shown are from -4 +4 pixels, and reveal a very clear zone of localised strain.

To see this as a "full" displacement field, the VTK file can be dragged and dropped into ParaView (then activate Glyph mode and threshold on *returnStatus* = 2).