Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Nikon Ti2 Microscope Controller

Screenshot 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.

Files

  • ti2_gui.py - Main GUI application (Run this file)
  • ti2_driver.py - Hardware driver logic and controller class
  • ti2_definitions.py - SDK constants and data structures
  • test_driver.py - Test script to verify driver loading functionality
  • NIKONTI2_E.txt - SDK documentation notes

Setup & SDK Requirements

Note: This repository does not include the Nikon Ti2 SDK files due to licensing restrictions. You must obtain them from Nikon.

  1. Obtain the SDK: Download the Ti2 SDK from the official Nikon website or contact your Nikon representative.
  2. Install the SDK: Place the SDK files in a folder named Ti2-SDK in 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
    

Key Features

  • 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

Requirements

  • 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)

Quick Start

Running the Main GUI

  1. Ensure you have uv installed.
  2. Run the application:
    uv run ti2_gui.py

Building an Executable

To create a standalone .exe file that doesn't require Python to be installed:

  1. Run the build command (uv will automatically install dev dependencies):
    uv run pyinstaller NikonTi2Control.spec
  2. The executable will be created in the dist/ folder.

Testing the Setup

uv run test_driver.py

Usage

The application automatically:

  1. Loads with the default SDK path
  2. Allows browsing for different DLL locations
  3. Connects to hardware if available, or uses simulation mode
  4. Provides full functionality in both modes

GUI Features

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

Movement Controls

  • X/Y Axes: ±1, ±10, ±100 μm steps
  • Z Axis: ±0.1, ±1, ±10 μm steps
  • Real-time Updates: Position updates after each movement

Simulation Mode

When hardware is not available:

  • All functions work identically
  • Position tracking in software
  • Perfect for development and testing
  • No hardware dependencies

Troubleshooting

Driver Loading

  • DLL Not Found: Automatically enables simulation mode
  • Architecture Mismatch: Check Python 32/64-bit vs DLL architecture
  • Permission Issues: Run as administrator if needed

Connection Issues

  • Hardware not detected → simulation mode activated
  • Check USB connections and microscope power
  • Verify SDK installation

All errors are logged with timestamps for easy debugging.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages