opentps.core.processing.C_libraries package

Submodules

opentps.core.processing.C_libraries.libInterp3 module

opentps.core.processing.C_libraries.libInterp3_wrapper module

interpolateTrilinear(image, gridSize, interpolatedPoints, fillValue=0, tryGPU=True)

Interpolate a 3D image using trilinear interpolation.

Parameters:
  • image (numpy.ndarray) – 3D image to be interpolated.

  • gridSize (tuple) – Size of the 3D image.

  • interpolatedPoints (numpy.ndarray) – 3D coordinates of the points to be interpolated.

  • fillValue (float, optional) – Value to be used for points outside the image. The default is 0.

  • tryGPU (bool, optional) – Try to use GPU for interpolation. The default is True.

Returns:

interpolatedImage – Interpolated image.

Return type:

numpy.ndarray

opentps.core.processing.C_libraries.libRayTracing module

opentps.core.processing.C_libraries.libRayTracing_wrapper module

WET_raytracing(SPR, beam_direction, ROI=[])

Compute the Water Equivalent Thickness (WET) along the beam direction for each voxel of the SPR image.

Parameters:
  • SPR (SPR) – The SPR image.

  • beam_direction (list) – The beam direction.

  • ROI (ROI, optional) – The ROI to consider. The default is []. If ROI is not provided, the WET is computed for the whole SPR image.

Returns:

WET – The WET array of dimension 3 (x,y,z) with the WET value for each voxel.

Return type:

numpy array

compute_position_from_range(SPR, spot_positions, spot_directions, spot_ranges)

Compute the Cartesian position of a list of spots given their position, direction and range in water.

Parameters:
  • SPR (SPR) – The SPR image.

  • spot_positions (list) – The list of spot positions.

  • spot_directions (list) – The list of spot directions.

  • spot_ranges (list) – The list of spot ranges in water.

Returns:

CartesianSpotPositions – The list of Cartesian spot positions.

Return type:

list

transport_spots_inside_target(SPR, Target_mask, SpotGrid, direction, minWET, LayerSpacing)

Transport a list of spots until they reach the target and compute the energy layers crossed by each spot.

Parameters:
  • SPR (SPR) – The SPR image.

  • Target_mask (Mask) – The target mask.

  • SpotGrid (dict) – The list of spots.

  • direction (list) – The beam direction.

  • minWET (float) – The minimum WET value to consider.

  • LayerSpacing (float) – The layer spacing.

transport_spots_inside_target_map(SPR, Target_mask, SpotGrid, direction, minWET, LayerSpacing)
transport_spots_to_target(SPR, Target_mask, SpotGrid, direction)

Transport a list of spots until they reach the target.

Parameters:
  • SPR (SPR) – The SPR image.

  • Target_mask (Mask) – The target mask.

  • SpotGrid (dict) – The list of spots.

  • direction (list) – The beam direction.

Module contents