core.objects package

Submodules

core.objects.baseobject module

core.objects.sceneobjects module

class core.objects.sceneobjects.AbdominalWall(obj_id, fill_with_fat: bool = False, fat_amount: float = 0.5, fat_up_vector: tuple = (0, 0, 1), outset_amplitude: float = 0.01, outset_frequency: float = 5, **kwargs)

Bases: BaseObject

Scene object defining the AbdominalWall.

Parameters:
  • fill_with_fat – Set to True if the AbdominalWall should be filled with fat

  • fat_amount – The amount of DeformableOrgan that is covered with fat (0..1)

  • fat_up_vector – The normal direction of the fat plane (TODO: how to sample vectors in the BaseObjectFactory?)

  • outset_amplitude – Max amount each vertex is offset along its normal

  • outset_frequency – Frequency of noise used for normal offset of each vertex

  • **kwargs – Keyword arguments to be passed on to BaseObject: source_file, tag

class core.objects.sceneobjects.DeformableOrgan(obj_id, young_modulus: float = 3000, poisson_ratio: float = 0.45, mass_density: float = 1, size_x: float = 0.3, size_y: float = 0.3, size_z: float = 0.3, add_concavity: bool = True, predeform_twist: bool = True, predeform_noise: bool = True, cut_to_fit: bool = True, **kwargs)

Bases: VolumetricOrgan

Scene object defining a deformable object.

Parameters:
  • young_modulus

  • poisson_ratio

  • mass_density

  • **kwargs – Keyword arguments to be passed on to BaseObject: source_file, tag

class core.objects.sceneobjects.FillFat(obj_id, fat_amount: float = 0.5, fat_up_vector: tuple = (0, 0, 1), source_file: str = '')

Bases: BaseObject

Scene object which fills the abdominal cavity (partially) with fat

Parameters:
  • fat_amount – The amount of DeformableOrgan that is covered with fat (0..1)

  • fat_up_vector – The normal direction of the fat plane (TODO: how to sample vectors in the BaseObjectFactory?)

class core.objects.sceneobjects.FixedAttachments(obj_id, surface_amount: float = 0.2, **kwargs)

Bases: BaseObject

Scene object defining fixed attachment points (fixed constraint).

Parameters:

**kwargs – Keyword arguments to be passed on to BaseObject: source_file, tag

class core.objects.sceneobjects.Force(obj_id, magnitude: float = 0.1, roi_radius: float | None = None, pull_only: bool = False, incremental: bool = False, ang_from_normal: float | None = None, **kwargs)

Bases: BaseObject

Scene object defining a force to apply to a subset of surface nodes.

Parameters:
  • magnitude

  • roi_radius

  • pull_only

  • incremental

  • **kwargs – Keyword arguments to be passed on to BaseObject: source_file, tag

class core.objects.sceneobjects.HepaticArtery(*args, **kwargs)

Bases: Vasculature

Scene object defining defaults for the hepatic artery in the liver.

Parameters:

pressure_gradient – Difference in blood pressure from perforation point to desired finest level of detail in the vascular tree in N / m^2. Default is the value for the hepatic vein.

class core.objects.sceneobjects.HepaticVein(*args, **kwargs)

Bases: Vasculature

Scene object defining defaults for the hepatic vein in the liver.

Parameters:

pressure_gradient – Difference in blood pressure from perforation point to desired finest level of detail in the vascular tree in N / m^2. Default is the value for the hepatic vein.

class core.objects.sceneobjects.Ligament(obj_id, stiffness: float = 210, rest_length_factor: float = 1, **kwargs)

Bases: BaseObject

Scene object defining a ligament.

Parameters:

**kwargs – Keyword arguments to be passed on to BaseObject: source_file, tag

class core.objects.sceneobjects.PortalVein(*args, **kwargs)

Bases: Vasculature

Scene object defining defaults for the portal vein in the liver.

Parameters:

pressure_gradient – Difference in blood pressure from perforation point to desired finest level of detail in the vascular tree in N / m^2. Default is the value for the hepatic vein.

class core.objects.sceneobjects.RigidOrgan(obj_id, rigid_transform: bool = True, **kwargs)

Bases: VolumetricOrgan

Scene object defining a rigid object.

Parameters:
  • obj_id – ID of the object as an uppercase character

  • rigid_transform – If True, object will be moved randomly such that it does not intersect with the deformable organ. Set to False if position from source file should be maintained.

  • **kwargs – Keyword arguments to be passed on to BaseObject: source_file, tag

class core.objects.sceneobjects.Tumor(obj_id, size_x: float = 0.01, size_y: float = 0.01, size_z: float = 0.01, organ_file: str = '', structure_tag: str = '', **kwargs)

Bases: BaseObject

Scene object defining a tumor inside another object.

Parameters:

**kwargs – Keyword arguments to be passed on to BaseObject: source_file

static check_parameters(**kwargs) None

Perform a sanity check on parameters that will be used for initialization.

Since the scene object generator block will first add the description of the scene objects to a template list before actually initializing them in its run() method, it makes sense to sanity check passed parameter values and potentially throw an error at setup before run() is called on each sample.

Parameters:

**kwargs

static update_parameters_from_instances(**kwargs: Dict[str, Any]) Dict[str, Any]

Read out information from containing organ scene object: File name, voxel resolution.

class core.objects.sceneobjects.Vasculature(obj_id, structure_tag: str = '', num_terminal_nodes: int = 90, pressure_gradient: float = 266.64473684210526, curved: bool = False, num_cylinder_polygons: int = 20, num_spline_points: int = 20, percentile_max_branch_length: float = 75.0, **kwargs)

Bases: BaseObject

Scene object defining a vascular tree inside an object.

Parameters:
  • num_terminal_nodes – Number of terminal nodes to generate as the drainage of the vascular tree (at the smallest radius level).

  • pressure_gradient – Difference in blood pressure from perforation point to desired finest level of detail in the vascular tree in N / m^2. Default is the value for the hepatic vein.

  • curved – If 3D model should have curved branches for this vessel tree.

  • num_cylinder_polygons – The number of sides for the 3D cylinder representation of each branch in the vascular tree.

  • num_spline_points – Number of support points to use for the spline describing the 3D representation of the branch if it is curved.

  • percentile_max_branch_length – Percentile of branch lengths which is considered the maximum branch length in the vascular tree. Used for 3D model creation. The maximum branch length is then used to decide which branches get a higher curvature (the longer, the curvier) -> the lower the percentile, the curvier the tree.

  • **kwargs – Keyword arguments to be passed on to BaseObject: source_file

static check_parameters(**kwargs) None

Perform a sanity check on parameters that will be used for initialization.

Since the scene object generator block will first add the description of the scene objects to a template list before actually initializing them in its run() method, it makes sense to sanity check passed parameter values and potentially throw an error at setup before run() is called on each sample.

Parameters:

**kwargs

classmethod name_additional_files() List[str]

Construct file patterns to match additional files that this scene object definition will cause in the run of the program.

Used to let blocks know their output up front when it depends on the scene objects.

set_perforation_flow(perf_flow: float) None
Parameters:

perf_flow – Blood flow through perforation point of the vessel tree in SI units (m^3 / s).

set_perforation_point(perforation_point: Tuple[int, int, int]) None
Parameters:

perforation_point – Perforation point position in oxygen demand map coordinates.

static update_parameters_from_instances(**kwargs: Dict[str, Any]) Dict[str, Any]

Read out information from containing organ scene object: File name, voxel resolution.

Module contents