src.original.fitting.PvH_KB_NKI package
Submodules
src.original.fitting.PvH_KB_NKI.DWI_Examples module
src.original.fitting.PvH_KB_NKI.DWI_functions_standalone module
DWI_functions.py
This module can be used to calculate ADC/IVIM maps. IVIM fitting is done in a segmented fashion: https://doi.org/10.3389/fonc.2021.705964
@authors: s.zijlema, p.vhoudt, k.baas, e.kooreman Group: Uulke van der Heide - NKI
- src.original.fitting.PvH_KB_NKI.DWI_functions_standalone.fit_ADCmap_loglinear_standalone(DWIdata, all_bvalues, use_bvalues, size=[])[source]
Function to calculate ADC based on linear regression. Taken from ADC_functions.py but adjusted to also output intercept and removed size input requirement (could be extracted from si_array). The ADC values have been validated with the Philips ADC maps (2022).
Parameters
- DWIdata
DWI data
- all_bvalues
list or array of b-values that are stored in the data
- use_bvalues
list or array of selected b-values selected for calculation.
Returns
ADC calculated ADC and the intercept with the y-axis at b=0 in the same x,y,z coordinates as the original DWI image (i.e. size)
- src.original.fitting.PvH_KB_NKI.DWI_functions_standalone.generate_ADC_standalone(DWIdata, bvalues, bmin: int = 150, bmax: int = 1000, specificBvals: list = [])[source]
Function to create an ADC map from DWI data. Required input is a numpy array with the data and the corresponding b-values
Example use: generate_ADC(data, bvalues)
Parameters
- DWIdata: numpy array
DWI data
- bvalues: list
bvalues corresponding to the data
- bmin/bmax (optional)
Used to select range of b-values that you want to include to calculate the ADC. Not used when specificBvals is defined.
- specificBvals (optional)
List of b-values that should be used for ADC map calculation. If set, bmin/bmax options are not used.
Returns
- ADClog
ADC map
- b0_intercept
Map with y-intercepts (b=0) of ADC fit
- bvalues
b-values that matched the criteria
- src.original.fitting.PvH_KB_NKI.DWI_functions_standalone.generate_IVIMmaps_standalone(DWIdata, bvalues, bminADC=150, bmaxADC=1000, bmaxDstar=50)[source]
Function to calculate IVIM maps (perfusion fraction and D*). NOTE: D* is calculated using only the lowest two b-values.
Example use: generate_IVIMmaps(data, bvalues)
Parameters
- DWIdata: numpy array
DWI data
- bvalues: list
bvalues corresponding to the data
- bminADC/bmaxADC (optional)
Used to select the range of b-values for ADC calculation.
- bmaxDstar (optional)
Used to select the b-values for D* calculation.
- outputOptions
[‘ADC’,’f’,’D*’] (default) will output the ADC, f, and D*.
- src.original.fitting.PvH_KB_NKI.DWI_functions_standalone.select_b_values_standalone(all_bvalues, bmin=0, bmax=inf, specificBvals: list = [])[source]
Find b-values and their indices between bmin and bmax of a scan (bmin <= b <= b max) or of b-values that are defined in specificBvals. If specificBvals is defined, only b-values are returned that are acquired in the scan AND are present in specificBvals.
Parameters
- all_bvalueslist of int
All b values that are in the data in the order that they are stored
- bminint
Minimal b-value.
- bmaxint
Maximal b-value.
- specificBvalslist
List of b-values.
Returns
- bvalueindexlist of int
Indices of b-values between bmin and bmax.
- bvalueslist of int
B-values between bmin and bmax.