DVH Analyse
A collection of useful functions for Dose-Volume Histograms (DVH) analysis.
- fredtools.getDVHMask(img, imgMask, dosePrescribed, doseLevelStep=0.01, displayInfo=False)
Calculate DVH for the mask.
The function calculates a dose-volume histogram (DVH) for voxels inside a mask with the same field of reference (FoR). The mask must defined as a SimpleITK image object describing a binary or floating mask. The routine exploits and returns dicompylercore.dvh.DVH class to hold the DVH. Read more about the dicompyler-core DVH module on https://dicompyler-core.readthedocs.io/en/latest/index.html.
- Parameters:
img (SimpleITK Image) – Object of a SimpleITK 3D image.
imgMask (SimpleITK Image) – Object of a SimpleITK 3D image describing the binary of floating mask.
dosePrescribed (scalar) – Target prescription dose.
doseLevelStep (scalar, optional) – Size of dose bins. (def. 0.01)
displayInfo (bool, optional) – Displays a summary of the function results. (def. False)
- Returns:
An instance of a dicompylercore.dvh.DVH class holding the DVH.
- Return type:
dicompylercore DVH
See also
dicompylercore
more information about the dicompylercore.dvh.DVH.
resampleImg
resample image.
mapStructToImg
map structure to image (refer for more information about mapping algorithms).
getDVHStruct
calculate DVH for structure.
- fredtools.getDVHStruct(img, RSfileName, structName, dosePrescribed, doseLevelStep=0.01, resampleImg=None, CPUNo='auto', displayInfo=False)
Calculate DVH for the structure.
The function calculates a dose-volume histogram (DVH) for voxels inside a structure named structName and is defined in the structure dicom file. The image can be resampled before mapping to increase the resolution. The routine exploits and returns dicompylercore.dvh.DVH class to hold the DVH. Read more about the dicompyler-core DVH module on https://dicompyler-core.readthedocs.io/en/latest/index.html.
- Parameters:
img (SimpleITK Image) – Object of a SimpleITK 3D image.
RSfileName (path) – String path to RS dicom file.
structName (string) – Name of the structure to calculate the DVH in.
dosePrescribed (scalar) – Target prescription dose.
doseLevelStep (scalar, optional) – Size of dose bins. (def. 0.01)
resampleImg (scalar, array_like or None, optional) – Define if and how to resample the image while mapping the structure. Can be a scalar, then the same number will be used for each axis, 3-element iterable defining the voxel size for each axis, or None meaning no interpolation. (def. None)
CPUNo ({'auto', 'none'}, scalar or None) – Define if the multiprocessing should be used and how many cores should be exploited (def. ‘auto’). Can be None, then no multiprocessing will be used, a string ‘auto’, then the number of cores will be determined by os.cpu_count(), or a scalar defining the number of CPU cores to be used (def. ‘auto’).
displayInfo (bool, optional) – Displays a summary of the function results. (def. False)
- Returns:
An instance of a dicompylercore.dvh.DVH class holding the DVH.
- Return type:
dicompylercore DVH
See also
dicompylercore
more information about the dicompylercore.dvh.DVH.
resampleImg
resample image.
mapStructToImg
map structure to image (refer for more information about mapping algorithms).
getDVHMask
calculate DVH for a mask.
Notes
The structure mapping is performed in ‘floating’ mode meaning that the fractional structure occupancy is assigned to each voxel of the image. Use getDVHMask to use a specially prepared mask for the DVH calculation.