Skip to content

Commit

Permalink
Merge branch 'main' into operations_improve_1
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmeigh authored Mar 4, 2024
2 parents af1bdce + e82455a commit 9675f38
Show file tree
Hide file tree
Showing 37 changed files with 227 additions and 94 deletions.
86 changes: 86 additions & 0 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---

name: Pre-Release Issue Template for Developers
about: For Developers Only - Should be used when Preparing for a release to make sure no tasks are missed during the build-up for a release
title: 'FOR DEVELOPERS: Mantid Imaging [V.V.V] Pre-Release'
labels: 'Release 🚀'
assignees: ''

---

## Description

As part of preparations for the release of Mantid Imaging version [**VERSION***], the following tasks need to be completed.


## High Priority Bugs
<!-- Make sure any high priority bugs which are found during smoke testing are resolved -->
- [ ] [High priority bugs](https://github.com/mantidproject/mantidimaging/issues?)


## Create release branch
- [ ] Create branch from main named release-x.x.x
- [ ] Check that branch protection rules are being applied


## Version Update PR
<!-- Update version references to version [**VERSION**] in the following locations (Update versions within `docs/release_notes/index.rst` as a separate PR updating release notes - See "Update Release Notes PR"). -->

**PR:**
- [ ] `CITATION.cff`
- Version: `version: "V.V.V"`
- Release Date: `date-released: YYYY-MM-DD`
- [ ] `docs/_templates/versioning.html`
- Version: Under `<h3>{{ _('Versions') }}</h3>`
- [ ] `docs/conf.py`
- Release Date:
- Version: `release = 'V.V.V<tag>'` (alpha/beta/rc)
- Version: `smv_tag_whitelist = r'^(2.3.0|2.4.0|2.5.0|2.6.0|2.7.0)$'`
- [ ] `docs/index.rst`
- Year: update year within Citation if out of date
- Version: update version within Citation


## Authors PR (if required)
<!-- Make sure list of authors remains in alphabetical order by surname -->

**PR:**
- [ ] `CITATION.cff`
- [ ] `docs/conf.py`
- [ ] `docs/index.rst`


## Release Notes PR
<!-- Update release notes for new version and format "next" release notes -->

**PR:**
- [ ] Compile Release Notes using the following command `python setup.py release_notes` - Copy output and place in new file `docs/release_notes/<V.V.rst>`
- [ ] Add newest version under "next": `docs/release_notes/index.rst`
- [ ] Delete all release notes within: `docs/release_notes/next/`


## Create Release

- [ ] Create release from tag (See internal docs for how to do this)


## Move IDAaas to Stable Branch

- [ ] IDAaaS - move stable branch (See internal docs for how to do this)


## Update Versions on Main

- [ ] Versions on main
- Tag commit as alpha for next release (e.g. after releasing V.V)
- Once merged checkout main and run `git describe ` to check if the tag is part of the history (See internal docs for additional info)


## Windows NSIS Installer
- [ ] Build Windows NSIS Installer (See internal docs for how to do this)


### Additional Info
<!-- Add any additional information below related to the release which may be useful t ou or the reviewer -->


17 changes: 12 additions & 5 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Tasev
given-names: Dimitar
orcid: https://orcid.org/0000-0002-5435-1936
- family-names: Akello-Egwel
given-names: Dolica
- family-names: Allen
given-names: Jack
orcid: https://orcid.org/0009-0007-2873-3731
- family-names: Baust
given-names: Rachel
- family-names: Gigg
given-names: Martyn
- family-names: Jones
given-names: Samuel
orcid: https://orcid.org/0000-0001-7217-2280
- family-names: Meigh
given-names: Ashley
orcid: https://orcid.org/0009-0001-6357-0516
- family-names: Nixon
given-names: Daniel
- family-names: Stock
given-names: Samuel
- family-names: Sullivan
given-names: Michael
orcid: https://orcid.org/0000-0003-4910-7784
- family-names: Tasev
given-names: Dimitar
orcid: https://orcid.org/0000-0002-5435-1936
- family-names: Taylor
given-names: Will
- family-names: Tygier
given-names: Sam
orcid: https://orcid.org/0000-0002-7495-8655
title: "Mantid Imaging"
abstract: "Mantid Imaging is a graphical toolkit for performing 3D reconstruction of neutron tomography data. It provides an easy-to-use graphical interface to a wide range of pre/post-processing operations, tilt correction and reconstruction algorithms, accommodating for tomography users with varying data complexity and image analysis background knowledge. It utilises a flexible plugin system that allows easy integration of external software, and has allowed us to re-use software widely known in the neutron tomography community."
version: "2.5.0"
version: "2.7.0"
doi: 10.5281/zenodo.4728059
date-released: 2023-05-04
date-released: 2024-02-21
license: "GPL-3.0-or-later"
repository-code: https://github.com/mantidproject/mantidimaging
url: https://mantidproject.github.io/mantidimaging
Expand Down
2 changes: 1 addition & 1 deletion docs/_templates/versioning.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3>{{ _('Versions') }}</h3>
<h3>{{ _('Versions') }}</h3>
<ul>
<li><a href="{{ pathto("",1)}}index.html">Latest</a></li>
{%- for item in ['2.3.0', '2.4.0', '2.5.0', '2.6.0'] %}
{%- for item in ['2.3.0', '2.4.0', '2.5.0', '2.6.0', '2.7.0'] %}
<li><a href="{{ pathto("",1)}}{{ item }}/index.html">{{ item }}</a></li>
{%- endfor %}
</ul>
Expand Down
17 changes: 10 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@

# General information about the project.
project = 'MantidImaging'
copyright = '2017-2023, Mantid Project'
author = 'Dimitar Tasev, Jack Allen, Dolica Akello-Egwel, Rachel Baust, Martyn Gigg, Samuel Jones, Dan Nixon, ' \
'Samuel Stock, Will Taylor, Sam Tygier'
copyright = '2017-2024, Mantid Project'
author = ("Dolica Akello-Egwel, Jack Allen, Rachel Baust, Martyn Gigg, Samuel Jones, Ashley Meigh, Daniel Nixon, "
"Samuel Stock, Michael Sullivan, Dimitar Tasev, Will Taylor, Sam Tygier")

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.7'
version = '2.8'
# The full version, including alpha/beta/rc tags.
release = '2.7.0a1'
release = '2.8.0a1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -174,7 +174,10 @@
html_use_smartypants = False

# sphinx-multiversion
smv_tag_whitelist = r'^(2.3.0|2.4.0|2.5.0|2.6.0)$'
smv_tag_whitelist = r'^(2.3.0|2.4.0|2.5.0|2.6.0|2.7.0)$'
smv_branch_whitelist = None # No branches
smv_released_pattern = r''
smv_prebuild_command = "python setup.py docs_api || python setup.py internal_docs_api"
smv_prebuild_command = (
'sphinx-apidoc -f -M -e -T -d 3 mantidimaging **/test **/test_helpers **/eyes_tests -o docs/api/ || '
'python setup.py docs_api || '
'python setup.py internal_docs_api')
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Mantid Imaging is a graphical toolkit for performing 3D reconstruction of neutro


Please cite as:
Tasev, Dimitar; Akello-Egwel, Dolica; Allen, Jack; Baust, Rachel; Gigg, Martyn; Jones, Samuel; Nixon, Daniel; Stock, Samuel; Taylor, Will; Tygier, Sam. (2023). Mantid Imaging (2.5.0), Zenodo https://doi.org/10.5281/zenodo.4728059
Akello-Egwel, Dolica; Allen, Jack; Baust, Rachel; Gigg, Martyn; Jones, Samuel; Meigh, Ashley; Nixon, Daniel; Stock, Samuel; Sullivan, Michael; Tasev, Dimitar; Taylor, Will; Tygier, Sam. (2024). Mantid Imaging (2.7.0), Zenodo https://doi.org/10.5281/zenodo.4728059

(See `Zenodo <https://doi.org/10.5281/zenodo.4728059>`_ for citing specific versions).

Expand Down
29 changes: 29 additions & 0 deletions docs/release_notes/2.7.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
New Features
------------
- #1912 : Support sub-directories in Live viewer
- #1941 : Spectrum viewer tab for exporting to RITS
- #1943 : RITS export transmission errors
- #1945 : Export Binned RITS Formatted Data within Spectrum Viewer.
- #1957 : ROI support for RITS export
- #1992 : Spectrum Viewer: Change ROI Colour Through Right Click Dialog Menu
- #1996 : Added .fits file compatibility for Live Viewer
- #2026: Time of flight graph in the Spectrum Viewer is now resizable
- #2027: The Spectrum ROI details display in an adjustable table via spinboxes
- #2048: Update spectrum documentation to reflect changes made to the Spectrum Viewer.

Fixes
-----
- #1873 : fix typeError: qWait(ms: int): argument 1 has unexpected type 'float'
- #1966: ExecutionTimer unit test fails intermittently for Windows GitHub Action
- #2002 : Better default values in Remove all stripes
- #2009 : Improve type annotation in gui.windows.recon
- #2012 : numpy2 deprication
- #2031 : Speed up imageview by avoiding unneeded calculation

Developer Changes
-----------------
- #1932 : RITS Export Backend
- #1951 : Various fixes to speedup pytest
- #1955 : Add InstrumentLog as new log reader
- #1960 : Update developer tools
- #2011 : Move to a new conda repo https://anaconda.org/mantidimaging/mantidimaging
1 change: 1 addition & 0 deletions docs/release_notes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release Notes
:caption: Contents:

next
2.7
2.6
2.5
2.4
Expand Down
1 change: 0 additions & 1 deletion docs/release_notes/next/dev-1932-RITS_export_backend

This file was deleted.

1 change: 0 additions & 1 deletion docs/release_notes/next/dev-1951-pytest-speed

This file was deleted.

1 change: 0 additions & 1 deletion docs/release_notes/next/dev-1955-instrument-log

This file was deleted.

1 change: 0 additions & 1 deletion docs/release_notes/next/dev-1960-update-tools

This file was deleted.

1 change: 0 additions & 1 deletion docs/release_notes/next/dev-2011-new-conda-repo

This file was deleted.

1 change: 0 additions & 1 deletion docs/release_notes/next/feature-1912-live-subdir

This file was deleted.

2 changes: 0 additions & 2 deletions docs/release_notes/next/feature-1941-rits-gui

This file was deleted.

2 changes: 0 additions & 2 deletions docs/release_notes/next/feature-1943-RITS-transmission-error

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions docs/release_notes/next/feature-1957-rits-roi

This file was deleted.

1 change: 0 additions & 1 deletion docs/release_notes/next/feature-1992-ROI-colour

This file was deleted.

1 change: 0 additions & 1 deletion docs/release_notes/next/feature-1996-fits-compatibility

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions docs/release_notes/next/feature-2046-ROI_Colors _table
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#2046 : Enhancement: Implement Click Dialog for Changing ROI Colors in Table

This file was deleted.

1 change: 1 addition & 0 deletions docs/release_notes/next/feature-2051-operations
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#2051: Move operations to compute_function style
1 change: 0 additions & 1 deletion docs/release_notes/next/fix-1873-unexpected-float

This file was deleted.

1 change: 0 additions & 1 deletion docs/release_notes/next/fix-1966-ExecutionTimer

This file was deleted.

2 changes: 0 additions & 2 deletions docs/release_notes/next/fix-2002-default-values

This file was deleted.

1 change: 0 additions & 1 deletion docs/release_notes/next/fix-2009-type annotations

This file was deleted.

1 change: 0 additions & 1 deletion docs/release_notes/next/fix-2012-numpy_update

This file was deleted.

1 change: 0 additions & 1 deletion docs/release_notes/next/fix-2030-slow-imageview

This file was deleted.

16 changes: 16 additions & 0 deletions docs/release_notes/next/next.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Mantid Imaging next release
===========================

This contains changes for the next not yet released Mantid Imaging versions.

New Features
------------
.. release_notes:: feature

Fixes
-----
.. release_notes:: fix

Developer Changes
-----------------
.. release_notes:: dev
32 changes: 12 additions & 20 deletions mantidimaging/core/operations/gaussian/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
from __future__ import annotations

from functools import partial
from logging import getLogger
from typing import TYPE_CHECKING

import scipy.ndimage as scipy_ndimage

from mantidimaging import helper as h
from mantidimaging.core.operations.base_filter import BaseFilter
from mantidimaging.core.parallel import shared as ps
from mantidimaging.core.utility.progress_reporting import Progress
from mantidimaging.gui.utility import add_property_to_form
from mantidimaging.gui.utility.qt_helpers import Type

if TYPE_CHECKING:
from mantidimaging.core.data import ImageStack
import numpy as np


class GaussianFilter(BaseFilter):
Expand Down Expand Up @@ -53,10 +52,20 @@ def filter_func(data: ImageStack, size=None, mode=None, order=None, progress=Non
if not size or not size > 1:
raise ValueError(f'Size parameter must be greater than 1, but value provided was {size}')

_execute(data, size, mode, order, progress)
params = {'size': size, 'mode': mode, 'order': order}
ps.run_compute_func(GaussianFilter.compute_function, data.data.shape[0], data.shared_array, params, progress)

h.check_data_stack(data)
return data

@staticmethod
def compute_function(i: int, array: np.ndarray, params):
scipy_ndimage.gaussian_filter(array[i],
sigma=params['size'],
mode=params['mode'],
order=params['order'],
output=array[i])

@staticmethod
def register_gui(form, on_change, view):
_, size_field = add_property_to_form('Kernel Size',
Expand Down Expand Up @@ -92,20 +101,3 @@ def execute_wrapper(size_field=None, order_field=None, mode_field=None):

def modes():
return ['reflect', 'constant', 'nearest', 'mirror', 'wrap']


def _execute(images: ImageStack, size, mode, order, progress=None):
log = getLogger(__name__)
progress = Progress.ensure_instance(progress, task_name='Gaussian filter')

f = ps.create_partial(scipy_ndimage.gaussian_filter, ps.return_to_self, sigma=size, mode=mode, order=order)

log.info("Starting PARALLEL gaussian filter, with pixel data type: {0}, "
"filter size/width: {1}.".format(images.dtype, size))

progress.update()
ps.execute(f, [images.shared_array], images.data.shape[0], progress, msg="Gaussian filter")

progress.mark_complete()
log.info("Finished gaussian filter, with pixel data type: {0}, "
"filter size/width: {1}.".format(images.dtype, size))
2 changes: 1 addition & 1 deletion mantidimaging/gui/ui/image_load_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
</item>
<item>
<property name="text">
<string>Sample Log</string>
<string>Sample / Spectra Log</string>
</property>
<property name="text">
<string/>
Expand Down
9 changes: 6 additions & 3 deletions mantidimaging/gui/windows/spectrum_viewer/presenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ def handle_roi_moved(self, force_new_spectrums: bool = False) -> None:
self.view.set_spectrum(name, self.model.get_spectrum(name, self.spectrum_mode))

def handle_roi_clicked(self, roi) -> None:
self.view.current_roi = roi.name
self.view.set_roi_properties()
if not roi.name == ROI_RITS:
self.view.current_roi = roi.name
self.view.last_clicked_roi = roi.name
self.view.set_roi_properties()

def redraw_spectrum(self, name: str) -> None:
"""
Expand Down Expand Up @@ -241,7 +243,8 @@ def change_roi_colour(self, roi_name: str, new_colour: tuple) -> None:
"""
if roi_name in self.view.spectrum_widget.roi_dict:
self.view.spectrum_widget.roi_dict[roi_name].colour = new_colour
self.view.update_roi_color_in_table(roi_name, new_colour)
self.view.update_roi_color(roi_name, new_colour)
self.view.on_visibility_change()

def add_rits_roi(self) -> None:
roi_name = ROI_RITS
Expand Down
Loading

0 comments on commit 9675f38

Please sign in to comment.