Skip to content

ladisk/hcc_python_tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hcc Python tools

This repository contains various tools, used to work with Telops .hcc files in LADISK.

To read the .hcc file data, the PythonTelopsToolbox package, provided by Telops, is used. This is not included with this repository.

Other external packages, required to use these tools, can be installed using pip with the provided requirements file:

pip install -r requirements.txt

Basic usage

A simple example of basic usage is provided below:

from telops_hcc_tools import read_hcc, read_segmented
import numpy as np
import napari


# Read a single .hcc file
file_single = 'hcc_example/example_1.hcc'

time, frames, header = read_hcc(file_single, allow_pickle=False)
print(f'Read single `.hcc` file. Image data shape: {frames.shape}.')

# Read a segmented .hcc measurement
files_segmented = [
    'hcc_example/example_1.hcc',
    'hcc_example/example_2.hcc'
    ]

time_s, frames_s, header_s = read_segmented(files_segmented, allow_pickle=False)
print(f'Read segmented `.hcc` file. Image data shape: {frames_s.shape}.')

# Display the read data using napari

def update_t_annotation(event):
        step = viewer.dims.current_step[0]
        viewer.text_overlay.text = f"{time[step]:.5f} s"

viewer = napari.view_image(data=frames, colormap='viridis', title='exmaple footage')
viewer.text_overlay.visible = True
viewer.dims.events.current_step.connect(update_t_annotation)
napari.run()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages