Skip to content

Commit

Permalink
Updated readme and pushed through to Palaeoware repo
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellGarwood committed Oct 15, 2018
2 parents 6b0ff08 + 7481bfb commit f948e83
Show file tree
Hide file tree
Showing 84 changed files with 9,727 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .astylerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--style=allman
--indent=spaces=4
--align-pointer=name
--align-reference=name
--convert-tabs
--attach-namespaces
--max-code-length=200
--max-instatement-indent=120
--pad-header
--pad-oper
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.pro.user
/docs/_build
/docs/_build/*
/docs/_templates
/docs/_templates/*
make.bat
Makefile
674 changes: 674 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# SPIERSalign
SPIERSalign is a piece of software for manually aligning image stacks.
# SPIERS Align

Coded by:
- Russell J. Garwood (russell.garwood@manchester.ac.uk)
Some additions and maintenance by:
- Mark Sutton (m.sutton@imperial.ac.uk)
- Alan R.T. Spencer (alan.spencer@imperial.ac.uk)

<p align="center">
<img width="250" height="250" src="./resources/palaeoware_logo_square.png">
</p>

______

## Relevant references:
<b>Sutton, M.D., Garwood, R.J., Siveter, D.J. &amp; Siveter, D.J.</b> 2012. Spiers and VAXML; A software toolkit for tomographic visualisation, and a format for virtual specimen interchange. <a href="http://palaeo-electronica.org/content/issue-2-2012-technical-articles/226-virtual-palaeontology-toolkit"><i>Palaeontologia Electronica</i> 15(2): 15.2.5T</a>

______

SPIERS align is a piece of software for manually aligning image stacks. More details are available in the documentation.
52 changes: 52 additions & 0 deletions SPIERSalign.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#------------------------------------------------------------------------------------------------
# SPIERSalign
#------------------------------------------------------------------------------------------------

TARGET = SPIERSalign64

TEMPLATE += app

QT = gui core network widgets

CONFIG += qt \
release \
warn_on

DESTDIR = bin

OBJECTS_DIR = build

MOC_DIR = build

UI_DIR = build

FORMS += ui/mainwindow.ui \
ui/about.ui

HEADERS += src/mainwindowimpl.h \
src/globals.h \
src/scene.h \
src/darkstyletheme.h \
src/version.h \
src/about.h \
../SPIERScommon/netmodule.h \
../SPIERScommon/semanticversion.h \
../SPIERScommon/prereleasecomponent.h

SOURCES += src/mainwindowimpl.cpp \
src/main.cpp \
src/globals.cpp \
src/scene.cpp \
src/darkstyletheme.cpp \
src/about.cpp \
../SPIERScommon/netmodule.cpp \
../SPIERScommon/semanticversion.cpp \
../SPIERScommon/prereleasecomponent.cpp

RESOURCES += align.qrc

RC_FILE += resources/icon.rc

DISTFILES += \
LICENSE.md \
.astylerc
38 changes: 38 additions & 0 deletions align.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<RCC>
<qresource prefix="/">
<file alias="alignicon.png">resources/alignicon.png</file>
<file alias="gplV3Logo">resources/gplv3-127x51.png</file>
<file alias="builtWithQTLogo">resources/Built_with_Qt_RGB_logo.png</file>
<file alias="palaeoware_logo_square.png">resources/palaeoware_logo_square.png</file>
</qresource>
<qresource prefix="/darkstyle">
<file alias="stylesheet_dark.qss">resources/darkstyle/stylesheet_dark.qss</file>
<file alias="icon_branch_closed.png">resources/darkstyle/icon_branch_closed.png</file>
<file alias="icon_branch_end.png">resources/darkstyle/icon_branch_end.png</file>
<file alias="icon_branch_more.png">resources/darkstyle/icon_branch_more.png</file>
<file alias="icon_branch_open.png">resources/darkstyle/icon_branch_open.png</file>
<file alias="icon_checkbox_checked.png">resources/darkstyle/icon_checkbox_checked.png</file>
<file alias="icon_checkbox_checked_disabled.png">resources/darkstyle/icon_checkbox_checked_disabled.png</file>
<file alias="icon_checkbox_checked_pressed.png">resources/darkstyle/icon_checkbox_checked_pressed.png</file>
<file alias="icon_checkbox_indeterminate.png">resources/darkstyle/icon_checkbox_indeterminate.png</file>
<file alias="icon_checkbox_indeterminate_disabled.png">resources/darkstyle/icon_checkbox_indeterminate_disabled.png</file>
<file alias="icon_checkbox_indeterminate_pressed.png">resources/darkstyle/icon_checkbox_indeterminate_pressed.png</file>
<file alias="icon_checkbox_unchecked.png">resources/darkstyle/icon_checkbox_unchecked.png</file>
<file alias="icon_checkbox_unchecked_disabled.png">resources/darkstyle/icon_checkbox_unchecked_disabled.png</file>
<file alias="icon_checkbox_unchecked_pressed.png">resources/darkstyle/icon_checkbox_unchecked_pressed.png</file>
<file alias="icon_close.png">resources/darkstyle/icon_close.png</file>
<file alias="icon_radiobutton_checked.png">resources/darkstyle/icon_radiobutton_checked.png</file>
<file alias="icon_radiobutton_checked_disabled.png">resources/darkstyle/icon_radiobutton_checked_disabled.png</file>
<file alias="icon_radiobutton_pressed.png">resources/darkstyle/icon_radiobutton_checked_pressed.png</file>
<file alias="icon_radiobutton_unchecked.png">resources/darkstyle/icon_radiobutton_unchecked.png</file>
<file alias="icon_radiobutton_disabled.png">resources/darkstyle/icon_radiobutton_unchecked_disabled.png</file>
<file alias="icon_radiobutton_unchecked_pressed.png">resources/darkstyle/icon_radiobutton_unchecked_pressed.png</file>
<file alias="icon_restore.png">resources/darkstyle/icon_restore.png</file>
<file alias="icon_undock.png">resources/darkstyle/icon_undock.png</file>
<file alias="icon_vline.png">resources/darkstyle/icon_vline.png</file>
<file alias="icon_about_button.png">resources/darkstyle/icon_about_button.png</file>
<file alias="icon_log_button.png">resources/darkstyle/icon_log_button.png</file>
<file alias="icon_settings_1_button.png">resources/darkstyle/icon_settings_1_button.png</file>
<file alias="icon_settings_2_button.png">resources/darkstyle/icon_settings_2_button.png</file>
</qresource>
</RCC>
Binary file added docs/_static/figure_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/figure_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/figure_3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/figure_4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/figure_5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/palaeoware_logo_square.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions docs/advancednavigation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. _advancednavigation:

Advanced Navigation
===================

Hiding Images
-------------

Occasionally users may find an image in the sequence that they wish to hide temporarily (for example they wish to visually compare images 10 and 12 by flicking between them, without 11 always appearing in the way). To hide the currently viewed image use the *Hide Image* command on the *Navigate* menu. The image will remain on screen (the status bar notes that it is hidden), but if the user navigates forward and then back again with the ‘.’ and ‘,’ keys they will find that the hidden image is skipped. Using *Ctrl-Shift-'.'* and *Ctrl-Shift-','* to navigate will move to the next/previous image whether or not it is hidden; hidden images can also be accessed using both the spin box and horizontal file slider. To unhide the currently viewed image use the *Hide Image* command on the *Navigate* menu. An *Unhide All* command is also available on the *Navigate* menu.

Hidden images are still processed during cropping and propagation; it is advisable to perform an Unhide All operation before cropping to ensure that objects of interest do not extend outside the crop-box on hidden images.

Propagation
-----------

SPIERSalign provides a facility to record changes made to one image, and then apply those changes to all subsequent or previous images in the sequence. This feature is useful, for instance, where one image has been omitted during alignment and all of the changes made to this need to be applied to the subsequent (aligned) images. To use this mode select the Propagation Mode item on the Locking/Propagation menu **while viewing the image from which you want to apply the changes**. SPIERSalign will ask you whether you want to propagate forwards (to the end of the dataset) or backwards (to the beginning). Propagation mode limits navigation to the propagation image and one either before it (forwards propagation) or after it (backwards propagation). Only the propagation image can be rotated, scaled or shifted. Once all changes to the propagation image have been made, the *Apply Progagation* command on the *Locking/Propagation* menu will then apply the changes to the required images.

Propagation mode (forward flavour) can be used on the first image of a dataset to make changes to the entire dataset; for instance to adjust size or orientation.

File Locking
------------

SPIERSalign provides a 'file locking' feature (*Lock Forward* or *Lock Backward* on the *Locking/Propagation* menu). When activated, this mode restricts navigation to just two images, and only enables rotations, scales or shifts to be applied to one of these. *Forward Locking* allows changes to be performed on the second image of the pair, and *Backward Locking* on the first. The *Move Forward/Back* command on the *Locking/Propagation* menu moves the pair either forward or back in the dataset, depending on the mode. This mode is intended as an aid to alignment, enabling a user to work through the dataset one slice at a time without accidentally moving the wrong image. Note that when viewing the locked image of the pair, the Lock File option in the Locking/Propagation menu will be ticked; unticking this temporarily overrides the locking.

Swapping Files
--------------

Occasionally you may find that two images are the wrong way round in the sequence, and need to be swapped over. The *Swap Image* command on the *Transform* menu will swap the current image with the next one. Note that it is possible to move images to any desired position in the sequence by successive swap operations.
14 changes: 14 additions & 0 deletions docs/advancedsettings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _advancedsettings:

Advanced Settings File Usage
============================

Loading Backups
---------------

A backed-up settings file (see above) can be loaded and applied to the dataset using the Load Settings File command on the File menu. This operation overwrites the current settings file (which should be backed-up beforehand), and applies the settings to the image list. This will only work with the original dataset; if there have been any changes to the file names or any additions to or deletions from the dataset, it will fail.

Constant Autosave
-----------------

If SPIERSalign crashes after a long period of work, it is possible that changes since the last save will be lost. This loss may not be apparent until you next try and transform any given image, at which point the new transformation will be applied to the original image, not the altered .xxx file which will have been loaded on initial viewing. To guard against this, the Constant Autosave option in the File menu is provided; with this selected SPIERSalign will resave settings.txt after every transformation, removing the risk of losing unsaved work. This should make no noticeable difference in performance on all but the oldest PCs, and so is checked as standard.
32 changes: 32 additions & 0 deletions docs/automatedalignment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.. _automatedalignment:

Automated Alignment
===================

Semi-automated Align
--------------------

The *Semi-automated Align*, or automated markers system is a fast way of aligning images using the markers system. To do this markers should be placed to pick out fiduciary markings and features of interest, as outlined above, on the datum image. Automated markers should then be toggled by clicking the *Auto Markers* button in the *Markers* panel. This places a grid over the markers and underlying images (Fig. 4A). The user can then navigate through the dataset. When viewing an image requiring alignment, clicking and dragging the mouse can manipulate the automarker grid. Dragging the corners will rotate the grid, and anywhere near the centre will physically drag it (Fig. 4B). The markers will be move with the grid, allowing them to be aligned with the features of interest or fiduciary marks in the underlying image. When the markers lie in the correct position relative to the fossil, the button *AM:Align* (keyboard shortcut Alt-A) aligns the slice (Fig. 4C). This is done by returning the grid and markers to their original positions – which were defined on the datum image – and applying the same 'correcting' transformation to the current image. This process can then be repeated moving through the dataset.

Semi-automated alignment is best suited to datasets with drilled fiduciary holes or no fiduciary features; markers can be placed over each hole or parts of the specimen and the slice corrected; an entire dataset can be rapidly in this way, although subsequent finer adjustments are likely to be required.

.. figure:: _static/figure_4.png
:align: center

Figure 4. The default user interface of SPIERSalign with semi-automated alignment toggled. Note the grid in addition to the markers; this is shown superimposed on the reference tomogram. B. An unaligned tomogram, with the grid rotated (white arrow) to align the markers with the boundaries of the fossil. C. The same tomogram, aligned by resetting the grid and transforming the underlying image.

Clicking *AM:Edit Grid* in the *Markers* panel allows the user to change the size, position and line thickness of the grid, in addition to the number of cells. Clicking the *Auto Markers* button in the *Markers* panel will turn off automated markers, allowing markers to be readjusted and used as usual. While using *Auto Markers* it is not possible to add or remove, or adjust the position, colour thickness or shape of the markers.

True Automated Align (Auto Align)
---------------------------------

SPIERSalign provides a facility for the automated alignment of images based upon straight edges within the image. This algorithm will only work on datasets which possess two non-parallel fiduciary edges throughout the zone to be aligned. The system has its own panel (*Auto Align*, F3) showing the options for auto aligning - the panel should open in the left docking area when a dataset is loaded. Before alignment can occur, the user should click the *Setup* button; this displays two boxes on the image, one horizontal and one vertical. These should be placed over the edges upon on which the alignment is to be performed by resizing, dragging and rotating the boxes. These 'edge zones' should cover as much of the fiduciary edges as possible, on every image to be aligned, but without overshooting the edge on any image. Neither box should be rotated more than sixty degrees from their original position. They can go over the edge of the image (i.e. the top, bottom left or right boundary of the file) but should not be placed entirely off the image (Fig 5).

.. figure:: _static/figure_4.png
:align: center

Figure 5. Auto align in setup mode showing the correct placement of setup boxes.

Once these zones are correctly positioned, the user can exit by clicking setup again. An instruction box will appear, explaining the next steps and giving the option of a *Verbose Mode*. This is usually not necessary – if chosen it will display the line equations for the detected edges on both datum and subsequent images, and the required adjustment of the current image. The user can then highlight the slices to be aligned in the *Auto Align* selection box. *Clicking Align* in the *Auto Align* panel will then align selected slices against the currently displayed, datum image. Often the setup boxes will have to be quite large on the initial align to satisfy the conditions above, providing sub-optimal aligning. *Auto Align* can be run repeatedly, however, with increasingly tighter setup boxes around the fiduciary edges. This will allow a more accurate alignment, and can align many datasets so they only need minor corrections after three such iterations.

This algorithm only works on straight edges (more details on how it works are available: https://spiral.imperial.ac.uk/handle/10044/1/6334). It does not take into account any scale errors in images. If any of the images are very poorly aligned, the *Reset Image* button will return the image to its original position. Very noisy images could hinder its performance, as can poorly positioned setup boxes – i.e. those which feature a large area without an edge, and those at a low angle to each other.
14 changes: 14 additions & 0 deletions docs/basicaligningprocedure.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _basicaligningprocedure:

Basic Aligning Procedure
========================

A SPIERSalign session in which you wish to align a set of 100 unregistered images will normally involve the following stages:

1) Open a series of images and select one (arbitrarily) to act as the datum – all other images will be rotated/shifted/scaled to line up with this one. Typically, the datum image is near the centre of the run; this example will assume that image 50 out of 100 has been selected.
2) Set up lines and/or circles on image 50 to mark the fiduciary points (see Markers Panel below). These markers don’t actually do anything, but provide visual reference points that can be used as a guide for alignment.
3) Move to image 51 (see *Navigating Datasets*), and perform rotate, shift and if necessary rescale operations until the image position fits the fiduciary markings (see *Shifting, Rotating and Scaling Images*). It is advisable also to flick repeatedly between image 50 and 51 to check visually that alignment has been achieved.
4) Repeat step 3 for image 52 (checking against image 51), and continue until the end of the run (image 100) has been reached.
5) Return to the datum image (50), and repeat steps 3 and 4, this time going backwards through the sequence (aligning 49 to 50, 48 to 49 etc.)
6) When happy with alignment (it is advisable to run through the entire sequence to ensure that all movement is as smooth as possible), enter crop mode (see *Crop Panel*) and resize it, ensuring that the object of interest is contained within the box on every image.
7) Finalise this process by selecting crop. SPIERSalign will process the images, producing sub-directory with the aligned and cropped images ready for SPIERSedit.

0 comments on commit f948e83

Please sign in to comment.