def prepare_run(self, workspace): '''Create an IPD for every url that passes the filter''' if workspace.pipeline.in_batch_mode(): return True if self.wants_filter: env = J.get_env() jexpression = env.new_string_utf(self.filter.value_text) filter_fn = J.make_static_call( "org/cellprofiler/imageset/filter/Filter", "filter", "(Ljava/lang/String;Ljava/lang/String;)Z") ipds = filter( lambda ipd:filter_fn(jexpression, env.new_string_utf(ipd.url)), workspace.pipeline.image_plane_details) else: ipds = workspace.pipeline.image_plane_details workspace.pipeline.set_filtered_image_plane_details(ipds, self) return True
def prepare_run(self, workspace): '''Create an IPD for every url that passes the filter''' if workspace.pipeline.in_batch_mode(): return True if self.wants_filter: env = J.get_env() jexpression = env.new_string_utf(self.filter.value_text) filter_fn = J.make_static_call( "org/cellprofiler/imageset/filter/Filter", "filter", "(Ljava/lang/String;Ljava/lang/String;)Z") ipds = filter( lambda ipd: filter_fn(jexpression, env.new_string_utf( ipd.url)), workspace.pipeline.image_plane_details) else: ipds = workspace.pipeline.image_plane_details workspace.pipeline.set_filtered_image_plane_details(ipds, self) return True