nrrdAux module
Warning
The following description is partially AI generated, it might be incomplete or incorrect.
- nrrdAux.cleanPtName(pt)[source]
Cleans the patient’s name by removing any letters and underscores, leaving only numeric characters.
- Args:
pt (str): The name of the patient (string with potential letters and underscores).
- Returns:
str: A cleaned string containing only the numeric part of the patient name.
- nrrdAux.computeVolumetricData(mesh, mat='ImageFile', returnBounds=False)[source]
Computes the volumetric data for a specified region of the mesh, based on a scalar field (e.g., ‘ImageFile’). The mesh is thresholded, and the volume and bounds are computed.
- Args:
mesh (pyvista.PolyData): The clinical data mesh. mat (str, optional): The scalar field to threshold and compute. Defaults to ‘ImageFile’. returnBounds (bool, optional): If True, returns the bounds and sizes of the volume. Defaults to False.
- Returns:
float: The volume of the thresholded region if returnBounds is False. tuple: If returnBounds is True, returns the volume, bounds, and sizes of the region.
- nrrdAux.findAllPtFields(pt)[source]
Finds all available NRRD fields for a given patient by searching the NRRD library directory.
- Args:
pt (str): The name of the patient.
- Returns:
list: A list of available field names extracted from the NRRD files.
- nrrdAux.findPtData(pt, mat, strToRemove='multi')[source]
Finds the path to a specific NRRD data file for the patient, given the material name (e.g., ‘lumen’).
- Args:
pt (str): The name of the patient. mat (str): The material name to search for (e.g., ‘lumen’). strToRemove (str, optional): String to filter out unwanted files (e.g., ‘multi’). Defaults to ‘multi’.
- Returns:
str: The full file path to the patient’s NRRD data file.
- nrrdAux.loadNRRD(self, mat='general')[source]
Loads a specific NRRD file for the patient and integrates the data into the patient’s clinical mesh. The mesh is scaled based on the header’s spatial information, and the data is thresholded to create a segmentation field.
- Args:
mat (str, optional): The material type to load (e.g., ‘lumen’, ‘wall’). Defaults to ‘general’.
- Returns:
pyvista.PolyData: The updated clinical data mesh with the new segmentation field.
- nrrdAux.loadNRRDcomposition(self)[source]
Loads the NRRD composition file for the patient, which contains multi-region data (e.g., plaque composition). The data for each region is thresholded and combined with the wall data to compute segmented fields for each region.
- Returns:
self: The patient object with updated clinical data and available region information.