Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New function for Slice plotting added. Bug fixing in iso lines plotter. #818

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

SimonaFa
Copy link
Contributor

The matRad_plotSlice function allows to plot one dose slice in a flexible way: ct and dose cube are the only required parameters, while other optional parameters, e.g. cts, colorbar, iso lines, contours, line and text properties, etc., can be specified in the Name-Value pair format. The changes in the iso lines plotter ensure that 2D matrices are correctly passed to the function.

The new function Plot Slice allows to plot a single dose slice in a flexible way: ct and dose cube are the only required parameters, but other optional, e.g. colorbar, legend, iso dose lines, line and text properties, can be specified. The bug fixing ensures that a 2D quantity is correctly called within the function.
Copy link

codecov bot commented Jan 25, 2025

Codecov Report

Attention: Patch coverage is 81.81818% with 22 lines in your changes missing coverage. Please review.

Project coverage is 50.72%. Comparing base (fdf2906) to head (1c49003).
Report is 9 commits behind head on dev.

Files with missing lines Patch % Lines
matRad/util/matRad_plotSlice.m 83.47% 19 Missing ⚠️
matRad/plotting/matRad_plotIsoDoseLines.m 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #818      +/-   ##
==========================================
- Coverage   52.40%   50.72%   -1.68%     
==========================================
  Files         612      614       +2     
  Lines       38702    39074     +372     
==========================================
- Hits        20282    19822     -460     
- Misses      18420    19252     +832     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wahln
Copy link
Contributor

wahln commented Feb 5, 2025

Let's change the function in the following way:

  • Always ask for ct, but not for dose.
  • Add an option to not show the ct

Then please create some tests for calling the function. You can use one of the tiny test data sets to have all strutctures (ct, cst, resultGUI) available.

wahln and others added 4 commits February 7, 2025 13:55
Ct is the only required parameter. Dose cube is optional. Option for plotting the ct added.
… dose an optional variable. plotSliceWrapper modified to deprecated function and calling plotSlice instead.
@@ -63,6 +63,8 @@
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

warning('Deprecation warning: matRad_plotSliceWrapper is deprecated. Using matRad_plot_Slice instead');
Copy link
Contributor

Choose a reason for hiding this comment

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

we have a dedicated matRad_cfg.dispDeprecationWarning(...) for this

@@ -101,6 +103,11 @@

matRad_cfg = MatRad_Config.instance();

warning('Deprecation warning: matRad_plotSliceWrapper is deprecated. Using matRad_plot_Slice instead');
Copy link
Contributor

Choose a reason for hiding this comment

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

see above

Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove the commented code. We don't need it anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Did this cause issues before?

%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

defaultDose = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe leave a comment here before the argument handling.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks nice. I guess by calling matRad_plotSlice from the old matRad_plotSliceWrapper you also cover most of the file with tests now due to the examples.

You would just need to add a few tests for, e.g., leaving out certain arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants