10.3. Align Sections (Feature Centroid)
Group (Subgroup)
Reconstruction (Alignment)
Description
This Filter aligns serial sections (2D slices stacked along the Z-direction) by shifting each section so that the centroid of a user-defined region lines up from one section to the next. This is one of several section alignment methods available in DREAM3DNX.
When to Use This Method
This method works well when a consistent region of interest (defined by a boolean mask) can be identified across all slices. For example, if a quality threshold has been applied so that “good” cells are flagged as true, the centroid of those true cells represents the center of the usable data on each slice. Aligning these centroids stacks the usable regions on top of each other.
Unlike the misorientation-based and mutual-information-based alignment methods, the centroid method cannot get caught in a local minimum, making it more robust for certain datasets.
How This Filter Works
For each section (Z-slice), compute the centroid of all Cells where the boolean mask is true
Compute the X and Y shifts needed to align each section’s centroid with the previous section’s centroid
Round the shifts to the nearest multiple of the Cell resolution (sections are shifted by whole-cell increments)
Reference Slice Option
If Use Reference Slice is enabled, each section is shifted to align with a single fixed reference slice rather than its immediate neighbor. This prevents small errors from accumulating across many sections.
Linear Background Subtraction
Some combinations of sample geometry and internal features can cause the alignment to introduce a gradual “shear” across the sample. Enabling Linear Background Subtraction corrects for this by fitting a line to the X and Y shifts along the Z-direction and removing the linear trend. This effectively keeps the top and bottom sections of the sample fixed relative to each other.
Optional Output Data
The user can optionally have the shifts that are generated by the filter stored in various DataArrays in a new Attribute Matrix.
The structure for which looks like this
|-- Image Geometry
|-- Alignment Shifts Data
|-- Slices
|-- Relative Shifts
|-- Cumulative Shifts
|-- Centroids
In this new structure, what follows is what the created structures represent:
Alignment Shifts Data (Attribute Matrix) - The tuple size here is defined by the number of slices [ie the Z Dimension of the Image Geometry]
Slices (DataArray | 2 component) - The slice indices (stored as uint32s)
Relative Shifts (DataArray | 2 component) - The slices shift relative to previous shift (stored as int64s) [previously known as
newxshiftandnewyshift]Cumulative Shifts (DataArray | 2 component) - The slice’s accumulated shift (stored as int64s)
Centroids (DataArray | 2 component) - The xy centroids of the corresponding slice
In previous versions a file would have been produced instead. If you wish to recreate this, you can write the Attribute Matrix as a CSV/Text file.
Required Input Sources
Mask – a boolean array marking valid cells, typically produced by a threshold operation such as Multi-Threshold Objects applied to quality or confidence-index arrays.
Input Parameter(s)
Parameter Name |
Parameter Type |
Parameter Notes |
Description |
|---|---|---|---|
Use Reference Slice |
Bool |
Whether the centroids of each section should be compared to a reference slice instead of their neighboring section |
|
Reference Slice |
Scalar Value |
Int32 |
Slice number to use as reference |
Input Cell Data
Parameter Name |
Parameter Type |
Parameter Notes |
Description |
|---|---|---|---|
Selected Image Geometry |
Geometry Selection |
Image |
The target geometry on which to perform the alignment |
Mask Array |
Array Selection |
Allowed Types: uint8, boolean Comp. Shape: 1 |
Specifies if the Cell is to be counted in the algorithm. |
Optional Alignment Output
Parameter Name |
Parameter Type |
Parameter Notes |
Description |
|---|---|---|---|
Store Alignment Shifts |
Bool |
Whether to store the shifts applied to each section to a collection of Arrays in a new Attribute Matrix |
|
Alignment Attribute Matrix Name |
DataObjectName |
The output attribute matrix where the shifts applied to the section to be stored as DataArrays. |
|
Alignment Slices Data Array Name |
DataObjectName |
The output array name where the slice information related to shifts will be stored. |
|
Alignment Relative Shifts Data Array Name |
DataObjectName |
The output array name where the new shifts relative to previous slice information will be stored. |
|
Alignment Cumulative Shifts Data Array Name |
DataObjectName |
The output array name where the accumulated shift information will be stored. |
|
Alignment Centroids Data Array Name |
DataObjectName |
The output array name where the centroid information will be stored. |
Example Pipelines
(02) Small IN100 Full Reconstruction
License & Copyright
Please see the description file distributed with this Plugin
DREAM3D-NX Help
If you need help, need to file a bug report or want to request a new feature, please head over to the DREAM3DNX-Issues GitHub site where the community of DREAM3D-NX users can help answer your questions.