patientMain module
Warning
The following description is partially AI generated, it might be incomplete or incorrect.
- class patientMain.myPatient(name, customPath=None)[source]
Bases:
object- compareFields(fieldName='u', classicStep=1, growthStep=1, clim=[-10, 80], scaling=None, normal=None, center=None)[source]
myPatient.compareFields Compares the fieldName results between the classic and growth results respectively for the classicStep and growthStep steps. You can also specify the color limit clim, the scaling factor scaling, the normal vector for slicing normal and the center point for slicing ‘center’ for the slice. If you specify only the normal the my_data.PlaqueSliceCenter will be used as center point. If you specify only the center point the normal will be set to [0,0,1].
## Parameters: fieldName (str): Name of the field to compare. Default is ‘u’. classicStep (int): Step value for classic field. Default is 1. growthStep (int): Step value for growth field. Default is 1. clim (list): List of two values representing the color limit. Default is [-10, 80]. scaling (string): Scaling factor. Default is None. normal (list nx, nx, nz): Normal vector for slicing. Default is None. center (list cx, cy, cz): Center point for slicing. Default is None.
Returns: None
- compareHist(fieldName='u', classicStep=1, growthStep=1, scaling=None, limitRegions=None, bins=200, clim=None, density=True)[source]
myPatient.compareHist compares the histogram of the fieldName results between the classic and growth results respectively for the classicStep and growthStep steps. It works by calling the getCompareHist function.
## Parameters: fieldName (str): Name of the field to compare. Default is ‘u’. classicStep (int): Step value for classic field. Default is 1. growthStep (int): Step value for growth field. Default is 1. scaling (string): Scaling factor. Default is None. limitRegions (str): The region to limit the field values. Default is None but you can specify: - ‘VascularTissue’ to filter data for all the vascular wall - ‘PlaqueRegion’ to filter data for al tissues in the plaque region - ‘PlaqueRegionVascularTissue’ to filter data for the vascular wall in plaque region bins (int): Number of bins for the histogram. Default is 200. clim (list): List of two values representing the color limit. Default is None. density (bool): If True, the histogram will be displayed as a density plot. Default is True.
- computeGeometricalFeatures()[source]
myPatient.computeGeometricalFeatures computes the geometrical features for the patient: - Volume ratios - Bounding boxes - Sizes
- computeRadii(maxObstruction=False)[source]
myPatient.computeRadii Computes the average radii (internel, external, wall thickness) based on the mesh area. maxObstruction=True is used to compute the lumen in the plaque region (minimal region) instead of the average.
- getClinicalData(mat='general', materials=False, addLume=False, plotter=None)[source]
myPatient.getClinicalData retrieves the clinical data associated with the patient from NRRD volumetric data.
## Parameters mat (str): The material to display. Default is ‘general’. You can specify: - ‘lumen’ to display the lumen. - ‘wall’ to display the wall. - ‘LRNC’ or ‘IPH’ to display the Lipid Rich Necrotic Core or Intraplaque Hemorrhage. - ‘CALC’ to display the calcification. materials (bool): If True, all materials will be displayed. Default is False.
- getCompareHist(fieldName='u', classicStep=1, growthStep=1, scaling=None, limitRegions=None, bins=200, clim=None, density=True, ax=None, colors=['blue', 'red'], opacity=0.5)[source]
myPatient.getCompareHist retrieves the histogram of the fieldName results between the classic and growth results respectively for the classicStep and growthStep steps.
## Parameters: fieldName (str): Name of the field to compare. Default is ‘u’. classicStep (int): Step value for classic field. Default is 1. growthStep (int): Step value for growth field. Default is 1. scaling (string): Scaling factor. Default is None. limitRegions (str): The region to limit the field values. Default is None but you can specify: - ‘VascularTissue’ to filter data for all the vascular wall - ‘PlaqueRegion’ to filter data for al tissues in the plaque region - ‘PlaqueRegionVascularTissue’ to filter data for the vascular wall in plaque region bins (int): Number of bins for the histogram. Default is 200. clim (list): List of two values representing the color limit. Default is None. density (bool): If True, the histogram will be displayed as a density plot. Default is True.
- getField(fieldName='u', step=1, GRLab='Classic', clim=[-10, 80], scaling=None, plotter=None, slices=False, normal=None, center=None, threeshold=None, textLabel=True, scalarBar=True, cmap=None)[source]
myPatient.getField retrieves the field associated with the patient using the Pyvista mesh data.
## Parameters: fieldName (str): Name of the field to retrieve. Default is ‘u’. step (int): Load step value for the field. Default is 1. GRLab (str): The label for the field. Default is ‘Classic’ otherwise you can specify ‘G&R’. clim (list): List of two values representing the color limit. Default is [-10, 80]. scaling (string): Scaling factor. Default is None. plotter (pyvista.plotting.plotting.Plotter): The plotter object. Default is None. slices (bool): If True, the field will be displayed in slices. Default is False. If you specifiy only slices=True the principal slices will be displayed. normal (list nx, nx, nz): Normal vector for slicing. Default is None. center (list cx, cy, cz): Center point for slicing. Default is None which leads to myPatient.PlaqueSliceCenter.
- getFieldValues(fieldName='u', step=1, GRLab='Classic', scaling=None, limitRegions=None)[source]
myPatient.getFieldValues retrieves the array of values associated with the specified fieldName.
## Parameters: fieldName (str): Name of the field to retrieve. Default is ‘u’. step (int): Load step value for the field. Default is 1. GRLab (str): The label for the field. Default is ‘Classic’ otherwise you can specify ‘G&R’. scaling (string): Scaling factor. Default is None. limitRegions (str): The region to limit the field values. Default is None but you can specify: - ‘VascularTissue’ to filter data for all the vascular wall - ‘PlaqueRegion’ to filter data for al tissues in the plaque region - ‘PlaqueRegionVascularTissue’ to filter data for the vascular wall in plaque region
- getHist(fieldName='u', step=1, GRLab='Classic', scaling=None, limitRegions=None, ax=None, bins=30, label='', alpha=1, density=False, color='blue')[source]
myPatient.showHist shows the histogram of the fieldName results for the patient. It works by calling the getHist function.
## Parameters: fieldName (str): Name of the field to show. Default is ‘u’. step (int): Load step value for the field. Default is 1. GRLab (str): The label for the field. Default is ‘Classic’ otherwise you can specify ‘G&R’. scaling (string): Scaling factor. Default is None. limitRegions (str): The region to limit the field values. Default is None but you can specify: - ‘VascularTissue’ to filter data for all the vascular wall - ‘PlaqueRegion’ to filter data for al tissues in the plaque region - ‘PlaqueRegionVascularTissue’ to filter data for the vascular wall in plaque region bins (int): Number of bins for the histogram. Default is 150.
- getMaterials(slices=False, plotter=None, normal=None, center=None, addBar=False, addMesh=False, addLegend=True)[source]
myPatient.getMaterials retrieves the materials associated with the mesh field.
- Args:
slices (bool): If True, the materials will be displayed in slices. Default is False. If only slices=True is specified, the principal slices will be displayed. plotter (pyvista.plotting.plotting.Plotter): The plotter object. Default is None. normal (list nx, nx, nz): Normal vector for slicing. Default is None. center (list cx, cy, cz): Center point for slicing. Default is None which leads to myPatient.PlaqueSliceCenter.
- loadClinicalData(allData=False)[source]
myPatient.loadClinicalData loads the clinical data for the patient. If allData=True, it will load all the available fields. Otherwise it only loads the ‘lumenSegmentation’ and ‘wallSegmentation’ fields. It also computes the geometrical features like volume ratios and bounding boxes.
- loadFEMJSON()[source]
myPatient.loadFEMJSON loads the FEM JSON file for the patient. In particular it loads: - PlaqueSliceCenter - NodesGlobal - NodesPlaqueRegion - Classic FEA steps - Growth FEA steps
- loadFields(fieldsName=['u', 'v'], step=1, GR=False)[source]
myPatient.loadFields loads the fields associated with the patient’s data.
- loadMaterials()[source]
myPatient.loadMaterials use the c2 coefficient from the FEM results to load the materials. It works using the loadMaterialFromTXT function from importMeshFromTXT.py.
- showClinicalData(mat='general', materials=False, addLume=False, plotter=None)[source]
myPatient.showClinicalData shows the clinical data for the patient. It calls the getClinicalData function.
## Parameters mat (str): The material to display. Default is ‘general’. You can specify: - ‘lumen’ to display the lumen. - ‘wall’ to display the wall. - ‘LRNC’ or ‘IPH’ to display the Lipid Rich Necrotic Core or Intraplaque Hemorrhage. - ‘CALC’ to display the calcification. materials (bool): If True, all materials will be displayed. Default is False.
- showClinicalInfo()[source]
myPatient.showClinicalInfo shows the clinical information for the patient in a tabular form.
- showFEMJSON()[source]
myPatient.showFEMJSON shows the FEM JSON file for the patient in a tabular form.
- showField(fieldName='u', step=1, GRLab='Classic', clim=[-10, 80], scaling=None, plotter=None, slices=False, normal=None, center=None)[source]
myPatient.showField shows the field fieldName for the patient by visualizing the Pyvista results from the getField function.
## Parameters: fieldName (str): Name of the field to show. Default is ‘u’. step (int): Load step value for the field. Default is 1. GRLab (str): The label for the field. Default is ‘Classic’ otherwise you can specify ‘G&R’. clim (list): List of two values representing the color limit. Default is [-10, 80]. scaling (string): Scaling factor. Default is None. plotter (pyvista.plotting.plotting.Plotter): The plotter object. Default is None. slices (bool): If True, the field will be displayed in slices. Default is False. normal (list nx, nx, nz): Normal vector for slicing. Default is None. center (list cx, cy, cz): Center point for slicing. Default is None which leads to myPatient.PlaqueSliceCenter.
- showHist(fieldName='u', step=1, GRLab='Classic', scaling=None, limitRegions=None, bins=150)[source]
myPatient.showHist shows the histogram of the fieldName results for the patient. It works by calling the getHist function.
## Parameters: fieldName (str): Name of the field to show. Default is ‘u’. step (int): Load step value for the field. Default is 1. GRLab (str): The label for the field. Default is ‘Classic’ otherwise you can specify ‘G&R’. scaling (string): Scaling factor. Default is None. limitRegions (str): The region to limit the field values. Default is None but you can specify: - ‘VascularTissue’ to filter data for all the vascular wall - ‘PlaqueRegion’ to filter data for al tissues in the plaque region - ‘PlaqueRegionVascularTissue’ to filter data for the vascular wall in plaque region bins (int): Number of bins for the histogram. Default is 150.
- showInfo()[source]
myPatient.showInfo shows the additional information for the patient in a tabular form.
- showMaterials(slices=False, plotter=None)[source]
Visualizes the materials in the mesh calling the getMaterials function.
## Parameters: slices (bool): If True, the materials will be displayed including principal slices. Default is False.