- 
                Notifications
    
You must be signed in to change notification settings  - Fork 193
 
Update on merging VMAT into dev #377
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
          
     Open
      
      
            wahln
  wants to merge
  118
  commits into
  dev
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
dev_VMAT_merge
  
      
      
   
  
    
  
  
  
 
  
      
    base: dev
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from 114 commits
      Commits
    
    
            Show all changes
          
          
            118 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      7f207c0
              
                Test
              
              
                eric11210 88708ae
              
                another test
              
              
                eric11210 9b10669
              
                another
              
              
                eric11210 951d101
              
                Added lots of old stuff, some new
              
              
                eric11210 a3e4443
              
                Modifying leaf spread
              
              
                eric11210 78b0d07
              
                VMAT DAO
              
              
                eric11210 d6746b1
              
                Leaf speed fix
              
              
                eric11210 3ca258f
              
                Merge remote-tracking branch 'refs/remotes/e0404/dev' into eric
              
              
                eric11210 7085692
              
                Merge remote-tracking branch 'refs/remotes/e0404/dev' into eric
              
              
                eric11210 3fe0406
              
                Update from dev
              
              
                eric11210 db26593
              
                Revert Test
              
              
                eric11210 5d24f17
              
                Revert "Update from dev"
              
              
                eric11210 a278043
              
                Changed MU Conversion
              
              
                eric11210 50b79ff
              
                Cleaning up DAO
              
              
                eric11210 79f1fa9
              
                Revert to old
              
              
                eric11210 79e5632
              
                Again
              
              
                eric11210 bc71c7d
              
                Revert "Again"
              
              
                eric11210 a794fb1
              
                Up to date
              
              
                eric11210 9c13746
              
                Cleanup
              
              
                eric11210 2f443a7
              
                VMAT Ready?
              
              
                eric11210 b322dca
              
                Had to
              
              
                eric11210 79ee967
              
                Had to
              
              
                eric11210 ce545ed
              
                VMAT - new time variable
              
              
                eric11210 1406582
              
                Tweaks
              
              
                eric11210 56d3073
              
                Split daoVec2ApertureInfo
              
              
                eric11210 e50abad
              
                Dynamic fluence optimization
              
              
                eric11210 c896b4e
              
                Jacobi Scaling
              
              
                eric11210 de9682f
              
                4D Dose Calc
              
              
                eric11210 3148472
              
                Revert "4D Dose Calc"
              
              
                eric11210 40fa6e8
              
                More
              
              
                eric11210 4d4c687
              
                Revert "Revert "4D Dose Calc""
              
              
                eric11210 34efd97
              
                Merge remote-tracking branch 'refs/remotes/e0404/dev' into eric
              
              
                eric11210 9a32682
              
                Update gitignore
              
              
                eric11210 9b09676
              
                Merge remote-tracking branch 'refs/remotes/origin/eric' into to_e404_dev
              
              
                eric11210 600f407
              
                Deletions
              
              
                eric11210 791bf8b
              
                Ready for DKFZ?
              
              
                eric11210 63a947d
              
                gitignore
              
              
                eric11210 df3f0d3
              
                Final commit before DKFZ
              
              
                eric11210 99b2774
              
                Clean up files
              
              
                eric11210 2ba96a6
              
                Changed apInfo2Vec
              
              
                eric11210 8ba1b9f
              
                Example Doc
              
              
                eric11210 d5cbd30
              
                +++no stable commit+++ frist draft / brainstorming
              
              
                markbangert 66704fb
              
                Move delivery constraints
              
              
                eric11210 186fc80
              
                Merge pull request #244 from eric11210/to_e404_dev
              
              
                markbangert 4fec934
              
                Refactor pln in seq, DAO
              
              
                eric11210 aeecde9
              
                Delete .asv
              
              
                eric11210 bd38ccb
              
                Changes to seq
              
              
                eric11210 64a1248
              
                Merge remote-tracking branch 'upstream/dev' into to_e404_dev
              
              
                eric11210 8c62a0f
              
                New sequencing functions
              
              
                eric11210 37dd3e4
              
                Preconditioning
              
              
                eric11210 4dd2230
              
                Update example file
              
              
                eric11210 c9cf6c5
              
                Refactor stf for VMAT
              
              
                eric11210 7a56e12
              
                Revert default dose and ipopt settings
              
              
                eric11210 7c84c86
              
                Merge branch 'to_e404_dev' of https://github.com/eric11210/matRad int…
              
              
                markbangert 043d6f0
              
                Change VMATGantryAngles
              
              
                eric11210 da32dda
              
                revert changes of patient data
              
              
                markbangert 9b66c14
              
                Reverse unnecessary changes
              
              
                markbangert 367cac7
              
                Renaming init, opt
              
              
                eric11210 d970b0f
              
                Merge branch 'to_e404_dev' into dev_VMAT
              
              
                eric11210 2fb70d5
              
                stf post-processing for VMAT
              
              
                eric11210 e92debd
              
                Merge of callback functions
              
              
                eric11210 d59106b
              
                Bugfix in non-VMAT sequencer.
              
              
                eric11210 1f4c3c6
              
                rearrange calcCubes function, make non VMAT example in matrad.m work
              
              
                markbangert 9020298
              
                include dij.scaleFactor in calcParticleDose
              
              
                markbangert 7d3682b
              
                reverse changes in calcQualityIndicators
              
              
                markbangert a6ce43e
              
                get rid of params.json file
              
              
                markbangert dd76774
              
                get rid of funny *.m.rej file
              
              
                markbangert d86a8de
              
                revert changes? in colormapTemplate.txt
              
              
                markbangert 75cdf8c
              
                revert changes in ipoptOptions and isoCenterCalc
              
              
                markbangert e1ac502
              
                reverse changes in jacobFuncWrapper
              
              
                markbangert 11c11a0
              
                clear up gradFuncWrapper
              
              
                markbangert 1caa697
              
                Delete _VMAT, _IMRT
              
              
                eric11210 24a5fae
              
                Merge branch 'dev_VMAT' of https://github.com/e0404/matRad into dev_VMAT
              
              
                eric11210 c889719
              
                clear up backProjection and gradFuncWrapper
              
              
                markbangert d9cf871
              
                Merge branch 'dev_VMAT' of https://github.com/e0404/matRad into dev_VMAT
              
              
                markbangert 1c66005
              
                Dosimetric constraints in VMAT
              
              
                eric11210 765293f
              
                Merge branch 'dev_VMAT' of https://github.com/e0404/matRad into dev_VMAT
              
              
                eric11210 023720b
              
                Merge of daoVec2ApertureInfo
              
              
                eric11210 fb309fe
              
                Faster Jacobian calc
              
              
                eric11210 444610d
              
                Added helper function for memorySaver
              
              
                eric11210 09f21ab
              
                refactoring
              
              
                becker89 fdd79bc
              
                Added leaf touching function
              
              
                eric11210 cec8cdb
              
                Edits
              
              
                eric11210 08615d9
              
                refactoring second part
              
              
                becker89 cd550a0
              
                Merge branch 'dev_VMAT' of https://github.com/e0404/matRad into dev_V…
              
              
                becker89 047dfdf
              
                refactoring leaf sequencing
              
              
                becker89 ccdf4fa
              
                refactoring 3
              
              
                becker89 493ff56
              
                minor update
              
              
                becker89 6b6d649
              
                Merge pull request #248 from becker89/dev_VMAT_HP
              
              
                markbangert 2446bf8
              
                Remove memory saver
              
              
                eric11210 1206d1b
              
                Fixing optBixel
              
              
                eric11210 0cc79ab
              
                Add continuous aperture code
              
              
                eric11210 c50893b
              
                Bug fixes for continuous aperture code
              
              
                eric11210 035bcd5
              
                Merge pull request #305 from eric11210/dev_VMAT
              
              
                markbangert 6db9ea2
              
                Merge branch 'dev_VMAT' of https://github.com/e0404/matRad into dev_V…
              
              
                wahln 886ca00
              
                fix mistake in VMAT detection in DAO
              
              
                wahln aee9ffe
              
                make sure no NaN's are in the gradient
              
              
                wahln 525cc14
              
                Fix display at the end of VMAT example
              
              
                wahln c46df5c
              
                fix display of apertures - please check
              
              
                wahln 446d163
              
                readd stf to fluence optimization call... should be removed from ther…
              
              
                wahln 2e9b977
              
                Merge branch 'dev' of https://github.com/e0404/matRad into dev_VMAT_m…
              
              
                wahln e3d3c1e
              
                fix basedata
              
              
                wahln 3c1a3c0
              
                Merge branch 'hotfixes/daoWithConstraints' of https://github.com/e040…
              
              
                wahln 9a59db3
              
                Fix correct sequence of precondition factors and dose cube computation
              
              
                wahln 58e3067
              
                Merge branch 'hotfixes/daoWithConstraints' of https://github.com/e040…
              
              
                wahln a789828
              
                fix some issues, mainly with the jacobian in VMAT
              
              
                wahln bcb0a59
              
                adding the scale factor to the DoseProjection
              
              
                wahln 2b79fb7
              
                Making sure the right aperturevector conversion is used
              
              
                wahln a879d71
              
                fix the bixelWeight vector usage in DAO constraint jacobian
              
              
                wahln 165a017
              
                correct gradient for jacobiScale in DAO
              
              
                wahln 98bafb6
              
                fix issue with assigning isocenter for VMAT plans in dicom import
              
              
                wahln ef7cbd8
              
                fix error in example script
              
              
                wahln e398da2
              
                Merge branch 'dev' of https://github.com/e0404/matRad into dev_VMAT_m…
              
              
                wahln 463ca2a
              
                turn off diagnostics for fmincon because of error in R2022b
              
              
                wahln 2b4490d
              
                Merge branch 'dev' into dev_VMAT_merge
              
              
                wahln 21233f2
              
                Fix for last update to new version
              
              
                eric11210 e61674f
              
                updates to use propSeq with numLevels as level property
              
              
                wahln 54c40ca
              
                Merge branch 'dev' into dev_VMAT_merge
              
              
                wahln File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
            Binary file not shown.
          
    
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| %% Example Photon Treatment Plan with VMAT direct aperture optimization | ||
| % | ||
| % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| % | ||
| % Copyright 2017 the matRad development team. | ||
| % | ||
| % This file is part of the matRad project. It is subject to the license | ||
| % terms in the LICENSE file found in the top-level directory of this | ||
| % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part | ||
| % of the matRad project, including this file, may be copied, modified, | ||
| % propagated, or distributed except according to the terms contained in the | ||
| % LICENSE file. | ||
| % | ||
| % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 
     | 
||
| %% | ||
| % In this example we will show | ||
| % (i) how to load patient data into matRad | ||
| % (ii) how to input necessary parameters in the pln structure | ||
| % (iii) how to setup a photon dose calculation | ||
| % (iv) how to inversely optimize fluence directly from command window in MatLab. | ||
| % (v) how to apply a sequencing algorithm | ||
| % (vi) how to run a VMAT direct aperture optimization | ||
| % (vii) how to visually and quantitatively evaluate the result | ||
| 
     | 
||
| %% Patient Data Import | ||
| % Let's begin with a clear Matlab environment and import the head & | ||
| % neck patient into your workspace. | ||
| matRad_rc | ||
| 
     | 
||
| load('HEAD_AND_NECK.mat'); | ||
| 
     | 
||
| %% Treatment Plan | ||
| % The next step is to define your treatment plan labeled as 'pln'. This | ||
| % structure requires input from the treatment planner and defines | ||
| % the most important cornerstones of your treatment plan. | ||
| 
     | 
||
| pln.radiationMode = 'photons'; % either photons / protons / carbon | ||
| pln.machine = 'Generic'; | ||
| 
     | 
||
| pln.numOfFractions = 30; | ||
| 
     | 
||
| % beam geometry settings | ||
| pln.propStf.bixelWidth = 5; | ||
| 
     | 
||
| % optimization settings | ||
| pln.propOpt.bioOptimization = 'none'; | ||
| pln.propOpt.runVMAT = true; | ||
| pln.propOpt.runDAO = true; | ||
| pln.propOpt.runSequencing = true; | ||
| pln.propOpt.preconditioner = true; | ||
| pln.propOpt.numLevels = 7; | ||
| 
     | 
||
| pln.propOpt.VMAToptions.machineConstraintFile = [pln.radiationMode '_' pln.machine]; | ||
| 
     | 
||
| pln.propOpt.VMAToptions.maxGantryAngleSpacing = 2; % Max gantry angle spacing for dose calculation | ||
| pln.propOpt.VMAToptions.maxDAOGantryAngleSpacing = 4; % Max gantry angle spacing for DAO | ||
| pln.propOpt.VMAToptions.maxFMOGantryAngleSpacing = 28; % Max gantry angle spacing for FMO | ||
| 
     | 
||
| pln.propOpt.VMAToptions.startingAngle = 0; | ||
| pln.propOpt.VMAToptions.finishingAngle = 359; | ||
| pln.propOpt.VMAToptions.continuousAperture = 0; | ||
| 
     | 
||
| pln.propDoseCalc.doseGrid.resolution.x = 5; % [mm] | ||
| pln.propDoseCalc.doseGrid.resolution.y = 5; % [mm] | ||
| pln.propDoseCalc.doseGrid.resolution.z = 5; % [mm] | ||
| 
     | 
||
| %% | ||
| % Generate dose calculation, DAO, and FMO angles from the parameters input | ||
| % above. FMO is performed only on the initGantryAngles set. In the DAO | ||
| % step, weights and leaf positions are optimized at the angles in the | ||
| % optGantryAngles set. Weights and leaf positions are interpolated at the | ||
| % angles in the gantryAngles set to increase the accuracy of the dose | ||
| % calculation (each iteration). | ||
| 
     | 
||
| % FMO: optimize fluence on coarse subset of gantry angles | ||
| % Sequencing: select subset of apertures and spread to finer angles | ||
| % DAO: constrain for leaf speed, gantry rotation speed and MU rate | ||
| 
     | 
||
| pln = matRad_VMATGantryAngles(pln,cst,ct); | ||
| 
     | 
||
| %% Generate Beam Geometry STF | ||
| stf = matRad_generateStf(ct,cst,pln); | ||
| 
     | 
||
| %% Dose Calculation | ||
| % Lets generate dosimetric information by pre-computing dose influence | ||
| % matrices for unit beamlet intensities. Having dose influences available | ||
| % allows for subsequent inverse optimization. | ||
| dij = matRad_calcPhotonDose(ct,stf,pln,cst); | ||
| 
     | 
||
| %% Inverse Planning for IMRT | ||
| % The goal of the fluence optimization is to find a set of beamlet weights | ||
| % which yield the best possible dose distribution according to the | ||
| % predefined clinical objectives and constraints underlying the radiation | ||
| % treatment. In VMAT, FMO is done only at the angles in the | ||
| % initGantryAngles set. Once the optimization has finished, trigger once the GUI to | ||
| % visualize the optimized dose cubes. | ||
| resultGUI = matRad_fluenceOptimization(dij,cst,pln,stf); | ||
| matRadGUI; | ||
| 
     | 
||
| %% Sequencing | ||
| % This is a multileaf collimator leaf sequencing algorithm that is used in | ||
| % order to modulate the intensity of the beams with multiple static | ||
| % segments, so that translates each intensity map into a set of deliverable | ||
| % aperture shapes. The fluence map at each angle in the initGantryAngles | ||
| % set is sequenced, with the resulting apertures spread to neighbouring | ||
| % angles from the optGantryAngles set. | ||
| resultGUI = matRad_siochiLeafSequencing(resultGUI,stf,dij,pln,0); | ||
| 
     | 
||
| %% DAO - Direct Aperture Optimization | ||
| % The Direct Aperture Optimization is an optimization approach where we | ||
| % directly optimize aperture shapes and weights at the angles in the | ||
| % optGantryAngles set. The gantry angle speed, leaf speed, and MU rate are | ||
| % constrained by the min and max values specified by the user. | ||
| resultGUI = matRad_directApertureOptimization(dij,cst,resultGUI.apertureInfo,resultGUI,pln); | ||
| 
     | 
||
| %% Aperture visualization | ||
| % Use a matrad function to visualize the resulting aperture shapes | ||
| matRad_visApertureInfo(resultGUI.apertureInfo); | ||
| 
     | 
||
| %% Indicator Calculation and display of DVH and QI | ||
| [dvh,qi] = matRad_indicatorWrapper(cst,pln,resultGUI); | ||
| matRad_showDVH(dvh,cst,pln); | ||
| 
     | 
||
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  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.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These parameters only seem to work for certain combinations of parameters.
Using the following comination throws an error:
pln.propOpt.VMAToptions.maxGantryAngleSpacing = 8; % Max gantry angle spacing for dose calculation pln.propOpt.VMAToptions.maxDAOGantryAngleSpacing = 16; % Max gantry angle spacing for DAO pln.propOpt.VMAToptions.maxFMOGantryAngleSpacing = 28; % Max gantry angle spacing for FMOIf this is intended behavior, the conditions should be tested for and a sensible error message should appear. I don't know if I induced this or it was already there before.