Skip to content

Conversation

@lisaseckler
Copy link

What's new:

  1. Dirty Dose (dose delivered by high-LET) objectives and its projection and functions (calcDirtyDose and calcLETmask)
  2. LETxDose objectives and its projection (coming from dij.mLETDose)
  3. LETd objectives and its projection (dose weighted LET, but only LETd SquaredUnderdosing is working nicely)
  4. Examples for all those three new objectives, mainly SquaredOverdosing and SquaredUnderdosing are shown
  5. Test Functions to create plots/histograms for the dirty dose share

For all new Objectives there are changes in objectiveFunction, objectiveGradient, OptimizationProblem and so on.

Dirty dose is calculated test wise in matRad_returnDirtyandCleanDose

To implement dirty dose in matRad there are matRad_calcLETmask and matRad_calcDirtyDose

otherwise there are new dirty dose objectives in an extra DirtyDoseObjectives folder
Changes in dirty dose objectives and two more Objectives: mLETDose and LETd
changes in LETd Objectives
cluster variance for dirty dose, dose and LETd + changes in LETd Projection
removing all the unnecessary parts
@amitantony amitantony self-assigned this Mar 27, 2024
@amitantony amitantony self-requested a review April 9, 2024 16:11
@@ -0,0 +1,72 @@
function [stackedbarDose,physDoseInDepth,RBExDcurve,RBEcurve,h,d] = matRad_plotDirtynCleanDoseShare(definedEnd,index,ct,ctCube,dij,resultGUI,add,LET_thres,k,displayComparison)
%
Copy link
Contributor

Choose a reason for hiding this comment

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

small description on the kind of plot generated here

@@ -0,0 +1,53 @@
function [wPhysDose,LET] = matRad_plotLETbeamletSpectrumInVoxel(index, ct, ctCube, dij, resultGUI, bins, displayfigures)
Copy link
Contributor

@amitantony amitantony Apr 10, 2024

Choose a reason for hiding this comment

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

could we remove the ctCube in the arguments and just directly use the ct ?

@@ -0,0 +1,83 @@
function [highLETphysDose,lowLETphysDose,totalphysDose] = matRad_returnDirtyandCleanDose(index,ct,ctCube,dij,resultGUI,LET_thres,displayfigures,maxDirtyDose,bins)
Copy link
Contributor

Choose a reason for hiding this comment

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

same here with the ctCube?

% dij: matRad dij struct
%
% output
% LETmask: logical matrix for dirty dose
Copy link
Contributor

Choose a reason for hiding this comment

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

have to change the documentation for the output variables

lisaseckler and others added 4 commits April 22, 2024 21:01
Amits Commits
# Conflicts:
#	matRad/optimization/+DoseObjectives/matRad_DoseVariance.m
#	matRad/optimization/projections/matRad_DirtyDoseProjection.m
#	matRad/optimization/projections/matRad_LETdProjection.m
#	matRad/optimization/projections/matRad_LETxDoseProjection.m
#	matRad_calcParticleDose.m
#	test/matRad_runTests.m
@wahln
Copy link
Contributor

wahln commented Jun 28, 2024

I just updated with the new folder structure and dose engines.
Will make a quick review for @amitantony and @lisaseckler to consider.

@wahln wahln self-requested a review June 28, 2024 12:15
Copy link
Contributor

@wahln wahln left a comment

Choose a reason for hiding this comment

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

Looks already quite good.

Some things remain with respect to the projections, (not) exchanging LET for LETd throughout the code, the calcDirtyDose and calcLETmasks functions, the necessity to keep mLETd as a matrix.

Consistent naming of LETxDose should also be checked.



%% Compare LET
if isfield(resultGUI,'LET') && isfield(resultGUI_MC,'LET')
Copy link
Contributor

Choose a reason for hiding this comment

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

If we change LET to LETd, then this need to really be done rigorously. Also here the isfield checks need to do this.

I am not entirely sure if I want to have that change, probably just using LET is better.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we merge examples 16,17,18 into one example comparing the different objectives?

% Let's plot the transversal iso-center LET slice
slice = round(pln.propStf.isoCenter(3)./ct.resolution.z);
figure;
imagesc(resultGUI.LET(:,:,slice)),colorbar, colormap(jet);
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar considerations about changing LET to LETd as above.. I start to more and more dislike it, as we want to stay flexible.

dij.dirtyDoseThreshold = LET_thres;
[dij.LETmaskDirty,dij.LETmaskClean,dij.mLET] = matRad_calcLETmask(dij);

dij.dirtyDose = cellfun(@times,dij.LETmaskDirty, dij.physicalDose,'UniformOutput',false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Did some changes here to consider scenarios.

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

dij.dirtyDoseThreshold = LET_thres;
[dij.LETmaskDirty,dij.LETmaskClean,dij.mLET] = matRad_calcLETmask(dij);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason to separate matRad_calcLETmask(dij) out o fthe dirty dose function? Do we need it anywhere else?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah we dont really use it for any other functions, so we could include it into the function

wGrad = cell(size(dij.physicalDose));
wGrad(obj.scenarios) = arrayfun(@(scen) projectSingleScenarioGradient(obj,dij,doseGrad,scen,w),obj.scenarios,'UniformOutput',false);
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

unneccessary whitespace

@@ -0,0 +1,96 @@
classdef matRad_LETdProjection < matRad_BackProjection
Copy link
Contributor

Choose a reason for hiding this comment

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

The LETdProjection could probably derive from the LETDose projection (and maybe the pyhsicalDose projection) and then just call the superclass methods to obtain their intermediate results?)

tempFile.m Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

This should go? Maybe I added it by accident...

Comment on lines +24 to +26
'examples/matRad_example16_LETd.m',...
'examples/matRad_example17_LETxDose.m',...
'examples/matRad_example18_DirtyDose.m',...
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment about merging into one example!

Copy link
Contributor

Choose a reason for hiding this comment

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

Did some streamlining on this file

@github-actions
Copy link

This PR was automatically marked as stale it has been open 30 days with no activity. Please review/update/merge this PR.

@github-actions github-actions bot added the stale Automatic label for stale issues label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Automatic label for stale issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants