pypeline.impl.oct package

Submodules

pypeline.impl.oct.basedata module

class pypeline.impl.oct.basedata.BaseData(shape, dtype)[source]

Bases: object

Base class for all common data types: spectrum, interferogram, complex and real array, image. etc.

data

the array that contains the actual data

shape

list of int that is the shape of the data array

dtype

the data type for each element in the data array

dsize

total number of elements in data array

from_file(file, hdr_size=0)[source]

read in data from file

Parameters:
  • file (str) – path to the file that coantains the data, file should be binary
  • hdr_size (int) – file header size in bytes

Returns:

pypeline.impl.oct.conf module

This file specifies all the general impl inis

TODO: define what is need to be configured here

pypeline.impl.oct.image module

pypeline.image

this module contains misc to manipulate general images, 8bit, 16bit, 24bit, etc.

set_dimension: set_voxsize:

display:
display image, default to adjust the image size based on the vox_size
merge: merge2d: merge3d
merge different color/measurement channels
project:
min/max intensity projection, mean projection

segmentation:

class pypeline.impl.oct.image.Image(shape, dtype)[source]

Bases: pypeline.impl.oct.basedata.BaseData

pypeline.impl.oct.mock module

pypeline.impl.oct.mock.gen_basedata()[source]
pypeline.impl.oct.mock.gen_spectrum()[source]

pypeline.impl.oct.proc module

preprocess

this module contains all the common processing of OCT rawdata before reconstruct it into images

pypeline.impl.oct.proc.adjust_phase()[source]
pypeline.impl.oct.proc.calc_dc(data, axis=-1, method='mean')[source]
pypeline.impl.oct.proc.corr_dispersion(data, disp_coeff)[source]

compensate dispersion using 3rd and 2nd order dispersionc oeff

pypeline.impl.oct.proc.corr_phase_jit(data)[source]
pypeline.impl.oct.proc.gen_calib(data, win=[], order=4, conf_file_path=[])[source]

function gen_calib_coeff(data, win = [], file_path = []) generate the calibration coeff data as non-linear array from 0 to 1 data: input data win: window to filter the data for calcuation file_path: file to save the calib_coeff

pypeline.impl.oct.proc.gen_disp(data, win=[], conf_file_path=[])[source]

function gen_disp_coeff(data, win = [], file_path = []) generate the disp coeff (3rd and 2nd order) by mirror signal data: input data win: the window to filter data update_cfg: update pypeline.ini

pypeline.impl.oct.proc.gen_disp2(data, win=[0, 1], conf_file_path=[])[source]

function gen_disp_coeff2(data, win = [], file_path = []) generate the disp coeff (3rd and 2nd order) iteratively data: input data win: the window to filter data update_cfg: update pypeline.ini

pypeline.impl.oct.proc.gen_fr_data(data, r2i_ratio, bandwidth=0.4)[source]

function gen_fr_data(data, r2i_ratio, bandwidth = 0.4) generate the complex data for full range OCT reconstruction data: input data r2i_ratio: the real to imaginary ratio, tan(phi) where phi is phase modulation depth bandwidth: the bandwidth to separate the real and imaginary part.

pypeline.impl.oct.proc.get_display_range(image, disp_range=array([ 50, 100]))[source]
pypeline.impl.oct.proc.get_psf(data, disp_coeff, calib_coeff)[source]
pypeline.impl.oct.proc.recon_aline()[source]
pypeline.impl.oct.proc.recon_img()[source]
pypeline.impl.oct.proc.recon_magnitude_img(data, full_range=0, fft_num=2048, scale='log')[source]

function recon_magnitude_img(data, real_input = True, depth_dim = 1024, scale = ‘log’, disp_range = [0.5, 0]) reconstruct the amplitude image: data: input data full_range: if ture, use full range depth_dim: pixel num in depth scale: log or linear disp_range: display range for contrast/dynamic range, relative value if within [0,1],

pypeline.impl.oct.proc.recon_phase_img(data, thresh=0, full_range=0, fft_num=2048, filter_size=3)[source]

function recon_magnitude_img(data, real_input = True, depth_dim = 1024, scale = ‘log’, disp_range = [0.5, 0]) reconstruct the amplitude image: data: input data full_range: if ture, use full range depth_dim: pixel num in depth scale: log or linear disp_range: display range for contrast/dynamic range, relative value if within [0,1],

pypeline.impl.oct.proc.rescale_range(image, disp_range, img_format='uint8')[source]

pypeline.impl.oct.remove_dc module

pypeline.impl.oct.remove_dc.remove_dc(data, axis=0, method='mean')[source]

pypeline.impl.oct.spectrum module

pypeline.spectrum

this module defines the spectrum or interferogram in OCT it should be the subclass of BaseData

class pypeline.impl.oct.spectrum.Spectrum(shape, dtype)[source]

Bases: pypeline.impl.oct.basedata.BaseData

spectrum data based off the BaseData class with additional attributes and memeber functions Only supports Gaussian shape in k-space spectrum at this moment

wc

center wavelength in unit nm

range

wavelength range from end to end

linearize(ref, base='wavenumber', method='cubic')[source]
set_profile(fwhm)[source]

set the envelope shapre of the spectrum in wavenumber domain

Parameters:fwhm (float) – the full width half maxium of the spectrum
Returns:None
set_range(wc, range)[source]
wavelengths

return the wavelengths at begein, center and end for the spectrum

Returns:the 3 wavelength at begin, center and end respectively
Return type:[w0, wc, we]
wavenumbers

return the wavelengths at begein, center and end for the spectrum

Returns:the 3 wavenumber at begin, center and end respectively
Return type:[k0, kc, ke]

Module contents