Skip to main content

Semantic Label Converter [slcpy]

https://img.shields.io/github/v/release/SMLC-NYSBC/Semantic_Label_Creator https://github.com/SMLC-NYSBC/Semantic_Label_Creator/actions/workflows/python-publish_PyPi.yml/badge.svg Documentation Status

Python package for converting segmented point cloud to trimmed semantic label masks as well as converting unsegmented semantic labels into a general point cloud. The point cloud to semantic conversion is achieved by drawing a circle with fixed diameter along the line given as points. Additionally the image dataset can be trimmed with or without padding to indicated size. The semantic to point cloud conversion is done before or after stitching of images (with or without padding) by selecting at each Z position all points maxima’s and saving their 3D coordinates in array.

Features

  • Convert 3D point cloud from (.am) files to semantic label mask

  • Cut and stitch images/masks withe predefined settings

  • Convert semantic label mask to 3D point cloud

Installation

Stable release

To install Semantic_Label_Creator, run this command in your terminal:

$ pip install slcpy

This is the preferred method to install Semantic_Label_Creator, as it will always install the most recent stable release.

From sources

The sources for Semantic_Label_Creator can be downloaded from the Github repo.

You can either clone the public repository:

$ git clone git://github.com/SMLC-NYSBC/Semantic_Label_Creator
$ python setup.py install

or install is with pip:

$ pip install slcpy

Usage

To use Semantic_Label_Creator in a project:

from slcpy.main import slcpy
_, label_mask = slcpy_semantic(dir_path,
                               mask=Ture,
                               pixel_size=None,
                               circle_size=250,
                               multi_layer=True,
                               trim_mask=False,
                               trim_size=64)

point_could = slcpy_graph(dir_path=label_mask,
                          filter_img=5,
                          down_sampling=Ture)

or with terminal to build semantic label:

   slcpy_semantic -dir C:/... -o C:/.../output

string [-dir] Directory of the folder that contain data.
   [-default] os.getcwd() + r'\data'
string [-o]   Output directory to the folder where all of converted filed are stored.
   [-default] os.getcwd() + r'\data' + r'\output'
bool   [-m]   Indicate if mask is included.
   [-default] True
float  [-px]  Images pixel size in Angstrom. If None pixel size is calculated from image metadata
   [-default] None
int    [-d]   Diameter in Angstrom of a circle that would be drawn a semantic mask
   [-default] 250
bool   [-l]   Specified if lines should have independent labeling
   [-default] False
bool   [-t]   Specified if the input image has to be trim to fit labels.
   [-default] True
int    [-xy]  Define size in pixels of output images.
   [-default] 64
int    [-z]  Define size in pixels of output images.
   [-default] 64
bool   [-f]  If True only images containing any data are saved.
   [-default] True
int    [-s]  Overlay size used for trimming images.
   [-default] 25

with terminal to stitch images:

   slcpy_stitch -dir C:/... -o C:/.../output -m True -pf mask -b True
string [-dir] Directory of the folder that contain data.
   [-default] os.getcwd() + r'\data'
string [-o]   Output directory to the folder where all of converted filed are stored.
   [-default] os.getcwd() + r'\data' + r'\output'
bool   [-m]   If True output images are treated as mask not images.
   [-default] True
string [-pf]  Additional prefix name for each image.
   [-default] None
bool   [-b]   If True output stitched image as binary mask.
   [-default] True
string [-dt]   Output numpy data type.
   [-default] int8

with terminal to build point cloud from image:

   slcpy_graph -dir C:/... -o C:/.../output -f 6 -c 3 -s cvs
string [-dir] Directory of the folder that contain data.
   [-default] os.getcwd() + r'\data'
string [-o]   Output directory to the folder where all of converted filed are stored.
   [-default] os.getcwd() + r'\data' + r'\output'
int    [-f]   Filter size matrix for denoising.
   [-default] 6
bool   [-d]   Down-sample point cloud by the factor of.
   [-default] True
string [-s]   Define format of output point cloud.
   [-default] all
   [-option] all, csv, numpy

Metadata

Release files for slcpy 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slcpy 0.3.6
File Size Uploaded
slcpy-0.3.6.tar.gz 33.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for slcpy 0.3.6
File Interpreter ABI Platform
slcpy-0.3.6-py3-none-any.whl Python 3 none any Details

Total release size: 63.6 kB

Release files / slcpy-0.3.6.tar.gz

Download URL slcpy-0.3.6.tar.gz
Size 33.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dc633481ba8d66f43327cb1b0899137d2740bb4d1392973b9148466d0cdffc5c
BLAKE2b-256 checksum
How to use checksums
d56f7456ce776ac77ba38692c7d4730635a604828c9f0c1a68f5f76d419780d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / slcpy-0.3.6-py3-none-any.whl

Download URL slcpy-0.3.6-py3-none-any.whl
Size 29.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ceccf9ae6ef95496182fdde30970d0a70b1aafbe951616867c0282f482bb4485
BLAKE2b-256 checksum
How to use checksums
a55d629b46905a80063f78bb9ae231560e46b38c12304188e5748f321c25d68f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release history Release notifications | RSS feed

This release

0.3.6 This release

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page