Skip to content

Commit 5cebd7b

Browse files
making nd2 and scanimage-tiff-reader optional (#950)
1 parent 828b5e2 commit 5cebd7b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

suite2p/io/nd2.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
import time
55
import numpy as np
66
from . import utils
7-
import nd2
87

8+
try:
9+
import nd2
10+
ND2 = True
11+
except ImportError:
12+
ND2 = False
913

1014
def nd2_to_binary(ops):
1115
"""finds nd2 files and writes them to binaries

suite2p/io/tiff.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from ScanImageTiffReader import ScanImageTiffReader
1616
HAS_SCANIMAGE = True
1717
except ImportError:
18+
ScanImageTiffReader = None
1819
HAS_SCANIMAGE = False
1920

2021

@@ -106,6 +107,7 @@ def use_sktiff_reader(tiff_filename, batch_size: Optional[int] = None) -> bool:
106107
return True
107108
else:
108109
print("NOTE: ScanImageTiffReader not installed, using tifffile")
110+
return True
109111

110112

111113
def tiff_to_binary(ops):

0 commit comments

Comments
 (0)