Skip to content

Commit fed8217

Browse files
committed
Fix bug correct_and_project() when model is None
1 parent 159738e commit fed8217

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/imcflibs/imagej/shading.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,21 @@ def correct_and_project(filename, path, model, proj, fmt):
8989
imps = bioformats.import_image(filename, split_c=True)
9090
if model is not None:
9191
log.debug("Applying shading correction on [%s]...", filename)
92-
imps = apply_model(imps, model)
93-
bioformats.export_using_orig_name(imps, path, filename, "", fmt, True)
92+
imp = apply_model(imps, model)
93+
bioformats.export_using_orig_name(imp, path, filename, "", fmt, True)
94+
# imps needs to be updated with the new (=merged) stack:
95+
imps = [imp]
9496

9597
if proj == 'None':
9698
projs = []
9799
elif proj == 'ALL':
98100
projs = ['Average', 'Maximum']
99101
else:
100102
projs = [proj]
101-
projections.create_and_save(imps, projs, path, filename, fmt)
103+
for imp in imps:
104+
projections.create_and_save(imp, projs, path, filename, fmt)
105+
imp.close()
102106

103-
# imps.show()
104-
imps.close()
105107
log.debug("Done processing [%s].", os.path.basename(filename))
106108

107109

0 commit comments

Comments
 (0)