Skip to content

Commit

Permalink
Merge branch 'release/1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurence Jackson committed Feb 27, 2023
2 parents ffe6e04 + 5b19a07 commit d429c7d
Show file tree
Hide file tree
Showing 35 changed files with 1,401 additions and 568 deletions.
7 changes: 4 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
- OS: [e.g. macOS 12.1]
- Python version [e.g. 3.6, 3.8]
- Hazen version [e.g. 0.6.0]
- Deployment [e.g. Docker, venv, web]

**Additional context**
Add any other context about the problem here.
4 changes: 2 additions & 2 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96
with:
images: gsttmriphysics/hazen

- name: Build and push Docker image
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
push: true
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/test_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ jobs:
hazen snr tests/data/snr/Siemens --report
hazen snr tests/data/snr/Siemens --measured_slice_width 5.0012 --report
- name: test_acr_snr
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested
run: |
hazen acr_snr tests/data/acr/Siemens --report
hazen acr_snr tests/data/acr/Siemens --subtract tests/data/acr/Siemens2 --report
- name: test acr_uniformity
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested
run: |
Expand All @@ -48,6 +54,16 @@ jobs:
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested
run: |
hazen acr_ghosting tests/data/acr/Siemens --report
- name: test acr_slice_position
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested
run: |
hazen acr_slice_position tests/data/acr/Siemens --report
- name: test acr_geometric_accuracy
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested
run: |
hazen acr_geometric_accuracy tests/data/acr/Siemens --report
- name: test slice_position
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested
Expand Down Expand Up @@ -80,3 +96,9 @@ jobs:
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested
run: |
hazen snr_map tests/data/snr/Siemens --report
- name: test relaxometry
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested
run: |
hazen relaxometry tests/data/relaxometry/T1/site1_20200218/plate5 --calc_t1 --plate_number=5 --report
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ date-released: 2022-02-24
message: "If you use hazen in your work, please cite it using these metadata."
repository-code: "https://github.com/GSTT-CSC/hazen"
title: hazen
version: "1.1.0"
version: "1.1.2"
...
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
graft hazenlib/data
graft hazenlib/tasks/data
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p align="center">
Quality assurance framework for Magnetic Resonance Imaging
<br />
<a href="https://github.com/github_username/repo_name"><strong>Explore the docs »</strong></a>
<a href="https://hazen.readthedocs.io/en/latest/"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://github.com/GSTT-CSC/hazen">View repo</a>
Expand Down Expand Up @@ -40,7 +40,7 @@ Some example outputs from hazen:

| hazen snr | hazen ghosting |
|----------------------------------|-------------------------------|
| ![](docs/assets/snr-example.png) | ![](docs/assets/ghosting.png) |
| ![](docs/assets/SNR.png) | ![](docs/assets/ghosting.png) |

---

Expand Down
2 changes: 1 addition & 1 deletion contributors.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Paul Wilson
Yassine Azma
Laurence Jackson
Dika Vilic
Elizabeth Gabriel
Expand All @@ -7,5 +8,4 @@ Neil Heraghty
Siân Culley
Tom Roberts
Lucrezia Cester
Siân Culley
Haris Shuaib
Binary file added docs/assets/SNR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
28 changes: 17 additions & 11 deletions hazenlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,21 @@
Welcome to the Hazen Command Line Interface
Usage:
hazen <task> <folder> [--measured_slice_width=<mm>] [--report] [--output=<path>] [--calc_t1 | --calc_t2]
[--plate_number=<n>] [--show_template_fit]
hazen <task> <folder> [--measured_slice_width=<mm>] [--subtract=<folder2>] [--report] [--output=<path>]
[--calc_t1 | --calc_t2] [--plate_number=<n>] [--show_template_fit]
[--show_relax_fits] [--show_rois] [--log=<lvl>] [--verbose]
hazen -h|--help
hazen --version
Options:
Report is an optional argument needed if you want to get a plot of your results.
'Calc_t1', 'calc_t', 'plate_number=<n>', 'show_template_fit', 'show_relax_fits', 'show_rois', 'verbose' are optional arguments for the relaxometry function.
'Measured_slice_width' is an optional argument for the SNR function.
'Log' is an optional argument that allows users to set the severity of the logs.
<task> snr | slice_position | slice_width | spatial_resolution | uniformity | ghosting | relaxometry | snr_map |
acr_ghosting | acr_uniformity
acr_ghosting | acr_uniformity |
<folder>
--report
"""
import importlib
import inspect
Expand Down Expand Up @@ -333,7 +336,6 @@ def parse_relaxometry_data(task, arguments, dicom_objects,
def main():
arguments = docopt(__doc__, version=__version__)
task_module = importlib.import_module(f"hazenlib.tasks.{arguments['<task>']}")

files = get_dicom_files(arguments['<folder>'])
pp = pprint.PrettyPrinter(indent=4, depth=1, width=1)

Expand Down Expand Up @@ -368,22 +370,26 @@ def main():

if not arguments['<task>'] == 'snr' and arguments['--measured_slice_width']:
raise Exception("the (--measured_slice_width) option can only be used with snr")
elif not arguments['<task>'] == 'acr_snr' and arguments['--subtract']:
raise Exception("the (--subtract) option can only be used with acr_snr")
elif arguments['<task>'] == 'snr' and arguments['--measured_slice_width']:
measured_slice_width = float(arguments['--measured_slice_width'])
logger.info(f'Calculating SNR with measured slice width {measured_slice_width}')
result = task.run(measured_slice_width)
elif arguments['<task>'] == 'acr_snr':
acr_snr_cli_args = {'--subtract'}

acr_snr_args = {}
for key in acr_snr_cli_args:
acr_snr_args[key[2:]] = arguments[key]

result = task.run(**acr_snr_args)
# TODO: Refactor Relaxometry task into HazenTask object Relaxometry not currently converted to HazenTask object -
# this task accessible in the CLI using the old syntax until it can be refactored
elif arguments['<task>'] == 'relaxometry':
task = importlib.import_module(f"hazenlib.{arguments['<task>']}")
dicom_objects = [pydicom.read_file(x, force=True) for x in files if is_dicom_file(x)]
result = parse_relaxometry_data(task, arguments, dicom_objects, report=True)
# TODO: Refactor SNR Map into HazenTask object (if not already) Relaxometry not currently converted to HazenTask
# object - this task accessible in the CLI using the old syntax until it can be refactored
elif arguments['<task>'] == 'snr_map':
task = importlib.import_module(f"hazenlib.{arguments['<task>']}")
dicom_objects = [pydicom.read_file(x, force=True) for x in files if is_dicom_file(x)]
result = task.main(dicom_objects, report_path=True)
else:
result = task.run()

Expand Down
2 changes: 1 addition & 1 deletion hazenlib/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.1.0'
__version__ = '1.1.2'
Loading

2 comments on commit d429c7d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.