kevinyamauchi / cellier

A multiscale cellular architecture visualization toolkit.
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Add slicing #7

Open kevinyamauchi opened 7 months ago

kevinyamauchi commented 7 months ago

Did not add slicing in #4

kevinyamauchi commented 6 months ago

Oblique slicing

I am scoping oblique slicing to be sampling an arbitrary 2D plane from a 3D space. Additional axes can be selected/sliced, but those are axis aligned.


class ObliqueWorldSlice:
    """Dataclass containing data to construct the world slice."""
    point: tuple[float, ...]
    slice_normal: tuple[int, int, int]
    spatial_dims: tuple[int, int, int]
    displayed_dims: tuple[int, int]

To get the data slice:

  1. extract the 3D subvolume
  2. convert the point and slice_normal to data coordinates
  3. construct the plane in data coordinates
  4. sample
  5. determine the offset of the data origin from the point. this will be used to set the transform. the point in world coordinates is set to (0, 0) in the rendered scene.