Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeHughesKent committed Aug 10, 2023
1 parent 635dcd5 commit 65e1a4e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

""" Gaussian Filter """

pyb = PyBundle(coreMethod = PyBundle.FILTER, calibImage = calibImg,
pyb = PyBundle(coreMethod = PyBundle.FILTER, calibImage = calibImg, crop = True,
filterSize = 2)
pyb.calibrate()

Expand Down
6 changes: 2 additions & 4 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
PyFibreBundle
====================================
PyFibreBundle is a Python package for processing of images captured through optical fibre bundles.
It is developed mainly by `Mike Hughes <https://research.kent.ac.uk/applied-optics/hughes/>`_'s lab in the `Applied Optics Group <https://research.kent.ac.uk/applied-optics>`_, School of Physics and Astronomy, University of Kent. Bug reports, contributions and pull requests are welcome.

The project is hosted on `github <https://github.com/MikeHughesKent/PyFibreBundle/>`_. The latest stable release can be installed via pip::

pip install PyFibreBundle

The package was originally developed for applications in endoscopic microscopy, including fluorescence endomicroscopy and
holographic endomicroscopy, but there are also potential applications in endoscopy.

The package supports fibre core pattern removal by filtering and triangular linear interpolation, background correction and
flat fielding, as well as automatic bundle location, cropping and masking. Both monochrome and colour images can be processed.
The :doc:`PyBundle<pybundle_class>` class is the preferred way to access this functionality,
Expand All @@ -22,6 +18,8 @@ frame rates of over 100 fps can be achieved on mid-level hardware, including cor
The Numba just-in-time compiler is used to accelerate key portions of code (particularly triangular linear interpolation) and
OpenCV is used for fast mosaicing. If the Numba package is not installed then PyFibreBundle falls back on Python interpreted code.

PyFibreBundle is developed mainly by `Mike Hughes <https://research.kent.ac.uk/applied-optics/hughes/>`_'s lab in the `Applied Optics Group <https://research.kent.ac.uk/applied-optics>`_, School of Physics and Astronomy, University of Kent. Bug reports, contributions and pull requests are welcome.

^^^^^^^^
Contents
^^^^^^^^
Expand Down
2 changes: 2 additions & 0 deletions docs/source/pybundle_class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ for a detailed description of each option's meaning.
* coreSize = 3 (``set_core_size``)
* gridSize = 512 (``set_grid_size``)
* useNumba = True (``set_use_numba``)
* whiteBalance = False (``set_white_balance``)

**SUPER RESOLUTION Settings:**

Expand All @@ -69,6 +70,7 @@ for a detailed description of each option's meaning.
* srDarkFrame = None (``set_sr_dark_frame``)
* srUseLut = False (``set_sr_use_lut``)
* srParamValue = None (``set_sr_param_value``)


^^^^^^^^^^^^^^^
Methods
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "PyFibreBundle"
version = "1.3.3"
version = "1.3.4"
description = "Image processing of images acquired through fibre imaging bundle, including core removal, mosaicing and super-resolution.."
readme = "README.md"
authors = [{ name = "Michael Hughes", email = "m.r.hughes@kent.ac.uk" }]
Expand Down
9 changes: 9 additions & 0 deletions src/pybundle/pybundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,15 @@ def set_edge_filter_shape(self, edgePos, edgeSlope):

self.edgeFilterShape = (edgePos, edgeSlope)

def set_white_balance(self, whiteBalance):
""" Sets whether each colour channel should be normalised independently
when using linear interpolation method.
Arguments:
whiteBalance : boolean, each channel normalised independently if True (default is False).
"""

self.whiteBalance = whiteBalance

def set_use_numba(self, useNumba):
""" Sets whether Numba should be used for JIT compiler acceleration for
Expand Down
6 changes: 3 additions & 3 deletions src/pybundle/super_res.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,11 @@ def calib_multi_tri_interp(calibImg, imgs, coreSize, gridSize, **kwargs):
imgsProc = np.zeros((gridSize, gridSize, nImages))

if shifts is None:

t1 = time.perf_counter()
for idx in range(nImages):

imgsProc[:, :, idx] = pybundle.recon_tri_interp(
imgs[:, :, idx], singleCalib)

shifts = SuperRes.get_shifts(imgsProc, **kwargs)

# Since we have done the shift estimation on a different sized grid
Expand All @@ -170,9 +169,10 @@ def calib_multi_tri_interp(calibImg, imgs, coreSize, gridSize, **kwargs):
coreYList = np.append(
coreYList, singleCalib.coreY + shifts[idx + 1][1])
#breakpoint()

#t1 = time.perf_counter()
calib = pybundle.init_tri_interp(calibImg, coreXList, coreYList, centreX, centreY,
radius, gridSize, filterSize=filterSize, background=None, normalise=None)
#print(time.perf_counter() - t1)

# We store the number of cores in a single image
calib.nCores = np.shape(singleCalib.coreX)[0]
Expand Down
3 changes: 2 additions & 1 deletion test/test_super_res_oop.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
[ -4.60631216, -16.69788157],
[ -9.78841333, -30.51681804],
[-17.27367059, -27.06208392] ])



pyb = PyBundle(coreMethod = PyBundle.TRILIN, superRes = True, gridSize = gridSize, autoContrast = False,
calibImage = calibImg, normaliseImage = calibImg)

Expand Down

0 comments on commit 65e1a4e

Please sign in to comment.