系统教程
您现在的位置是:首页>服务器系统>Ubuntu系统内容

ubuntu安装openslide-matlab

时间:2018-04-29 出处:未知复制分享人气(次) 【

跑全扫描图像需要用到openslide这个包,底层是用C语言写的,这里是openslide-python的安装以及详解:
ubuntu安装openslide-matlab
 
首先下载openslide-matlab的包,github上有https://github.com/fordanic/openslide-matlab
解压用matlab运行openslide_load_library.m这个文件,我出现了这个错误
libopenslide.so.0 not available on the MATLAB path\n 
 
解决办法
首先在终端找到libopenslide.so.0这个文件
locate libopenslide.so.0  
于是能得到文件的位置
我的位置是在/usr/lib/x86_64-linux-gnu/libopenslide.so.0
然后将openslide_load_library.m中的第45行的
libName = libopenslide.so.0 改成
[python] view plain copy
libName =('/usr/lib/x86_64-linux-gnu/libopenslide.so.0');  
然后继续运行openslide_load_library.m这个文件,可能又出现类似的错误,matlab的which()这个语句不咋地,
将下面一行的 which(libName)直接改成
'/usr/lib/x86_64-linux-gnu/libopenslide.so.0'  
然后继续运行openslide_load_library.m这个文件
openslide.h not available on the MATLAB path这个错误
继续在终端运行
locate openslide.h  
这时候应该能发现openslide.h文件在的位置,
将第53行openslideHeaderLocation = which('openslide.h');这一句改成
openslideHeaderLocation = ('/home/hjxu/openslide-3.4.1/src/openslide.h');  
目前安装就已经结束了,但是我出现了一个问题
我的机器里没有openslide.h这个文件,locate找不到位置,思前想后,可能我在安装openslide-python的时候是用命令安装的,所以找不到这个文件
重新安装openslide-python这个包,下载地址http://openslide.org/download/
下载的是3.4.1,根据readme显示
cd openslide-3.4.1/  
sudo ./configure  
会检查一些需要的库,我缺少了openjpeg这个库,安装指南https://github.com/uclouvain/openjpeg/blob/master/INSTALL.md
首先得下载https://github.com/uclouvain/openjpeg/releases/tag/v2.1.2
然后根据安装指南
To build the library, type from source tree directory:
mkdir build
cd build
cmake ..
make
Binaries are then located in the 'bin' directory.
To install the library, type with root privileges:
make install
make clean
To build the html documentation, you need doxygen to be installed on your system.It will create an"html" directory in TOP_LEVEL/build/doc)
make doc
然后再
cd openslide-3.4.1/  
sudo ./configure  
提示缺少No package 'sqlite3' found
安装splite3
sudo apt-get install sqlite sqlite3  
然后就ok了,这时候再locate openslide.h就能发现位置了,我的位置是在
/home/hjxu/openslide-3.4.1/src/openslide.h  
然后更改openslide_load_library.m
将第53行openslideHeaderLocation = which('openslide.h');这一句改成
openslideHeaderLocation = ('/home/hjxu/openslide-3.4.1/src/openslide.h');  
再运行openslide_load_library.m就OK了
可以尝试运行openslide_example.m 不报错就可以了。
    最新资讯
    热门内容
    小米移动电源能为iPad mini充几次电