Skip to content

MatlabIO.wiki

Hanchuan Peng edited this page Aug 1, 2016 · 3 revisions

Content

What is the Toolbox

This Matlab toolbox is for reading/writing basic Vaa3D data file formats (image files .RAW, .TIFF, marker file .marker, point cloud file .apo, neuron file .swc which can indeed be used to describe any complicated graph) in Matlab. This is useful for post-analysis of the the image analysis and measurements.

Get the Toolbox

The toolbox is available as a sub-folder after you check out Vaa3D's source code. You can also directly check it out from the subfolder

matlab_io_basicdatatype 

What Are Included

This toolbox contains Matlab routines to read and write files with some formats defined/supported by Vaa3D.

Since some of the functions are mex functions, you may need to run the following command in Matlab to generate the mex function for your machine (assuming you have mex compiling setup in your Matlab):

makeosmex_rawfile_io

The key Matlab routines included in this toolbox are:

Function Name Description
load_v3d_raw_img_file load the .raw, .tiff image stacks used in Vaa3D (depending on file extension, the program automatically determine the file type)
save_v3d_raw_img_file save the .raw, .tiff image stacks used in Vaa3D (depending on file extension, the program automatically determine the file type)
load_v3d_marker_file load the .marker file
save_v3d_marker_file save the .marker file
load_v3d_apo_file load the .apo files (point cloud files)
save_v3d_apo_file save the .apo files (point cloud files)
load_v3d_pointcloud_file load the point cloud files used in Vaa3D (an overloading function provided for convenience)
save_v3d_pointcloud_file save the point cloud files used in Vaa3D (an overloading function provided for convenience)
load_v3d_swc_file load the .swc file (for neurons or other graphs)
load_v3d_neuron_file load the neuron files in the .swc format (an overloading function provided for convenience)
save_v3d_swc_file save the .swc file (for neurons or other graphs)

Issue with the Matlab libTiff library & Solution

To use this toolbox to read/write TIFF files, the libtiff library will be needed in your Matlab search path. However, as Matlab uses an old version of libtiff, it is recommended to by-pass or update the default Matlab libtiff library file.

Let's use the Mac/Linux version(s) of Matlab as the example. What you can do is to disable the default libtiff in Matlab, and instead make it point to the good libtiff of the correct version.

Assume you have already installed libtiff under /usr/local/lib (if you have not built libtiff separately, but have built Vaa3D system using the build.macx or build.linux scripts, then you can also find the libtiff under the folder

<path_to_vaa3d_src_code>/v3d_main/common_lib/lib

The libtiff header files can be found under the folder

<path_to_vaa3d_src_code>/v3d_main/common_lib/include

Note, if you cannot compile this toolbox using makeosmex function, then you may need to copy the several of these standard libtiff header files into this toolbox folder, so to make tiffio.h etc visible.

Then what you can do is to go to /Path-to-matlab/bin/maci (or maci64 or similar folder for a linux system), and list all libtiff files. And then rename or remove the original "libtiff.3.dylib" file. Then you can create a symbolic link to the correct one in the /usr/local/lib folder.

Then it should work (w/o need to re-start Matlab).

Issue with upgrading to XCode 7 and Matlab 2014+ for the Compiler cannot be found bug.

Please check this page http://www.mathworks.com/matlabcentral/answers/246507-why-can-t-mex-find-a-supported-compiler-in-matlab-r2015b-after-i-upgraded-to-xcode-7-0

Clone this wiki locally
You can’t perform that action at this time.