ND2 Reader

Nikon’s microscopes use a proprietary format (ND2) to save imaging data. The library to read these files are provided by the original owners as an SDK. However, this SDK is written in C.

To import image data into MATLAB, I wrote a MATLAB class that accesses the functions in the original C library. This class uses MATLAB’s loadlibrary function to access the library directly.

Repository

Code, compiled MATLAB toolboxes, and instructions can be found here.

Note: There are a few bugs in the code. Primarily, I have noticed that MATLAB will occasionally crash when calling this function rapidly in succession. I suspect that the error is memory leak but have not been able to trace it yet.