diff --git a/nd2reader/__init__.py b/nd2reader/__init__.py index 5520ddf..420828c 100644 --- a/nd2reader/__init__.py +++ b/nd2reader/__init__.py @@ -52,7 +52,10 @@ class Nd2(object): res = [acqtime] for i in range(self.metadata['ImageAttributes']["SLxImageAttributes"]["uiComp"]): a = array.array("H", d) + res.append(a[4+i::self.metadata['ImageAttributes']["SLxImageAttributes"]["uiComp"]]) + arr = np.reshape(res[1], (self.height, self.width)) + # TODO: Are you missing a zoom level? Is there extra data here? Can you get timestamps now? return res diff --git a/run.py b/run.py index 0072dae..c751aa9 100644 --- a/run.py +++ b/run.py @@ -3,14 +3,14 @@ from pprint import pprint n = Nd2("/home/jim/Desktop/nd2hacking/BFonly.nd2") -print("Height: ", n.height) -print("Width: ", n.width) -for fov in n.fields_of_view: - print(fov.number, fov.x, fov.y, fov.z, fov.pfs_offset) +# print("Height: ", n.height) +# print("Width: ", n.width) +# for fov in n.fields_of_view: +# print(fov.number, fov.x, fov.y, fov.z, fov.pfs_offset) +# +# for channel in n.channels: +# print(channel.name) +# print(channel.camera) +# print(channel.exposure_time) -for channel in n.channels: - print(channel.name) - print(channel.camera) - print(channel.exposure_time) - -print(n.get_image(3)) \ No newline at end of file +n.get_image(3) \ No newline at end of file