Skip to content

Commit

Permalink
Formally Document Spectrum Viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
JackEAllen authored and samtygier-stfc committed Mar 16, 2023
1 parent 71b2aa0 commit 5d6a74f
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ notebooks/demoimages/
# PyCharm project ignore
.idea

# VSCode project ignore
.vscode

# Tags created from the VSCode python extension
tags

Expand Down
Binary file added docs/_static/spectrum_viewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ Spectrum Viewer
^^^^^^^^^^^^^^

Mantid Imaging offers a spectrum viewer where users can select many regions of interest (ROI) for time of flight (TOF) data and view the spectrum of each ROI.
The spectrum viewer can be used to export the spectrum of each ROI and ROI coordinates to respective csv files.
The spectrum viewer can be used to export the spectrum of each ROI and its respective coordinates to a separate csv file.

The spectrum viewer can be accessed from the main menu bar under the "View" tab.
The spectrum viewer can be accessed from the main menu under "Workflow" > "Spectrum Viewer".

Glossary
--------
Expand Down
1 change: 1 addition & 0 deletions docs/user_guide/gui/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Graphical User Interface (GUI)
image_view
operations_window
recon_window
spectrum_viewer
29 changes: 29 additions & 0 deletions docs/user_guide/gui/spectrum_viewer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Spectrum Viewer
=================

Mantid Imaging offers a spectrum viewer where users can select many regions of interest (ROI) for time of flight (TOF) data and view the spectrum of each ROI.
The spectrum viewer can be used to export the spectrum of each ROI and its respective coordinates to a separate csv file.

The spectrum viewer can be accessed from the main menu under "Workflow" > "Spectrum Viewer".

To try out the spectrum viewer, you find a basic example workflow to follow within `quick start <https://mantidproject.github.io/mantidimaging/user_guide/quick_start.html>`_

.. image:: ../../_static/spectrum_viewer.png
:alt: Spectrum Viewer
:width: 90%

Above you can see that the spectrum viewer consists of a left hand side panel and a right hand side panel.
The left hand side panel contains the ROI selection tools and the right hand side panel contains the spectrum plot.

Similar to the image view `image_view <https://mantidproject.github.io/mantidimaging/user_guide/gui/image_view.html>`_, the spectrum viewer has a histogram view to the right of the sample image to control the number of pixels for each intensity value.
To read more about the histogram view see `image_view <https://mantidproject.github.io/mantidimaging/user_guide/gui/image_view.html>`_ .

Below the sample image is the spectrum line plot, which shows the intensity of each ROI as a function of the TOF value.
You can select the TOF range to be displayed by clicking and dragging the mouse over the vertical bars on the left and right of the plot.

ROIs
----------
Using the ROI selection tools, you can add, rename and remove many ROIs to the spectrum viewer and view the spectrum of each ROI.
When you are happy with the ROIs you have created and positioned over the sample image, you can export the spectrum of each ROI and its respective coordinates to a separate csv file using the "Export spectrum" button.


14 changes: 6 additions & 8 deletions docs/user_guide/quick_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,17 @@ For more details on the reconstruction GUI see :ref:`reconstruction window`
Post-reconstruction
###################

Once the reconstruction is finished, the data will be automatically divided by the pixel size, so the resulting images will contain the attenuation values. At this point you can apply some post-processing operations (such as circular mask), or just save out the stack with File > Save (or CTRL+S), in order to visualise it as a 3D volume in another software.
Once the reconstruction is finished, the data will be automatically divided by the pixel size, so the resulting images will contain the attenuation values. At this point you can apply some post-processing operations (such as circular mask).


Spectrum Viewer
###############

The spectrum viewer is a tool that allows you to view the spectrum of a single pixel in the image stack. To open the spectrum viewer go to Workflow > Spectrum Viewer.

1. Resize the orange ROI to just cover the size of the sample. This will allow you to see the spectrum of the sample.
1. Resize the orange ROI to just cover the size of the sample. This will allow you to see the spectrum of the sample which you will be able to see in the spectrum line plot at the bottom of the window.
2. Click the "Add" button on the left to add another ROI which you can position over a particular detail of your choosing on the sample.
3. Double click on within the ROI Table on "roi_1" to rename to something more descriptive of what the ROI is covering.
4. To remove an ROI, you can select the ROI you would like ot remove within the ROI Table and click the "Remove" button on the left.
5. To ROI data, you can click the "Export spectrum" button and select a location and filename. Two files will be saved to this location <filename>.csv and <filename>_roi_coords.csv.
<filename>.csv contains the spectrum data for each ROI. <filename>_roi_coords.csv contains the coordinates of the ROIs in the image stack.
6. If you have a TOF dataset loaded where you would like to normalise to the open beam, you can do so by toggling the "Normalise to open beam" checkbox.
This will normalise the spectrum to the open beam spectrum. The greyed out drop down menu will become available and you can select which dataset you would like to use as the open beam.
3. Within the ROI Table, double click "roi_1" to rename to something more descriptive of what the ROI is covering.
4. To remove an ROI, you can select the ROI you would like to remove within the ROI Table and click the "Remove" button on the left.
5. To export spectrum data, you can click the "Export spectrum" button and select a location and filename. Two files will be saved to this location <filename>.csv and <filename>_roi_coords.csv. <filename>.csv contains the spectrum data for each ROI. <filename>_roi_coords.csv contains the coordinates of the ROIs in the image stack.
6. If you have a TOF dataset loaded where you would like to normalise to the open beam, you can do so by toggling the "Normalise to open beam" checkbox. This will normalise the spectrum to the open beam spectrum. The greyed out drop down menu will become available and you can select which dataset you would like to use as the open beam.

0 comments on commit 5d6a74f

Please sign in to comment.