Skip to content

Commit a61a260

Browse files
committed
Make create_and_save() return a bool
1 parent cf1e290 commit a61a260

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/imcflibs/imagej/projections.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,20 @@ def create_and_save(imp, projections, path, filename, export_format):
6666
The original file name to derive the results name from.
6767
export_format : str
6868
The suffix to be given to Bio-Formats, determining the storage format.
69+
70+
Returns
71+
-------
72+
bool
73+
True in case projections were created, False otherwise (e.g. if the
74+
given ImagePlus is not a Z-stack).
6975
"""
76+
if not projections:
77+
log.debug("No projection type requested, skipping...")
78+
return False
79+
7080
if imp.getDimensions()[3] < 2:
7181
log.error("ImagePlus is not a z-stack, not creating any projections!")
72-
return
82+
return False
7383

7484
command = {
7585
'Average': 'avg',
@@ -85,3 +95,5 @@ def create_and_save(imp, projections, path, filename, export_format):
8595
export_format,
8696
overwrite=True)
8797
proj.close()
98+
99+
return True

0 commit comments

Comments
 (0)