Note: Add a screenshot of your application here
This directory contains a clean, modern GUI application for controlling the X/Y/Z axes of a Nikon Ti2 microscope using the Nikon Ti2 SDK.
ti2_gui.py- Main GUI application (Run this file)ti2_driver.py- Hardware driver logic and controller classti2_definitions.py- SDK constants and data structurestest_driver.py- Test script to verify driver loading functionalityNIKONTI2_E.txt- SDK documentation notes
Note: This repository does not include the Nikon Ti2 SDK files due to licensing restrictions. You must obtain them from Nikon.
- Obtain the SDK: Download the Ti2 SDK from the official Nikon website or contact your Nikon representative.
- Install the SDK: Place the SDK files in a folder named
Ti2-SDKin the root of this project. The structure should look like this:NikonControl/ ├── ti2_gui.py ├── ... └── Ti2-SDK/ ├── bin/ │ └── Ti2_Mic_Driver.dll └── include/ └── new_mic_sdk2.h
- Simulation Mode: Works without hardware for development and testing
- Modern GUI: Clean, tabbed interface with improved usability
- Proper SDK Integration: Uses actual Ti2 SDK functions and data structures
- Hardware Fallback: Automatically falls back to simulation if hardware unavailable
- Real-time Logging: Timestamped operation logs
- Position Tracking: Precise position display and control
- Python 3.7+
- tkinter (usually included with Python)
- ctypes (standard library)
- Windows OS (required for DLL loading)
- Nikon Ti2 microscope with SDK (optional - simulation mode available)
- Ensure you have uv installed.
- Run the application:
uv run ti2_gui.py
To create a standalone .exe file that doesn't require Python to be installed:
- Run the build command (uv will automatically install dev dependencies):
uv run pyinstaller NikonTi2Control.spec
- The executable will be created in the
dist/folder.
uv run test_driver.pyThe application automatically:
- Loads with the default SDK path
- Allows browsing for different DLL locations
- Connects to hardware if available, or uses simulation mode
- Provides full functionality in both modes
Connection Tab:
- Driver DLL path selection
- Connection status display
- Real-time operation log
Stage Control Tab:
- Current position display (X, Y, Z)
- Movement buttons for precise control
- Position refresh functionality
- X/Y Axes: ±1, ±10, ±100 μm steps
- Z Axis: ±0.1, ±1, ±10 μm steps
- Real-time Updates: Position updates after each movement
When hardware is not available:
- All functions work identically
- Position tracking in software
- Perfect for development and testing
- No hardware dependencies
- DLL Not Found: Automatically enables simulation mode
- Architecture Mismatch: Check Python 32/64-bit vs DLL architecture
- Permission Issues: Run as administrator if needed
- Hardware not detected → simulation mode activated
- Check USB connections and microscope power
- Verify SDK installation
All errors are logged with timestamps for easy debugging.
This project is licensed under the MIT License - see the LICENSE file for details.