Skip to content

Commit eda40dd

Browse files
authored
added paste_func to Mosaic constructor to allow users to specify custom functions (#216)
1 parent b7ae485 commit eda40dd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ashlar/reg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ class Mosaic(object):
10381038
def __init__(
10391039
self, aligner, shape, channels=None, ffp_path=None, dfp_path=None,
10401040
flip_mosaic_x=False, flip_mosaic_y=False, barrel_correction=None,
1041-
verbose=False
1041+
pastefunc = utils.pastefunc_blend, verbose=False
10421042
):
10431043
self.aligner = aligner
10441044
self.shape = tuple(shape)
@@ -1049,6 +1049,7 @@ def __init__(
10491049
self.dtype = aligner.metadata.pixel_dtype
10501050
self._load_correction_profiles(dfp_path, ffp_path)
10511051
self.verbose = verbose
1052+
self.pastefunc = pastefunc
10521053

10531054
def _sanitize_channels(self, channels):
10541055
all_channels = range(self.aligner.metadata.num_channels)
@@ -1149,7 +1150,7 @@ def assemble_channel(self, channel, out=None):
11491150
sys.stdout.flush()
11501151
img = self.aligner.reader.read(c=channel, series=si)
11511152
img = self.correct_illumination(img, channel)
1152-
utils.paste(out, img, position, func=utils.pastefunc_blend)
1153+
utils.paste(out, img, position, func=self.pastefunc)
11531154
# Memory-conserving axis flips.
11541155
if self.flip_mosaic_x:
11551156
for i in range(len(out)):

0 commit comments

Comments
 (0)