Skip to content

Commit 65e1a4e

Browse files
update docs
1 parent 635dcd5 commit 65e1a4e

File tree

7 files changed

+20
-10
lines changed

7 files changed

+20
-10
lines changed

benchmark/benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060

6161
""" Gaussian Filter """
6262

63-
pyb = PyBundle(coreMethod = PyBundle.FILTER, calibImage = calibImg,
63+
pyb = PyBundle(coreMethod = PyBundle.FILTER, calibImage = calibImg, crop = True,
6464
filterSize = 2)
6565
pyb.calibrate()
6666

docs/source/index.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
PyFibreBundle
22
====================================
33
PyFibreBundle is a Python package for processing of images captured through optical fibre bundles.
4-
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.
54

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

87
pip install PyFibreBundle
98

10-
The package was originally developed for applications in endoscopic microscopy, including fluorescence endomicroscopy and
11-
holographic endomicroscopy, but there are also potential applications in endoscopy.
12-
139
The package supports fibre core pattern removal by filtering and triangular linear interpolation, background correction and
1410
flat fielding, as well as automatic bundle location, cropping and masking. Both monochrome and colour images can be processed.
1511
The :doc:`PyBundle<pybundle_class>` class is the preferred way to access this functionality,
@@ -22,6 +18,8 @@ frame rates of over 100 fps can be achieved on mid-level hardware, including cor
2218
The Numba just-in-time compiler is used to accelerate key portions of code (particularly triangular linear interpolation) and
2319
OpenCV is used for fast mosaicing. If the Numba package is not installed then PyFibreBundle falls back on Python interpreted code.
2420

21+
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.
22+
2523
^^^^^^^^
2624
Contents
2725
^^^^^^^^

docs/source/pybundle_class.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ for a detailed description of each option's meaning.
5656
* coreSize = 3 (``set_core_size``)
5757
* gridSize = 512 (``set_grid_size``)
5858
* useNumba = True (``set_use_numba``)
59+
* whiteBalance = False (``set_white_balance``)
5960

6061
**SUPER RESOLUTION Settings:**
6162

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

7375
^^^^^^^^^^^^^^^
7476
Methods

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "PyFibreBundle"
9-
version = "1.3.3"
9+
version = "1.3.4"
1010
description = "Image processing of images acquired through fibre imaging bundle, including core removal, mosaicing and super-resolution.."
1111
readme = "README.md"
1212
authors = [{ name = "Michael Hughes", email = "m.r.hughes@kent.ac.uk" }]

src/pybundle/pybundle.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,15 @@ def set_edge_filter_shape(self, edgePos, edgeSlope):
588588

589589
self.edgeFilterShape = (edgePos, edgeSlope)
590590

591+
def set_white_balance(self, whiteBalance):
592+
""" Sets whether each colour channel should be normalised independently
593+
when using linear interpolation method.
594+
595+
Arguments:
596+
whiteBalance : boolean, each channel normalised independently if True (default is False).
597+
"""
598+
599+
self.whiteBalance = whiteBalance
591600

592601
def set_use_numba(self, useNumba):
593602
""" Sets whether Numba should be used for JIT compiler acceleration for

src/pybundle/super_res.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,11 @@ def calib_multi_tri_interp(calibImg, imgs, coreSize, gridSize, **kwargs):
147147
imgsProc = np.zeros((gridSize, gridSize, nImages))
148148

149149
if shifts is None:
150-
150+
t1 = time.perf_counter()
151151
for idx in range(nImages):
152152

153153
imgsProc[:, :, idx] = pybundle.recon_tri_interp(
154154
imgs[:, :, idx], singleCalib)
155-
156155
shifts = SuperRes.get_shifts(imgsProc, **kwargs)
157156

158157
# Since we have done the shift estimation on a different sized grid
@@ -170,9 +169,10 @@ def calib_multi_tri_interp(calibImg, imgs, coreSize, gridSize, **kwargs):
170169
coreYList = np.append(
171170
coreYList, singleCalib.coreY + shifts[idx + 1][1])
172171
#breakpoint()
173-
172+
#t1 = time.perf_counter()
174173
calib = pybundle.init_tri_interp(calibImg, coreXList, coreYList, centreX, centreY,
175174
radius, gridSize, filterSize=filterSize, background=None, normalise=None)
175+
#print(time.perf_counter() - t1)
176176

177177
# We store the number of cores in a single image
178178
calib.nCores = np.shape(singleCalib.coreX)[0]

test/test_super_res_oop.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@
7878
[ -4.60631216, -16.69788157],
7979
[ -9.78841333, -30.51681804],
8080
[-17.27367059, -27.06208392] ])
81-
81+
82+
8283
pyb = PyBundle(coreMethod = PyBundle.TRILIN, superRes = True, gridSize = gridSize, autoContrast = False,
8384
calibImage = calibImg, normaliseImage = calibImg)
8485

0 commit comments

Comments
 (0)