title: API reference — pardesline description: The public Python API of pardesline: load, scan, datasets, describe, run, catalog, the Object classes, Dataset, Sample, Manifest and the MCP server, generated from the docstrings.
API reference¶
The top-level namespace is the public API; everything below is reachable as pardesline.<name>.
| Data | load, scan, datasets, Dataset, Sample, Manifest, Layout, License, cache settings |
| Objects | Object, PointCloud, Mesh, Volume, LabelMap, RawArray, Transform, Image, Frame |
| Catalog | catalog, modules, describe, Catalog, Module, Method, Parameter |
| Runner | run, RunResult, output directory |
| MCP server | build_server, the impl_* functions behind each tool |
PardesLine — 3D vision and medical imaging, locally or in the cloud.
import pardesline as pl
scan = pl.load("scan.ply") # a local point cloud (Object)
surface = scan.downsample(voxel_size=0.01).poisson(depth=9)
surface.save("surface.ply") # + surface.ply.pardesline.json (frame, licence…)
ds = pl.load("rire_brain") # a dataset: manifest + fetched-on-access files
s = ds[0]; s.roles # ['ct', 'mr_t1']
moved = s.ct.align(s.mr_t1) # rigid registration, transform in moved.transform
ds = pl.load("/data/study_A", license="internal", units={"mesh": "mm"}) # your own folder
pl.run("simpleitk_registration", "rigid", "ct.mha", moving="mr.mha")
pl.catalog().describe("point_cloud_reconstruction.poisson")
Everything under pl.run / pl.load executes on this machine. The cloud
client (pl.login, pl.upload, pl.share, hosted compute, viewers)
lives in pardesline.cloud and stays reachable from the top level.
load
¶
load(ref: str | PathLike, *, manifest: str | PathLike | None = None, assume: bool = False, interactive: bool = False, save_draft: bool = True, layout: Layout | dict[str, Any] | None = None, kind: str | None = None, **answers: Any) -> Object | Dataset
Open a file as an :class:Object or a dataset as a :class:Dataset.
A raw array file (.npy, .npz, .bin) needs layout= (dtype,
shape, columns / key) and takes kind= ("points", "volume", "labels");
with a layout and no kind, a (N,k) shape is points and a (a,b,c)
shape is a grid.
For a folder without a confirmed manifest - or a Hub repo without a
bundled one - pl.scan drafts a manifest. Then: strict (default)
raises :class:NeedsConfirmation listing the open questions and saves
the draft; assume=True loads with unknowns left unknown (and warns);
interactive=True asks in the terminal; keyword answers
(license=, units=, frame=, labels=, pairing=, types=, layout=) fill
the draft directly.
datasets
¶
datasets(*, tag: str | None = None, scheme: str | None = None) -> list[Manifest]
The manifests bundled with the package (pl.load(name) works on
each). tag="medical" or scheme="hf" filter the list.
describe
¶
describe(what: str) -> str
describe("module"), describe("module.method") or a dataset name.
run
¶
run(module: str, method: str | None = None, input: str | PathLike | None = None, /, output: str | PathLike | None = None, *, moving: str | PathLike | None = None, params: dict[str, Any] | None = None, timeout: float = DEFAULT_TIMEOUT, python: str | None = None, on_log: Callable[[str], None] | None = None, on_progress: Callable[[int], None] | None = None, cwd: str | PathLike | None = None, **kwargs: Any) -> RunResult
Run one algorithm on a local file and return a :class:RunResult.
run("point_cloud_processing", "voxel_downsample", "scan.ply", voxel_size=0.05)
or run("point_cloud_processing.voxel_downsample", "scan.ply", ...).
Parameters go as keyword arguments (or in params); they are validated
against the catalog before anything runs. The first three arguments are
positional-only, so a parameter that happens to be called method or
input can still be passed by keyword. Two-input methods (registration)
take the moving file through moving. The result is written to
output or to :func:output_dir. Raises :class:ParameterError or
:class:RunError.
cache_dir
¶
cache_dir() -> Path
The root folder where datasets are cached.
PARDESLINE_CACHE or :func:set_cache_dir override the default
~/.cache/pardesline. The folder is created on first use.
Examples:
>>> import pardesline as pl
>>> pl.cache_dir().name
'pardesline'
set_cache_dir
¶
set_cache_dir(path: str | PathLike | None) -> Path
Point the cache somewhere else (None restores the default).
output_dir
¶
output_dir() -> Path
Where runs write their result when no output is given.
Defaults to <system temp>/pardesline-outputs; change it with
:func:set_output_dir.
set_output_dir
¶
set_output_dir(path: str | PathLike) -> Path
Set where algorithm outputs go when no output= is given; returns the resolved path.