Skip to content

Commit 8d4eaaf

Browse files
committed
Merge branch 'main' of https://github.com/sstucker/OCTview into main
2 parents 51579a8 + fb1c001 commit 8d4eaaf

File tree

3 files changed

+77
-13
lines changed

3 files changed

+77
-13
lines changed

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
## Recommended development environment
2+
- [Qt 5.9.2](https://download.qt.io/archive/qt/5.9/5.9.2/)
3+
- [Visual Studio 2017 Community Edition](https://visualstudio.microsoft.com/vs/older-downloads/), C++ Build Tools
4+
- The following libraries must be available to build the fastnisdoct library:
5+
- National Instruments [IMAQ](https://www.ni.com/en-us/support/downloads/drivers/download.vision-acquisition-software.html#409847) and [NI-DAQmx](https://www.ni.com/en-us/support/downloads/drivers/download.ni-daqmx.html#445931)
6+
- [FFTW](http://www.fftw.org/install/windows.html)
7+
- [Python 3.6.8](https://www.python.org/downloads/release/python-368/) (install `requirements.txt`)
8+
9+
## Design
10+
OCTview is generally organized into two parts: a backend dynamically-linked library written in C/C++ which interacts with hardware and performs parallelized image streaming and processing, and a Python-based application for scan-pattern generation and frontend interaction and display with Qt.
11+
12+
### Front-end
13+
The `MainWindow` class (widgets.py) exposes the various `Widget`s states and outputs to the `ApplicationContext` (OCTview.py), whose signals and slots dictate the main business of the application. The `ApplicationContext` interacts with the backend via calls to the controller (controller.py) which is a Python wrapper around the fastnisdoct DLL.
14+
15+
### Back-end
16+
Functions in the `extern "C"` block at the end of fastnisdoct.cpp are exposed to the Python environment.
17+
These functions send messages into the main thread. The main thread is responsible for preparing the application for scanning or acquisition and updating it with the contents of the latest messages. This largely takes place in the `recv_msg` function which is called at the beginning of each main thread loop.
18+
19+
An `AlineProcesingPool` manages asynchronous processing of spectral A-lines into spatial A-lines.
20+
A `FileStreamWorker` manages asynchronous streaming of image frames to disk.
21+
22+
`CircAcqBuffer` instances are ring buffers which connect the asynchronous workers. Frames are copied into the head of a ring buffer by the producer (the main thread) and can then be "locked out" by a consumer. (the file stream worker)
23+
124
## Building OCTview with fbs
225

326
OCTview is a Windows desktop application built with Qt 5.
@@ -10,3 +33,5 @@ python -m fbs installer
1033
The resulting installer will be in the `targets` directory.
1134

1235
This repository has an action that releases a new executable automatically when new version tags are pushed to the main branch.
36+
37+
This would not be possible without the awesome https://build-system.fman.io/!

MANUAL.md

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Available via GPL.
66

77
Authored by sstucker in 2022
88

9-
Made possible by David Boas, Ph.D., Jianbo Tang, Ph.D, and the Neurophotonics Center at Boston University as well as NIH NeuroNex [Program #]
9+
Made possible by David Boas, Ph.D., Jianbo Tang, Ph.D, and the Neurophotonics Center at Boston University.
1010

11-
Dependent on the wonderful Qt and FFTW. Utilizes the IMAQ and DAQmx interfaces; this software is the property of NI (Austin, TX).
11+
Utilizes the IMAQ and DAQmx interfaces; this software is the property of NI (Austin, TX).
1212

1313
# Introduction
1414

@@ -40,36 +40,72 @@ In theory, the application's frontend can be attached to any hardware interface
4040

4141
# Installation & Setup
4242

43-
[TODO. Probably the fbs executable]
43+
[Download](https://github.com/sstucker/OCTview/releases/latest) and run the latest OCTviewSetup.exe. Note that you may have to click <ins>More info</ins> to run the installer.
44+
45+
First time users should head to the File -> Global Settings menu to enter the NI-IMAQ and NI-DAQmx camera and channel names. The application will attempt to reload the hardware interface each time the Global Settings menu is closed with 'OK'.
46+
47+
If you are having issues with any part of the application, run it from a command line utility to ensure you can view stdout. As of 7/2022 there is no logging in OCTview.
4448

4549
# Using OCTview
4650

4751
## Control
4852

4953
There are 3 buttons on the top right of the window which control the state of the imaging system:
54+
![image](https://user-images.githubusercontent.com/22327925/180009286-d79c3bc3-47cb-4a9a-857a-dadce9fa6d08.png)
55+
56+
These buttons will be greyed out if the controller is not ready for the operation. This may occur if the backend is working on allocating new imaging buffers, planning processing, or uploading a large scan pattern.
5057

5158
- **Scan**: begin processing and displaying the images using the scan pattern and processing options specified. Does not stream any data to disk.
5259
- **Acquire**: begin streaming images to disk as specified by the File settings.
5360
- **Stop**: stop scanning/acquiring. Will interrupt acquisition if *n-frame acquisition* is underway.
5461

62+
**Aquire** can be clicked at any time. Note that there is no "pre-scanning" prior to image acquisition, so any distortions induced by the scanners as they jump to the new pattern will be present in the acquired data.
63+
64+
Acquisitions can be infinite or numbered.
65+
66+
**Stop** will abort the acquisition at any time. The true number of frames acquired for an aborted acquisition is NOT recorded and must be determined from the frame dimensions.
67+
5568
## Scan pattern
5669

57-
Scan pattern
70+
![image](https://user-images.githubusercontent.com/22327925/180011489-7c780739-cdec-4e90-ae2c-4d7fcbabc299.png)
71+
Scan patterns are generated from a number of parameters. These parameters are available to all scan patterns.
72+
- **Z-top**: The number of voxels to crop from the top of the spatial A-line.
73+
- **Z-bottom**: The number of voxels to crop from the bottom of the spatial A-line.
74+
- **X/Y offset**: A lateral shift applied to the entire scan.
75+
- **Rotation**: The rotation to apply to the scan. Note that rotated scans are demanding of both galvos and distort notions of fast-axis vs. slow-axis for raster patterns.
76+
77+
Currently, only raster scan patterns can be designed from the following parameters:
78+
- **A-scan count**: Number of points to scan in the fast direction.
79+
- **X-axis ROI width**: The width of the rectangular scan in physical units. See Global Settings to adjust the calibration factor for your scanner.
80+
- **A-scan repeat**: The number of A-lines exposed at each point.
81+
- **B-scan count**: The number of points to scan in the slow direction.
82+
- **Y-axis ROI height**: The height of the rectangular scan in physical units.
83+
- **Fast-axis/Slow-axis profile**: The profile the scanners take to interpolate the points of the scan. A stepped slow-axis is standard for slower scans.
84+
- **Flyback duty**: The percentage of the imaging time to use for flyback. i.e. 0% uses zero samples for flyback and 100% uses equal samples for the scan and for flyback (the galvo signal will be triangular).
85+
- **Exposure fraction**: The amount of the scan to use for imaging. This can be increased to mitigate galvo turning artifacts at the edges of the image. Note that for small scans which use relatively few samples this percentage is only an approximation.
5886

5987
## Processing settings
88+
![image](https://user-images.githubusercontent.com/22327925/180014534-1f78b6cc-f7d2-4c9a-8f85-7b00b6e9c811.png)
89+
90+
Processed OCT data is always displayed. Several processing options exist:
91+
- **Mean spectrum subtraction**: If checked, the average of the previous frame is subtracted from each A-line in the subsequent frame.
92+
- **Lambda-k interpolation**: If checked, 1st order interpolation is performed in order to linearize the spectrum in wavenumber. Calibration of the delta-_k_ parameter can be performed easily by adjusting this value while inspecting the axial PSF of a single reflector at the focus.
93+
- **Apodization**: If checked, the selected window function is multiplied by each spectrum prior to FFT.
6094

61-
Processing
95+
FFT is always performed on spectra before their display.
6296

6397
## File settings
6498

65-
File settings
99+
![image](https://user-images.githubusercontent.com/22327925/180015319-cf30181b-e798-4db0-8698-ab9ac87c868b.png)
66100

67-
## GUI Configuration
101+
OCTview allows for raw or processed data to be saved to disk in binary format. Data is saved in the order in which it was acquired: it can be considered a FORTRAN-ordered array with the dimensions [z, x, y, t]. Raw data is saved as UINT16 while processed data is saved as COMPLEX64.
68102

69-
The state of the GUI can be saved and loaded via File -> Save/Load Configuration.
103+
Several parameters control the data acquisition:
104+
- **Experiment directory**: The folder in which to save files.
105+
- **Trial name**: The name of the current imaging trial. Depending on the volume of data acquired and the selected Maximum file size, multiple files with the suffix '\_0001', '\_0002' etc may be created.
106+
- **Maximum file size**: The maximum number of bytes that will be written to a single file before creating a new one.
107+
- **Save metadata .JSON**: If checked, a JSON file containing information about the acquisition will be acquired alongside the binary data.
70108

109+
## GUI Configuration
110+
The state of the GUI can be saved and loaded via File -> Save/Load Configuration.
71111
When OCTview is closed, the state of the GUI is written to `.last.oct` in the `<installation>/resources/windows/configuration` directory. This file is loaded automatically when OCTview is launched.
72-
73-
## Global settings
74-
75-
High-level application configuration is available via File -> Settings.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22

33
# ![Logo](https://github.com/sstucker/OCTview/blob/main/src/main/icons/base/64.png?raw=true) [![latest release](https://img.shields.io/github/v/release/sstucker/OCTview?color=pink&display_name=release&label=version)](https://github.com/sstucker/OCTview/releases/latest) [![fbs build](https://github.com/sstucker/OCTview/actions/workflows/fbs-build.yml/badge.svg)](https://github.com/sstucker/OCTview/actions/workflows/fbs-build.yml)
44

5-
Open source desktop application for control of SD-OCT imaging systems
5+
OCT view is an open source desktop application for control of SD-OCT imaging systems.
6+
7+
### [Manual](https://github.com/sstucker/OCTview/blob/main/MANUAL.md)
8+
### [Contribute](https://github.com/sstucker/OCTview/blob/main/CONTRIBUTING.md)

0 commit comments

Comments
 (0)