e0404 / matRad

An open source multi-modality radiation treatment planning sytem developed by e0404 @ DKFZ
http://www.matRad.org
Other
223 stars 176 forks source link

Is this code can be call "3D conformal" ? #442

Closed 44REAM closed 4 years ago

44REAM commented 4 years ago

I have RTPlan, CT, Struct, RDose. I import them by using MatradGUI and save in .mat Then I import .mat file to calculate dose using matRad_calcDoseDirect. The code run perfectly, the contour of dose seem like the original one, although the dose is much lower. My code is show below


matRad_rc; 
load('5653443.mat');

% pln setting
pln.radiationMode   = 'photons';  
pln.machine         = 'Generic';

if matRad_OptimizerFmincon.IsAvailable()
    pln.propOpt.optimizer = 'fmincon';   
else
    pln.propOpt.optimizer = 'IPOPT';
end

pln.propOpt.runSequencing = 0;
pln.propOpt.runDAO        = 0;

% calculate
resultGUI = matRad_calcDoseDirect(ct,stf,pln,cst);

% visualize
matRadGUI;

My question is, is this can be call 3D conformal? I look at matRad_calcDoseDirect, it dose not seem to call the optimization function. Is this mean it did not modulate the intensity of dose so can my code call "3D conformal"?

File can e download at

https://drive.google.com/file/d/1gKFBwPPeuSWdxKemldAOr1CtIt9jbEKs/view?usp=sharing

Thank you

wahln commented 4 years ago

The "matRad_CalcDoseDirect" function uses the field/collimator shapes that were imported in the dicomImport / are present in the stf (try, for example, figure; imagesc(stf(1).ray.shape). The shape will have some weighting which is used for the (direct) dose calculation. So if there is a single shape per beam you would have a "3D conformal" setting, but there could also be multiple shapes per beam (for an IMRT setting).

The dose can certainly be different in magnitude & shape, since (1) the "Generic" machine in matRad will be different to yours, (2) and we also do not perform an exact dose calibration with monitor units or similar automatically, and (3) we do a SVD pencil-beam dose calculation in matRad, which might differ from the dose calculation algorithm used for your reference dose.

44REAM commented 4 years ago

Thank you @wahln

I have some question

  1. My plan have single ray per beam, so my plan can call "3D conformal" (in that ray have shape 386*386).

  2. My understand that the algorithm in matrad differ my mine, but the dose is way to low, for example real dose is 20 and dose in matrad is only 5. Is the dose show in matrad is only dose per fraction?

  3. If it the dose per fraction, what parameter should I change to get the total dose (for example change pln.numberOfFractions to 1 and increase the dose by some parameter)

  4. If beam have same direction and same MCL shape, the input dose of 2Gy 10 fraction and 1Gy 20 fraction will result the same dose? (I read in example file and it tell that number of fraction is consider for optimization but matRad_calcDoseDirect did not do optimization, so it should be the same?)

Please correct me if I wrong. Thank you.

Edit 1

I found the dose information in pln.propStf.collimation.beamMeterset, is this correct ?

wahln commented 4 years ago

Ah, sorry, I somehow forgot to answer:

  1. yes
  2. For photon plans matRad shows dose per fraction.
  3. you can change the number of fractions in the pln before the dose calculation, but it will only affect optimization. You can also rescale doses after calculation with, for example, resultGUI.physicalDose = scale * resultGUI.physicalDose
  4. matRad_calcDoseDirect does not access the beamMeterset field, which contains the value from the respective dicom import (see the function matRad_importFieldShapes which is called during dicom import and computes the shape weight from this value). calcDoseDirect also does not care for the number of fractions: It assumes that the shape (or beamlet weights) are given for a fraction dose. If you want to rescale for total dose i would just recommend to do resultGUI.physicalDoseTotal = pln.numberOfFractions * resultGUI.physicalDose or something like that