Git Product home page Git Product logo

py4uview's Introduction

Py4Uview: Tools for Uview images

Introduction

Py4Uview provides a set of tools for images saved by Uivew, which is used by SPEELEEM in MAXPEEM to save the user's data in format of .dat file. Py4Uview can read the image and metadata from the file saved by Uview software.

Quick start

Install

python -m pip install py4uview

import

>>> import py4uview

How to use?

  1. use read_uv_dat() function to read the data and metadata.
In [1]: import py4uview as pu

In [2]: data = pu.read_uv_dat("./testfiles/LEEM.dat")

In [3]: data.metadata
Out[3]:
{'id': b'UKSOFT2001',
 'size': 104,
 'version': 8,
 'bitsperpix': 16,
 'width': 1024,
 'height': 1024,
 'noimg': 1,
 'attachedRecipeSize': 0,
 'isize': 288,
 ......

In [4]: data.data
Out[4]:
array([[3047, 2880, 2652, ..., 2716, 2630, 2562],
       [2789, 2848, 2862, ..., 2549, 2485, 2655],
       [2808, 2840, 2739, ..., 2640, 2602, 2747],
       ...,
       [3054, 2675, 2656, ..., 1926, 2017, 2021],
       [2885, 2949, 2705, ..., 1907, 1886, 1945],
       [2810, 2688, 2807, ..., 2009, 2025, 2641]], dtype=uint16)
  1. Use Uview class method read_dat() to read the dat file
In [1]: import py4uview as pu

In [2]: data = pu.Uview.read_dat("./testfiles/LEEM.dat")

In [3]: data.attrs
Out[3]:
{'id': b'UKSOFT2001',
 'size': 104,
 'version': 8,
 'bitsperpix': 16,
 'width': 1024,
 'height': 1024,
 'noimg': 1,
 'attachedRecipeSize': 0,
 'isize': 288,
 ......

In [4]: data.data
Out[4]:
array([[3047, 2880, 2652, ..., 2716, 2630, 2562],
       [2789, 2848, 2862, ..., 2549, 2485, 2655],
       [2808, 2840, 2739, ..., 2640, 2602, 2747],
       ...,
       [3054, 2675, 2656, ..., 1926, 2017, 2021],
       [2885, 2949, 2705, ..., 1907, 1886, 1945],
       [2810, 2688, 2807, ..., 2009, 2025, 2641]], dtype=uint16)

py4uview's People

Contributors

zhulincqu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.