Skip to content

Commit

Permalink
issue #1148 clear the image cache after each image set + some code to…
Browse files Browse the repository at this point in the history
… keep the second in a list of CorrectIlluminationCalculate modules from running the first as part of what it does.
  • Loading branch information
Lee Kamentsky committed Jun 13, 2014
1 parent 564235f commit 4e6ec2c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cellprofiler/modules/correctilluminationcalculate.py
Expand Up @@ -493,11 +493,22 @@ def prepare_group(self, workspace, grouping, image_numbers):
self.illumination_image_name.value, self)
d = self.get_dictionary(image_set_list)[OUTPUT_IMAGE] = {}
if self.each_or_all == EA_ALL_FIRST:
#
# Find the module that provides the image we need
#
md = workspace.pipeline.get_provider_dictionary(
self.image_name.group, self)
src_module, src_setting = md[self.image_name.value][-1]
modules = list(pipeline.modules())
idx = modules.index(src_module)
last_module = modules[idx+1]
for w in pipeline.run_group_with_yield(
workspace, grouping, image_numbers, self, title, message):
workspace, grouping, image_numbers,
last_module, title, message):
image = w.image_set.get_image(self.image_name.value,
cache = False)
output_image_provider.add_image(image)
w.image_set.clear_cache()
output_image_provider.serialize(d)

return True
Expand Down

0 comments on commit 4e6ec2c

Please sign in to comment.