Skip to content

Commit

Permalink
Merge pull request #13 from caspervdw/osx-implement
Browse files Browse the repository at this point in the history
ENH OSX implementation
  • Loading branch information
caspervdw committed Nov 22, 2015
2 parents 7c57f85 + e8835e2 commit 14a7af0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pims_nd2

This package lets [pims](https://github.com/soft-matter/pims) interface with the [ND2SDK](http://www.nd2sdk.com) for fast reading of Nikon *.nd2 files.

This is implemented on Windows and Linux systems. An SDK for OSX is already included, this is probably easy to implement.
This is implemented on Windows, Linux and OSX systems.

Dependencies
------------
Expand All @@ -28,8 +28,8 @@ The best way to use the reader is using a context manager. If you do not use a c
Metadata access can be done on two levels: reader level and frame level.

frames.metadata['mpp'] # calibration in microns per pixel
frames[0].metadata['t_ms'] # timestamp of image in milliseconds
frames[0].metadata['t_ms'] # time of frame in milliseconds

Supporting Grant
----------------
This reader was developed by Casper van der Wel, as part of his PhD thesis work in Daniela Krafts group at the Huygens-Kamerlingh-Onnes laboratory, Institute of Physics, Leiden University, The Netherlands. This work was supported by the Netherlands Organisation for Scientific Research (NWO/OCW).
This reader was developed by Casper van der Wel, as part of his PhD thesis work in Daniela Kraft's group at the Huygens-Kamerlingh-Onnes laboratory, Institute of Physics, Leiden University, The Netherlands. This work was supported by the Netherlands Organisation for Scientific Research (NWO/OCW).
5 changes: 3 additions & 2 deletions pims_nd2/ND2SDK.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
nd2 = cdll.LoadLibrary(os.path.join(os.path.dirname(__file__), 'ND2SDK',
'linux', 'libnd2ReadSDK.so'))
elif platform == "darwin":
raise OSError("Unsupported OS. The ND2SDK for OSX is included, "
"please try to implement!")
nd2 = cdll.LoadLibrary(os.path.join(os.path.dirname(__file__), 'ND2SDK',
'osx', 'nd2sdk.framework', 'Versions',
'1', 'nd2sdk'))
elif platform == "win32":
bitsize = sizeof(c_void_p) * 8
if bitsize == 32:
Expand Down
Binary file not shown.
Binary file modified pims_nd2/ND2SDK/osx/nd2sdk.framework/Versions/1/nd2sdk
Binary file not shown.
1 change: 1 addition & 0 deletions pims_nd2/nd2reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ def metadata(self):
'plane_count': bufmd.uiPlaneCount,
'angle': bufmd.dAngle,
'calibration_um': bufmd.dCalibration,
'time_start_jdn': bufmd.dTimeStart,
'time_start': h.jdn_to_datetime_local(bufmd.dTimeStart),
'time_start_utc': h.jdn_to_datetime_utc(bufmd.dTimeStart),
'objective': bufmd.wszObjectiveName,
Expand Down
22 changes: 14 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,27 @@

setup_parameters = dict(
name="pims_nd2",
version="0.3",
version="0.4",
description="ND2SDK wrapper for PIMS",
author="Casper van der Wel",
install_requires=['pims>=0.3'],
author_email="[email protected]",
url="https://github.com/soft-matter/pims_nd2",
download_url="https://github.com/soft-matter/pims_nd2/tarball/0.3",
download_url="https://github.com/soft-matter/pims_nd2/tarball/0.4",
packages=['pims_nd2'],
include_package_data=True,
platforms=[
# 'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows :: Windows 7',
'Operating System :: Microsoft :: Windows :: Windows Vista',
'Operating System :: POSIX :: Linux',
],
classifiers=["Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Programming Language :: C",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS"],
platforms=['MacOS X', 'Windows', 'Linux CentOs 6.5/7', 'Linux Debian 7/8'],
long_description=descr)

setup(**setup_parameters)

0 comments on commit 14a7af0

Please sign in to comment.