Skip to content

Commit 41546a6

Browse files
Merge branch 'develop' into pr/1087
2 parents 88a99fc + 97abe5a commit 41546a6

File tree

270 files changed

+4046
-9178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+4046
-9178
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,5 @@ test.n5
296296
test_dir
297297
test.xml
298298
*_log.txt
299+
/docs/source/05_reference/_autosummary
300+
/docs/source/05_reference/_autosummary
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.. _Quick_Start_Guide:
2+
3+
=================================
4+
Quick Start Guide
5+
=================================
6+
7+
This quick start guide covers how to install **navigate**, launch it in synthetic hardware mode to confirm it is working, and save an image to disk.
8+
9+
Installation
10+
------------
11+
12+
1. *Install Miniconda.* Download and install Miniconda from the `official website <https://docs.conda.io/en/latest/miniconda.html>`_.
13+
14+
2. *Create and Activate a Conda Environment.* Launch a Miniconda Prompt (or a Terminal on MacOS) and enter the following.
15+
16+
.. code-block:: console
17+
18+
(base) conda create -n navigate python=3.9.7
19+
(base) conda activate navigate
20+
21+
3. *Install* **navigate**.
22+
23+
.. code-block:: console
24+
25+
(navigate) pip install navigate-micro
26+
27+
4. *Launch* **navigate** *in synthetic hardware mode.* This will allow you to test its functionality without actual hardware.
28+
29+
.. code-block:: console
30+
31+
(navigate) navigate -sh
32+
33+
Saving a Z-Stack to Disk
34+
------------------------
35+
36+
To save an image to disk, follow these steps:
37+
38+
* Launch **navigate** in synthetic hardware mode as described above.
39+
* Next to the :guilabel:`Acquire` button on the upper left, make sure that the acquisition mode in the dropdown is set to "Continuous Scan".
40+
* Press :guilabel:`Acquire` (:kbd:`ctrl + enter`) and confirm that a synthetic noise image is displayed in the :guilabel:`Camera View` window.
41+
42+
.. Note::
43+
At least one channel must be selected (checkbox marked) in the :guilabel:`Channel Settings` window, and all of the parameters (e.g., :guilabel:`Power`) in that row must be populated.
44+
45+
* Select the :guilabel:`Channels` tab. In the :guilabel:`Stack Acquisition Settings` window in this tab, press the :guilabel:`Set Start Pos/Foc` button. This specifies the starting ``Z`` and ``F`` (e.g., Focus) positions for the stack acquisition.
46+
* Select the :guilabel:`Stage Control` tab (:kbd:`ctrl + 3`), move the ``Z`` stage to the desired position (e.g., ``100`` μm), go back to the :guilabel:`Channels` tab (:kbd:`ctrl + 1`), and press the :guilabel:`Set End Pos/Foc` button. This specifies the ending ``Z`` and ``F`` positions for the stack acquisition.
47+
* In the :guilabel:`Stack Acquisition Settings` frame, you can now adjust the step size, which determines the number of slices in a z-stack.
48+
* In the :guilabel:`Timepoint Settings` window, select :guilabel:`Save Data` by marking the checkbox. If the number of timepoints is set to ``1``, only a single stack will be acquired.
49+
* Next to the :guilabel:`Acquire` button on the upper left, change the acquisition mode in the dropdown to "Z-Stack", and press :guilabel:`Acquire` (:kbd:`ctrl + enter`).
50+
* A :guilabel:`File Saving Dialog` popup window will appear.
51+
* With the exception of :guilabel:`Notes`, all fields must be populated. Any spaces in the fields will be replaced with an underscore.
52+
* :guilabel:`Notes` is saved with the metadata, and can be useful for describing the experiment.
53+
* :guilabel:`Solvent` is useful for tissue clearing experiments.
54+
* :guilabel:`File Type` can be set to :guilabel:`.TIFF`, :guilabel:`OME-TIFF`, :guilabel:`H5`, or :guilabel:`N5`. The latter two options are pyramidal file formats that are best used for large datasets and are immediately compatible with `BigDataViewer <https://imagej.net/plugins/bdv/>`_ and `BigStitcher <https://imagej.net/plugins/bigstitcher/index>`_.
55+
* Press :guilabel:`Acquire` to begin the acquisition.
56+
* Once complete, the data can be opened using standard image processing software such as `Fiji <https://imagej.net/software/fiji/>`_.
57+
58+
.. image:: images/save_dialog.png
59+
:align: center
60+
:alt: File Saving Dialog
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
=====================
2+
Software Installation
3+
=====================
4+
5+
.. _software_installation:
6+
7+
Computer Specifications
8+
=======================
9+
10+
Below are the recommended specifications for **navigate**.
11+
12+
Operating System Compatibility
13+
------------------------------
14+
15+
.. important::
16+
**navigate** is developed for use on Windows-based systems. This is due to the compatibility of device drivers for various microscope hardware components, such as cameras, stages, and data acquisition cards, which are predominantly designed for the Windows environment. The software is only partially tested on MacOS and Linux systems. Users considering the use of **navigate** software on Linux should proceed with caution and be prepared for potential compatibility issues. For optimal performance and compatibility, it is strongly recommended to run **navigate** on a Windows machine.
17+
18+
.. _computer_considerations:
19+
20+
Computer Considerations
21+
-----------------------
22+
23+
**navigate** will run on a mid-range laptop with at least 8 GB of RAM and a processor with two cores. Most of its operations are undemanding. Saving data at a reasonable rate, however, will require an SSD. The hardware configuration for an example microscope control machine is shown below.
24+
25+
.. important::
26+
Scientific cameras are capable of rapidly generating large amounts of high-resolution data. As such, the read/write speed of the data storage device is critical for smooth operation of the software. For example, for a standard Hamamatsu camera with a 2048 x 2048 sensor, operating at 16-bit depth and 20 frames per second, the data save rate is approximately ~167 MB/s. While such capabilities are well within the capabilities of modern SSDs, they are beyond the capabilities of most HDDs. Therefore, it is recommended to use a fast SSD for data saving operations.
27+
28+
.. collapse:: Example Computer Configuration
29+
30+
- *Base Platform*
31+
- **Product Name**: `Colfax SX6300 Workstation <https://www.colfax-intl.com/workstations/sx6300>`_
32+
- **Colfax Part #**: CX-116263
33+
34+
- *Primary and Secondary CPU*
35+
- **CPU Model**: Intel Xeon Silver 4215R
36+
- **Configuration**: 8 Cores / 16 Threads
37+
- **Frequency**: 3.2 GHz
38+
- **Cache**: 11 MB
39+
- **TDP**: 130W
40+
- **Memory Support**: 2400 MHz
41+
42+
- *Memory*
43+
- **Type**: Registered ECC DDR4
44+
- **Speed**: 3200 MHz
45+
- **Configuration**: 16 GB per socket, 8 sockets per CPU
46+
- **Total RAM**: >64 GB (recommended)
47+
48+
- *Operating System Drive*:
49+
- **Type**: M.2 NVMe SSD
50+
- **Model**: Micron 7450 Max
51+
- **Capacity**: 800 GB
52+
- **Endurance**: 3 DWPD
53+
54+
- *Primary Data Drive*:
55+
- **Type**: NVMe SSD
56+
- **Model**: Samsung PM9A3
57+
- **Capacity**: 7.68 TB
58+
- **Interface**: U.2 Gen4
59+
60+
- *Secondary Data Drive*:
61+
- **Type**: SATA HDD
62+
- **Model**: Seagate Exos X20
63+
- **Capacity**: 20 TB
64+
- **Speed**: 7200 RPM
65+
- **Cache**: 256 MB
66+
- **Interface**: SATA 6.0 Gb/s
67+
68+
- *Video Card*
69+
- **Model**: PNY nVidia T1000
70+
- **Memory**: 4 GB
71+
- **Interface**: PCI Express
72+
73+
- *Network Interface*
74+
- **Model**: Intel X710-T2L RJ45 Copper
75+
- **Type**: Dual Port 10GbE
76+
- **Interface**: PCI-E x 8
77+
78+
.. note::
79+
The specifications listed are based on an example system configuration and can be adjusted based on specific needs and availability.
80+
81+
---------------------
82+
83+
Quick install
84+
=============
85+
86+
**Setup your Python Environment**
87+
88+
Head over to the `miniconda website <https://docs.conda.io/en/latest/miniconda.html>`_ and install the appropriate version based on your operating system.
89+
90+
.. tip::
91+
It is also handy to have the `conda cheatsheet <https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf>`_ open when first using miniconda to get accustomed to the commands available.
92+
93+
* Windows: Use the Windows taskbar search to find ``Anaconda Prompt (Miniconda3)``. Given how frequently you will use this, we recommend pinning it to your taskbar. * Linux/Mac: Open a Terminal.
94+
95+
**Create a Python environment called navigate that uses Python version 3.9.7**
96+
97+
.. code-block:: console
98+
99+
(base) MyComputer ~ $ conda create -n navigate python=3.9.7
100+
101+
**Activate the navigate environment**
102+
103+
.. code-block:: console
104+
105+
(base) MyComputer ~ $ conda activate navigate
106+
107+
The active environment is shown in parentheses on the far-left. Originally, we were in the miniconda ``(base)`` environment. After activating the navigate environment, it should now show ``(navigate)``.
108+
109+
**Install navigate via pip**
110+
111+
To install the latest stable release of **navigate**, run the following command:
112+
113+
.. code-block:: console
114+
115+
(navigate) MyComputer ~ $ pip install navigate-micro
116+
117+
To install the bleeding edge version of **navigate**, run the following command:
118+
119+
.. code-block:: console
120+
121+
(navigate) MyComputer ~ $ pip install git+https://github.com/TheDeanLab/navigate.git
122+
123+
**Run navigate software**
124+
125+
.. code-block:: console
126+
127+
(navigate) MyComputer ~ $ navigate
128+
129+
.. note::
130+
If you are running the software on a computer that is not connected to microscope hardware, you can add the flag ``-sh`` (``--synthetic-hardware``) to launch the program:
131+
132+
.. code-block:: console
133+
134+
navigate -sh
135+
136+
Launching **navigate**
137+
======================
138+
139+
Open an ``Anaconda Prompt (Miniconda3)`` and enter the following.
140+
141+
.. code-block:: console
142+
143+
(base) conda activate navigate
144+
(navigate) navigate
145+
146+
.. tip::
147+
If you are running Windows, you can create a desktop shortcut to **navigate** by right-clicking the Desktop, navigating to New and then Shortcut and entering ``%windir%\system32\cmd.exe "/c" C:\path\to\miniconda\Scripts\activate.bat navigate && navigate`` into the location text box.
148+
149+
This provides a convenient executable shortcut to launch the software, which is advantageous for users who are not comfortable with the command line.

docs/source/i_want_to.rst renamed to docs/source/01_getting_started/03_i_want_to/03_i_want_to.rst

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,13 @@
22
I Want To...
33
============
44

5-
This section contains how-to documents organized into three levels of difficulty:
6-
beginner, intermediate, and advanced.
5+
This section contains how-to documents organized into three levels of difficulty: beginner, intermediate, and advanced.
76

8-
- The beginner how-to is intended for users who have little to no experience with
9-
computer programming and simply wish to acquire an image.
7+
- The beginner how-to is intended for users who have little to no experience with computer programming and simply wish to acquire an image.
8+
- The intermediate how-to is intended for users who want to learn how to use the graphical user interface to create their own smart acquisition workflows.
9+
- The advanced how-to is intended for users who have experience with computer programming and wish to extend the functionality of **navigate** by adding new devices or writing their own acquisition features.
1010

11-
- The intermediate how-to is intended for users who want to learn how to use the
12-
graphical user interface to create their own smart acquisition workflows.
13-
14-
- The advanced how-to is intended for users who have experience with computer
15-
programming and wish to extend the functionality of **navigate** by adding new
16-
devices or writing their own acquisition features.
17-
18-
Through this tiered approach, we hope to provide a gentle introduction to the software
19-
while also reaching the maximum number of users.
11+
Through this tiered approach, we hope to provide a gentle introduction to the software while also reaching the maximum number of users.
2012

2113
.. toctree::
2214
:maxdepth: 1
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
======================================
2+
Add a New Hardware Device (Advanced)
3+
======================================
4+
5+
**navigate** includes several standard hardware device types. These include:
6+
7+
- Cameras
8+
- Data Acquisition Cards
9+
- Filter Wheels
10+
- Galvo Scanners
11+
- Lasers
12+
- Deformable Mirrors
13+
- Remote Focusing Systems
14+
- Shutters
15+
- Stages
16+
- Zoom Devices
17+
18+
To add a new piece of hardware to one of these device types requires knowledge about the software's device abstraction layer. Here’s a detailed guide to help you integrate a new ``CustomStage`` device into **navigate**. The same principles work for other device types.
19+
20+
.. note::
21+
A strong knowledge of Python and object-oriented programming is required to integrate new hardware devices into **navigate**.
22+
23+
----------------
24+
25+
What is the Device Abstraction Layer?
26+
-------------------------------------
27+
28+
To ensure compatibility and extendability, **navigate** utilizes a device abstraction layer, which allows the same commands to be used across different hardware devices. For example, all stages in **navigate** are programmed to include the `stop()` command, which can be used to stop the stage's movement. When someone hits the :guilabel:`Stop Stage` button on the GUI, this action is relayed from the ``Controller`` to the ``Model`` and ultimately the ``CustomStage``, which communicates with the hardware in a device-specific format to stop the stage's movement.
29+
30+
--------------
31+
32+
Device Integration Approaches
33+
-----------------------------
34+
35+
There are two primary approaches to integrating new hardware into **navigate**:
36+
37+
- **Plugin**: If you want to continue to work with an up-to-date version of **navigate**, consider integrating your new hardware device as a plugin. This allows you to pull updates from the main repository without losing your custom hardware integration. It also allows you to integrate non-standard device types. Learn more about the plugin architecture :ref:`here <plugin>`, and how to write a custom plugin :ref:`here <advanced>`.
38+
- **Fork**: Alternatively, you can fork the **navigate** repository on GitHub and modify it directly. This is useful for custom, in-house developments. In select circumstances, you can contribute your changes back to the main repository through a pull request. Please contact the **navigate** development team for guidance on this approach.
39+
40+
--------------
41+
42+
Device Class Creation
43+
---------------------
44+
- New hardware devices must have a corresponding device class in navigate. To ensure consistency and reduce redundancy, each device must inherit the appropriate abstract base class. For instance, a ``CustomStage`` device would inherit from ``StageBase``.
45+
- Classes should follow CamelCase naming conventions and reflect the device they control (e.g., ``NewportStage`` for a stage from the manufacturer Newport).
46+
- Place the new device class within the appropriate device directory, `src/navigate/model/devices/`.
47+
- Place related API or hardware documentation within the appropriate manufacturer directory, typically under `src/navigate/model/devices/APIs/`.
48+
49+
--------------
50+
51+
Establish Device Communication
52+
------------------------------
53+
54+
- Each device requires a unique method to initialize a connection, which may involve APIs, serial communication, or other protocols. This method should be separate from the device class and is typically located at the beginning of the device file.
55+
- For example, a function named `build_custom_stage_connection()` would handle the connection setup for ``CustomStage`` class.
56+
- By separating the connection setup from the device class, you can easily interact with the hardware device outside of the larger **navigate** ecosystem, which can be useful for debugging and testing (e.g., within a Jupyter notebook).
57+
58+
--------------
59+
60+
Device Class Constructor
61+
------------------------
62+
63+
- The constructor for the device class (`__init__`) should accept parameters for the `microscope_name`, `device_connection`, `configuration_file`, and an optional `device_ID` (useful when multiple instances of the same device are used).
64+
- The constructor should load and enforce device settings from the `configuration_file`. For a new stage, this could be defining the axes mapping between **navigate** and the device, `{x:'X', y:'Y', z:'Z'}`.
65+
- Ensure the device class uses the connection established by your `build_custom_stage_connection` method.
66+
67+
--------------
68+
69+
Device Class Methods
70+
--------------------
71+
72+
- Implement any necessary device-specific methods within your device class.
73+
- Essential methods are inherited from the base class (e.g., ``StageBase`` for the ``CustomStage``), but you can override them or add new methods as needed for specialized functionality.
74+
75+
--------------
76+
77+
Startup and Configuration
78+
-------------------------
79+
80+
- Utilize or modify methods within `src/navigate/model/device_startup_functions` to configure and start your device upon system initialization.
81+
- These functions should handle configuration parsing and the device communication setup.
82+
- Implement a retry mechanism, such as `auto_redial`, to handle communication issues robustly, attempting multiple times before failing.
83+
84+
--------------
85+
86+
Integration with Microscope Object Configurations
87+
-------------------------------------------------
88+
89+
- Each microscope configuration in **navigate** that uses the new device should receive a reference to the established communication object.
90+
- This setup is defined in the *configuration.yaml* and handled within the `device_startup_functions`, ensuring each configuration has access to the necessary hardware.
91+
92+
--------------
93+
94+
Testing and Validation
95+
----------------------
96+
- Thoroughly test the new hardware integration to ensure it functions correctly within navigate, across all intended use cases and configurations.
97+
- The naming convention for test files is: `test_` + module name.
98+
- Device test files are located in `test\model\devices\`
99+
- Device testing utilizes the `pytest` package.
100+
101+
By following these steps, you can effectively integrate new hardware into the **navigate** platform, enhancing its functionality and ensuring it meets specific experimental needs.

0 commit comments

Comments
 (0)