This website works better with JavaScript.
Home
Help
Sign In
zolfa
/
zolfa-nd2reader
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Projects
0
Releases
0
Wiki
Activity
Browse Source
fix to allow reading of ND2-files with missing frames, due to e.g. skipping z-positions in one channel of a multichannel image; based on most recent commit of master
feature/load_slices
unknown
5 years ago
parent
8f8a3aff1e
commit
52e52b3616
1 changed files
with
7 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+7
-1
nd2reader/parser.py
+ 7
- 1
nd2reader/parser.py
View File
@ -283,7 +283,13 @@ class Parser(object):
if
np
.
any
(
image_data
)
:
return
timestamp
,
Frame
(
image_data
,
metadata
=
self
.
_get_frame_metadata
(
)
)
raise
NoImageError
# If a blank "gap" image is encountered, generate an empty frame (black image) of corresponding height and width to avoid
# errors with ND2-files with missing frames.
else
:
empty_frame
=
np
.
zeros
(
[
height
,
width
]
)
return
timestamp
,
Frame
(
empty_frame
,
metadata
=
self
.
_get_frame_metadata
(
)
)
# raise NoImageError # <-- delete?
def
_get_frame_metadata
(
self
)
:
"""
Get the metadata for one frame
Write
Preview
Loading…
Cancel
Save