Skip to main content

tiny_2d_engine

t2de

A Tk.Canevas widget augmented to allow 2D acquisitions:

  1. load an image
  2. Add a calibration for the image to set up your own world coordinates
  3. Add Points or Lines on the image
  4. Save your project. You will find the word coordinates of all your objects in the projects, ready for an other usage.

It can be used as a standaone application with:

> tiny_2d_engine gui

Or as a Tkinter widget like here:

from tkinter import ttk
from tiny_2d_engine.main import Acquisition2D

def add_viewer_2d(otroot):
    """Injection of a viewer 2D to opentea"""
    title = "2D dialog"
    view2d_fr = ttk.Frame(otroot.notebook, name=title)
    otroot.notebook.add(view2d_fr, text=title)
    viewer = Viewer2D(
        view2d_fr,
        otroot,
    )
    return viewer


class Viewer2D(Acquisition2D):
    def __init__(self, master, otroot):
        super().__init__(master, standalone=True)
        self.pack( side="top")
        self.otroot = otroot

    def get(self):
        print("get data")
        return self.acq_canvas.as_dict()

    def set(self, data: dict):
        print("set data")
        self.acq_canvas.load_dict(data)

Disclaimer

This package is very young and uncomplete.

Known issues are:

  • A spurious contextual menu pops up sometimes
  • Changing image can fail
  • Moving the calibration around is quickly perturbating the acquisitions (You are not supposed to do that!)

But it works somehow.

Metadata

Release files for tiny-2d-engine 0.0.0

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

Source distribution (sdist)

Source distribution for tiny-2d-engine 0.0.0
File Size Uploaded
tiny_2d_engine-0.0.0.tar.gz 28.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tiny-2d-engine 0.0.0
File Interpreter ABI Platform
tiny_2d_engine-0.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 59.9 kB

Release files / tiny_2d_engine-0.0.0.tar.gz

Download URL tiny_2d_engine-0.0.0.tar.gz
Size 28.7 kB
Tags Source
SHA-256 checksum
How to use checksums
893cb61b7f1d366b79565ac3b51f7633a602a4431f43b72f80d2562afa6b4f9d
BLAKE2b-256 checksum
How to use checksums
a3c5b4bd95e3f2550a7723057ee924dbe9bb489fc8351f211ed413a2e2dbbd43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.14

Release files / tiny_2d_engine-0.0.0-py3-none-any.whl

Download URL tiny_2d_engine-0.0.0-py3-none-any.whl
Size 31.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
420681800c27027c2b5b3aae5c0a8da3611a5e3c3303840b6acdb91f97adfa61
BLAKE2b-256 checksum
How to use checksums
ece50f71a4f18f2d1506850b4482468ae056cf0d21ee42f6d90f6914760c5dcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.14

Release history Release notifications | RSS feed

This release

0.0.0 This release

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