# Matlab Call Micro-Manager
## Setting Matlab and Micro-Manager
We almost follow [Micro-Manager wiki](https://micro-manager.org/wiki/Matlab_Configuration).
We tested on Matlab(2017b, 2020) and Micro-Manager 2.0-gamma(20210312), but should work
on other version.
1. Install Micro-Manager and Andor Driver(just for andor camera) in same folder
2. Add all MM jar files into Matlab classpath.txt by running:
```matlab
cd C:\Program Files\Micro-Manager-2.0gamma
StartMMStudio('-setup')
```
3. Run `edit librarypath.txt` in Matlab command prompt. Append the location of
the dll files
`C:/Program Files/Micro-Manager-2.0gamma` in opening file.
4. Add the location of the dll files to the system path. This is not required
for all device drivers but is required to access the Andor driver. For example,
append `C:\Program Files\Micro-Manager-2.0gamma` to system environment `PATH` or
`Path`
5. Restart Matlab and computer(I don't know whether it is required to refresh
System environment)
6. Test with simple code:
```matlab
>> import mmcorej.*;
>> mmc = CMMCore;
>> mmc.load('C:\user\qblab\documents\MMConfig_Ti.cfg')
```
We once troubled to load Andor driver:
```matlab
```
Typically, in this case, Micro-Manager fail to find other Andor dll files inside
current Matlab working directory. If you just change current working directory
to Micro-Manager installation directory, Andor driver could be loaded normally.
For permanent setting, you should check step 4.
IMPORTANT NOTE:
If camera set to 16 bit, `mmc.getImage()` will returen a 1D array of signed
integers in row-major order in Matlab, we must interpreted it as unsigned integers.
```matlab
>> mmc.snapImage();
>> img = mmc.getImage(); % returned as a 1D array of signed integers in row-major order
>> width = mmc.getImageWidth();
>> height = mmc.getImageHeight();
>> if mmc.getBytesPerPixel == 2
pixelType = 'uint16';
else
pixelType = 'uint8';
end
>> img = typecast(img, pixelType); % pixels must be interpreted as unsigned integers
>> img = reshape(img, [width, height]); % image should be interpreted as a 2D array
>> img = transpose(img); % make column-major order for MATLAB
>> imshow(img);
```
matlab科研助手
- 粉丝: 3w+
- 资源: 5991
最新资源
- 有机硅导热灌封加热台方案sw17可编辑全套技术资料100%好用.zip
- 锂离子电池的充电状态和健康状态估计 石墨-磷酸铁锂电池的循环寿命模型 该项目的目标是设计一个强大的观测器,可以估计锂离子电池的SOC和SOH 在该项目中,等效电路模型用于电池建模,电流和环境温度作为
- Python基于YOLOv5目标检测算法开发的FPS射击类游戏辅助瞄准系统源码+文档说明
- 三菱fx3uPLC和昆仑通泰触摸屏控制松下伺服电机使用例程3,带CAD接线图,带伺服电机使用手册
- 真空干泵驱动用磁阻式同步电动机设计与特性分析 先设计一款真空干泵驱动电机,使其符合真空干泵的驱动要求,各项性能参数(如电机效率、最大转矩倍数、空载气隙磁密等)设计达标 接着在设计好的驱动电机基础上
- MATLAB Simulink仿真,蓄电池SOC均衡(锂电池) 根据微网内功率盈余,两组SOC不同的蓄电池采用分段下垂控制,随着出力的不同SOC趋于一致;同时对直流母线电压进行补偿、功率保持稳定无波动
- 泳池水循环过滤系统sw18可编辑全套技术资料100%好用.zip
- 实训项目-Java-CA数字证书颁发系统+完整功能(增加了文件上传和验证颁发)
- 144区域综合能源系统太阳能消纳能力评估模型,采用distflow二阶锥模型进行配电潮流计算,采用了线性热网能量流模型进行热网潮流计算,光电消纳+光热消纳 改进点:采用结合热网模型的多区域综合能源
- 24-25-1期末模拟试卷1.pdf
- 圆柱磨削及端面加工sw16全套技术资料100%好用.zip
- 载具回流输送机sw16全套技术资料100%好用.zip
- 2006-2020年各省最终消费率(%)数据
- comsol金属贴片,能带计算
- 圆片油槽分选机sw20可编辑全套技术资料100%好用.zip
- 栈板放置机step全套技术资料100%好用.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈