Windows application + phantom previews - #28
Open
SBugby wants to merge 9 commits into
Open
Conversation
- modifications of pathing to enable this
- build_windows.m - creates a Windows exe for unlicensed use None Modified pathing in the following files to work with build_windows.m - gui/ExampleObjects.m - gui/gui.m
New Functions & Classes: - APPLICATION_LICENSE.txt: License for the packaged app distribution - NOTICE.txt: Explains the difference between application and source code licenses New Tests: None Changed code i.e. bug fixes: - build_windows.m: Added licenses to build_windows - gui.m: Added About menu as required by license. Fix for ImageViewer unavailable in deployed mode.
Added an extra 'first_run' document for new users New Functions & Classes: - docs/source/user_guide/first_run.md: Describes the install process for deployed app and running in desktop or online MatLab New Tests: None Changed code i.e. bug fixes: - docs/source/index.rst: Added first_run.md - gui/gui.m: Minor syntax fix gui.m: Added About menu as required by license. Fix for ImageViewer unavailable in deployed mode.
New Functions & Classes: - src/voxels/save_phantom_preview.m: This takes a phantom object input, and generates a png of the central slice - docs/source/dev_guide/save_phantom_preview.rst: Associated documentation New Tests: None Changed code i.e. bug fixes: - gui/gui.m: Updated so the Shepp-Logan svhg remains default visualisation, but if a png of the selected phantom exists this is replaced - docs/source/index.rst: Added save_phantom_preview.rst - docs/source/user_guide/gui.md: Added info about preview images - gui/ExampleObjects.m: Now generates preview images for each example
Added template for feature requests to separate these from bugs. New functions and classes: .github/ISSUE_TEMPLATE/feature_request.md: Issue template added to request features
New Functions & Classes: None New Tests: None Changed code i.e. bug fixes: src/compute_sinogram.m: Produces warning when sinogram contains NaN build_windows.m: syntax fix
There was a problem hiding this comment.
Pull request overview
This PR adds support for packaging DECTSim as a standalone Windows application (including licensing/notice files and pathing changes), and enhances the GUI to display per-phantom preview images (with documentation updates).
Changes:
- Adds a Windows build/packaging script plus application-specific license/notice content.
- Adds phantom preview generation (
save_phantom_preview) and updates the GUI to display preview PNGs when available. - Improves GUI load/save workflows and updates user/developer documentation accordingly.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/voxels/save_phantom_preview.m |
New helper to generate a central-slice phantom preview PNG (with alpha). |
src/compute_sinogram.m |
Adds NaN detection after sinogram creation. |
gui/gui.m |
Adds phantom preview support, deployed-app image viewing fallback, and an About menu; improves load/save UI flows. |
gui/ExampleObjects.m |
Updates path handling and generates preview PNGs alongside example phantoms. |
build_windows.m |
New script to build/package a Windows standalone application and installer. |
APPLICATION_LICENSE.txt |
Adds application license terms for the deployed build (distinct from source license). |
NOTICE.txt |
Adds notices covering DECTSim + MATLAB Runtime attribution/context. |
docs/source/user_guide/first_run.md |
New first-run guide (Windows app + MATLAB Desktop/Online workflows). |
docs/source/user_guide/gui.md |
Documents phantom preview behavior for custom phantoms. |
docs/source/dev_guide/save_phantom_preview.rst |
Developer documentation for generating phantom preview images. |
docs/source/index.rst |
Adds new user/dev guide pages to the Sphinx toctrees. |
.github/ISSUE_TEMPLATE/feature_request.md |
Adds a feature request issue template. |
.gitignore |
Ignores generated example binaries and MATLAB Compiler build output. |
resources/project/...yJ5HhId127bnvMTz_nJJ2d9M4dop.xml |
Removes a project metadata entry. |
resources/project/...yJ5HhId127bnvMTz_nJJ2d9M4dod.xml |
Removes a project metadata entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| % Menu selected function: ReconstructionMenu_3, SinogramMenu_3 | ||
| function OpeninImageViewerMenuSelected(app, event) | ||
| show_sinogram = strcmp(event.Source.Text, 'Sinogram'); | ||
| function OpeninImageViewerMenuSelected(~, ~) |
Comment on lines
+46
to
+57
| requiredDataNames = [ | ||
| "PhantomExample1.mat" | ||
| "PhantomExample1.png" | ||
| "PhantomExample2.mat" | ||
| "PhantomExample1.png" | ||
| "PhantomExample3.mat" | ||
| "PhantomExample1.png" | ||
| "PhantomExample4.mat" | ||
| "PhantomExample1.png" | ||
| "SourceExample40kvp.mat" | ||
| "SourceExample80kvp.mat" | ||
| ]; |
Comment on lines
+171
to
+177
| %Adding some checks | ||
|
|
||
| if any(isnan(sinogram), "all") | ||
| error( ... | ||
| "DECTSim:InvalidSinogram", ... | ||
| "The calculated sinogram contains NaN values."); | ||
| end |
Comment on lines
+1
to
+7
| Save Phantom Preview | ||
| ============= | ||
|
|
||
| This allows a preview image to be generated when you create a custom phantom. The preview image can then be displayed on the GUI when your phantom is selected. | ||
|
|
||
| save_phantom_preview | ||
| ------------ |
Comment on lines
+27
to
+28
| Returns | ||
|
|
| What is DECTSim missing, and why would it be useful. | ||
|
|
||
| **Area** | ||
| Provided a short indication of where this feature would sit e.g. GUI-image display, simutlation-scatter_correction |
Comment on lines
+66
to
+82
| if maximum_value > minimum_value | ||
| preview(foreground) = ... | ||
| minimum_grey + ... | ||
| (maximum_grey - minimum_grey) .* ... | ||
| (attenuation_slice(foreground) - minimum_value) ./ ... | ||
| (maximum_value - minimum_value); | ||
| else | ||
| preview(foreground) = (minimum_grey + maximum_grey) / 2; | ||
| end | ||
| end | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Windows application
New functions
New tests
No automated test functions. Windows build has been tested but this needs to be repeated on a system that has not previously had MATLAB installed and functionality retested through app.
Changed code
2. Phantom preview
New functions
New tests
No numeric tests needed - visual change only and reverts to previous behaviour if no file present.
Changed code
3. Other
New functions
Changed code
New tests
None - no numeric changes.