scilpy.viz package

scilpy.viz.chord_chart module

scilpy.viz.gradient_sampling module

scilpy.viz.scene_utils module

scilpy.viz.screenshot module

scilpy.viz.utils module

scilpy.viz.utils.affine_from_offset(orientation, offset)[source]

Create an affine matrix from a scalar offset in given orientation, in RPS coordinates for imaging.

Parameters:
  • orientation (str) – Name of the axis to visualize. Choices are axial, coronal and sagittal.

  • offset (float) – The offset of the texture image.

Returns:

affine – The affine transformation.

Return type:

np.ndarray

scilpy.viz.utils.check_mosaic_layout(img_count, rows, cols)[source]

Check whether a mosaic can be built given the image count and the requested number of rows and columns. Raise a ValueError if it cannot be built.

Parameters:
  • img_count (int) – Image count to be arranged in the mosaic.

  • rows (int) – Row count.

  • cols (int) – Column count.

scilpy.viz.utils.compute_cell_topleft_pos(idx, cols, offset_h, offset_v)[source]

Compute the top-left position of a cell to be drawn in a mosaic.

Parameters:
  • idx (int) – Cell index in the mosaic.

  • cols (int) – Column count.

  • offset_h – Horizontal offset (pixels).

  • offset_v – Vertical offset (pixels).

Returns:

  • top_pos (int) – Top position (pixels).

  • left_pos (int) – Left position (pixels).