Metadata-Version: 2.4
Name: obliqueslice
Version: 0.1.1
Summary: A package for slicing 3D numpy arrays along an oblique plane. Equivalent to obliqueslice in MATLAB.
Home-page: https://github.com/junapsantos/obliqueslice
Author: Juna Santos
Author-email: junapsantos@tecnico.ulisboa.pt
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: numpy
Requires-Dist: scipy
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# obliqueslice

A Python package for slicing 3D numpy arrays along an oblique plane. Equivalent to obliqueslice in MATLAB.

## Installation

```bash
pip install obliqueslice
```

## Usage

```python
import numpy as np
from obliqueslice import obliqueslice

# Create a 3D volume
volume = np.random.rand(100, 100, 100)

# Define a point and normal vector for the slice
point = [50, 50, 50]  # Point on the plane (x, y, z)
normal = [1, 1, 1]    # Normal vector to the plane

# Extract the oblique slice
slice_img, slice_u, slice_v, coords_3D = obliqueslice(volume, point, normal)
```

## Parameters

- `V`: 3D numpy array with shape (rows, cols, depths) indexed as (y, x, z)
- `point`: Point on the plane in world coordinates (x, y, z)
- `normal`: Normal vector to the plane
- `method`: Interpolation method ('linear' or 'nearest', default: 'linear')
- `threshold`: Threshold for cropping out the 'black' parts of the plane
- `fill_value`: Value to use for points outside the volume (default: 0)
- `interp_order`: Interpolation order (default: None, auto-determined from method)

## Returns

- `slice_img`: The extracted 2D slice
- `slice_u`: U coordinates of the slice grid
- `slice_v`: V coordinates of the slice grid  
- `coords_3D`: 3D coordinates for every point in the slice

## Requirements

- numpy
- scipy

## License

MIT License

## Author

Juna Santos (junapsantos@tecnico.ulisboa.pt)
