Skip to main content

A simple CLI for sampling point clouds from large volumetric datasets

Project description

pypi Python Version

CLI for Distributed Point Cloud Sampling

pip install nps-cli

Get started

nps --help
Usage: nps [OPTIONS]

Options:
  --cv-path TEXT                  Path to CloudVolume data.  [required]
  --mip INTEGER                   MIP level to use.  [default: 0]
  --timestamp INTEGER             Optional timestamp for the dataset version
                                  (graphene only).
  --sample_svids                  Sample SVIDs in addition to points (default:
                                  False) Graphene only.
  -o, --output-dir DIRECTORY      Output directory.  [default: ./nps_output]
  --worker-type [LocalWorker|LSFWorker|SlurmWorker]
                                  Type of worker to use for sampling.
                                  [default: LocalWorker]
  --num-workers INTEGER           Number of workers for blockwise sampling.
                                  [default: 8]
  --cpus-per-worker INTEGER       Number of CPUs per worker.  [default: 4]
  --queue TEXT                    Queue name (for LSF backend).  [default:
                                  local]
  --fraction FLOAT                Fraction of points to sample [0.0, 1.0].
                                  [default: 0.001]
  --bbox INTEGER...               Bounding box: begin_x begin_y begin_z
                                  end_x end_y end_z (in voxels).
  --block-size INTEGER...         Block size in voxels (X Y Z).  [default:
                                  128, 128, 128]
  -h, --help                      Show this message and exit.

Example usage

nps --cv-path precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/segmentation

Sample point clouds within a FlyEM Hemibrain subvolume:

nps --cv-path precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/segmentation --bbox 15347 19712 18606 15859 20224 19118 --fraction 0.01

Reading Point Clouds

Please refer to the pocaduck repo on how to read point clouds from the output directory:

from pocaduck import Query

# Create a query object
query = Query(storage_config=<PATH>) # path to folder where nps output is stored

# Get all available labels
labels = query.get_labels()
print(f"Available labels: {labels}")

# Get all points for a label (aggregated across all blocks)
points = query.get_points(label=12345)
print(f"Retrieved {points.shape[0]} points for label 12345")

# Close the query connection when done
query.close()

For optimized point cloud reading, consider this.

Deploy

python -m build
twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nps_cli-0.1.3.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nps_cli-0.1.3-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file nps_cli-0.1.3.tar.gz.

File metadata

  • Download URL: nps_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for nps_cli-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5a1a6a47dd4909554ee07fb9ecd7ea835f401f524033be7fb9267dee878518cf
MD5 a84d4168c4f96a93f534df3a4f20b399
BLAKE2b-256 733a630e49e2aa40ceee4a5cbac1d546fafd2700fc3f18cb70a91d3f3e40b3b9

See more details on using hashes here.

File details

Details for the file nps_cli-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: nps_cli-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for nps_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f3e201d8610651d169df57089daa45be34ddc656653c3c149780e2686908778c
MD5 277869560618e78609d11977bd3622a3
BLAKE2b-256 cc63001b77e088653242a9ce6fe44d2f49b5d383254df7c8fa35dfaa757b1392

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page