Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ashlar/reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,10 +1065,12 @@ def _load_correction_profiles(self, dfp_path, ffp_path):
self.dfp /= np.iinfo(self.dtype).max
self.do_correction = True

def assemble_channel(self, channel, out=None):
def assemble_channel(self, channel, out=None, fill_blank_value=None):
num_tiles = len(self.aligner.positions)
if out is None:
out = np.zeros(self.shape, self.dtype)
if fill_blank_value is not None:
mask = np.ones(self.shape, bool)
else:
if out.shape != self.shape:
raise ValueError(
Expand All @@ -1082,6 +1084,10 @@ def assemble_channel(self, channel, out=None):
img = self.aligner.reader.read(c=channel, series=si)
img = self.correct_illumination(img, channel)
utils.paste(out, img, position, func=utils.pastefunc_blend)
if fill_blank_value is not None:
utils.paste(mask, np.zeros_like(img, bool), position)
if fill_blank_value is not None:
out[mask] = fill_blank_value
# Memory-conserving axis flips.
if self.flip_mosaic_x:
for i in range(len(out)):
Expand Down