Giter Club home page Giter Club logo

micro-manager-python3's Introduction

micro-manager-py36

Files for running Micro-manager 2.0 with python 3.X support on Windows

Compiling

  1. Download Anaconda (or your preffered python distro)

  2. Check out micro-manager source from https://github.com/micro-manager.

  3. Download Visual Studio Community 2017

  4. Open Micro-manager.sln in Visual Studio Community 2017

  5. Right-click MMCorePy_wrap in the Solution Explorer and click "Properties". Select "VC++ Directories" in the right pane and append this line to the Include Directories box:

;C:\Users\zack\Anaconda3\include;C:\Users\zack\Anaconda3\lib\site-packages\numpy\core\include

Then, append this line to the "Library Directories" box:

C:\Users\zack\Anaconda3\libs;
  1. If you get an error related to "inttypes.h", open "pyport.h" and replace "inttypes.h" with "stdint.h". This means modifying a python header file to accomidate VS2017. I don't really like this solution, but it does seem to work, and does not mess up your python install.

  2. Close the property browser, right-click MMCorePy_wrap, and click build.

  3. Open the output directory and copy the files [TODO] to a recent Micro-manager nightly install, such as:

C:\Program Files\Micro-Manager-2.0beta

Installation

  1. Install Micro-manager 2.0 (a recent nightly should work)

  2. Download or clone the files inside the MMCorePy directory into your micro-manager directory (Usually C:\Program Files\Micro-Manager2.0beta\ or similar)

  3. Ensure you are running Python 3.6 (Using other verisons will NOT work as I have built this against python 3.6)

  4. Run pip install numpy and optionally pip install jupyter if you will be using the notebook interface

  5. In jupyter (or your own .py file), run the following:

# Append MM directory to path
import sys
sys.path.append('C:\\Users\\Zack\\Desktop\\Micro-Manager-2.0beta')
system_cfg_file = '\\path\\to\\your\\MM\\cfg\\file.cfg'

# For most devices it is unnecessary to change to the MM direcotry prior to importing, but in some cases (such as the pco.de driver), it is required.

prev_dir = os.getcwd()
os.chdir(mm_directory) # MUST change to micro-manager directory for method to work
import MMCorePy

# Get micro-manager controller object
mmc = MMCorePy.CMMCore()

# Load system configuration (loads all devices)
mmc.loadSystemConfiguration(system_cfg_file)
os.chdir(prev_dir)

# Success!
print("Micro-manager was loaded sucessfully!")

micro-manager-python3's People

Watchers

James Cloos avatar Peter Quicke avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.