Metadata-Version: 2.1
Name: measury
Version: 1.3.2
Summary: A tool to measure pictures with scale_bars
License: MIT License
        
        Copyright © 2024 Jan Ullmann
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: repository, https://github.com/ullmannJan/measury
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<2.0
Requires-Dist: vispy
Requires-Dist: PyQt6
Requires-Dist: pyopengl
Requires-Dist: opencv-python
Requires-Dist: scipy
Requires-Dist: importlib-metadata; python_version < "3.11"

# Measury

![GitHub release (latest by date)](https://img.shields.io/github/v/release/ullmannJan/measury)
[![tests](https://github.com/ullmannJan/measury/actions/workflows/pytest.yml/badge.svg)](https://github.com/ullmannJan/measury/actions/workflows/pytest.yml)


![Measury_Logo](https://github.com/ullmannJan/measury/blob/main/img/logo/tape_measure_128.ico)

Measury is a measurement tool for microscope images. The goal ist to simplify and accelerate the measurements of structures from images.

## Functionality

![grafik](https://github.com/ullmannJan/measury/assets/102742052/44ee3b11-9188-4198-8e00-994649d147e1)

### Start with 
The program can be started via python or via the executable which is provided in the releases. In Python one simply calls:

    import measury
    measury.run()

### Load Images
Supports all image formats supported by ```opencv```.

### Automatic Scaling Bar Detection
Automatic Detection of Scaling bar. Just select the tool *identify scaling* and click on the scale bar. 
Microscope profiles can store locations of scale bar for certain types of microscopes for easier detection.

### Moving/Handling
You can move the image by dragging the mouse wheel or by selecting *move* mode

### Various Measurement Tools
There are several Tools available to measure your structures.

- Select (select objects without changing them)
- Line
- Rectangle
    - Square (by pressing Ctrl)
- Ellipse
    - Circle (by pressing Ctrl)
- Angle

## Development

First create a Python environment of your choice (conda, venv, ect.) and activate it.

    python -m venv venv

Then install the measury package from source

    pip install .

To run Measury simply by using the run.py file (which shows detailed logs)

    python run.py

or via 

    import measury
    measury.run()

### Running tests

To run tests you will need to install pytest as well

    pip install pytest

Then, simply calling pytest will run the tests. For the graphical tests a display server has to be installed on the system.

    pytest     
    #or
    python -m pytest


## Compiling

To compile this project it is advised to use ```pyinstaller```. 
> It is important to use Pyinstaller >= 6.0.0

This guides you through all steps that are needed for running it.
First, ```pyinstaller``` should be installed via pip or conda

    pip install pyinstaller 
    # or with conda
    conda install -c conda-forge pyinstaller

Finally, run the compiling script which calls pyinstaller

    python compile.py

This will result in a folder ```dist``` where the compiled project will be placed.

The ```compile.py``` script has the option to create a compressed .zip file of the project. You can set 

    zipped = True

to achieve this behavior.

