Tong LI
01/30/2026, 11:13 AMAdam Taylor
01/30/2026, 8:20 PMJeremy Muhlich
01/31/2026, 12:31 AMJeremy Muhlich
01/31/2026, 12:33 AMJeremy Muhlich
01/31/2026, 12:34 AMTong LI
02/01/2026, 11:21 AMthe approach for merging the chunks is going to be different for each tool, or at least for each class of tool.exactly want I think it could be! the there's a finite number of class, right? We can then define one template for each type of class. So, I'd say still doable? I've got this module for merging segmentation outlines (https://github.com/cellgeni/nf-modules/blob/main/subworkflows/sanger-cellgeni/tiled_segmentation/main.nf#L48), but the merging is not perfect, as you rightly mentioned. I believe @Quentin Blampey’s work in SOPA has a cleverer implementation. and another one for merging points in WKT format on spot data (https://github.com/cellgeni/nf-modules/blob/main/subworkflows/sanger-cellgeni/tiled_spotiflow/main.nf#L25) For the future, this list of classes could be potentially extended to: 1. image-in/image-out type of module? a. chunking (2D-5D?) b. applying local image processing c. returning locally processed tiles d. merged the processed images i. concatenate if no overlapping (much easier) ii. different merging strategy for different types 2. image-in/object-out type of module? a. chunking (2D-5D?) b. apply object extraction/enhancement(?) c. returning locally processed object d. merged the processed objects. This can be application specific. Off the top of my mind, this covers quite some use-cases already in our case. Do you have any other senarios?
Jeremy Muhlich
02/01/2026, 7:13 PMJeremy Muhlich
02/01/2026, 7:14 PMJeremy Muhlich
02/01/2026, 7:20 PMJeremy Muhlich
02/01/2026, 7:21 PMTong LI
02/01/2026, 8:50 PMCarolin Schwitalla
02/02/2026, 1:17 PMJeremy Muhlich
02/02/2026, 1:20 PMJeremy Muhlich
02/02/2026, 1:20 PMCarolin Schwitalla
02/02/2026, 1:23 PMJeremy Muhlich
02/02/2026, 1:24 PMTong LI
02/02/2026, 1:24 PMJeremy Muhlich
02/02/2026, 1:25 PMJeremy Muhlich
02/02/2026, 1:26 PMJeremy Muhlich
02/02/2026, 1:26 PMTong LI
02/02/2026, 1:28 PMKonrad Rokicki
02/02/2026, 1:33 PMTong LI
02/02/2026, 1:42 PMJeremy Muhlich
02/02/2026, 2:26 PMJeremy Muhlich
02/02/2026, 5:48 PMJeremy Muhlich
02/02/2026, 5:50 PMJeremy Muhlich
02/02/2026, 5:55 PMKonrad Rokicki
02/02/2026, 6:44 PMmap_blocks) are extremely inefficient.
From the perspective of workflow management, I think there are some different ways to think about this:
1. The tool does all the parallelization internally, we don’t need to do anything, just invoke the tool with enough CPUs/GPUs. In this case, the “interface” is the input/output file format. This is simple and elegant but it’s limited to a single node’s memory/compute. If you don’t need distributed processing, I think this is the way to go.
2. The tool does all the parallelization, but relies on an external task scheduler (this is our approach for tera-scale data, which Tong described in his original post). In this case the interface is the file format and some (optional) command line parameters describing how to connect to the cluster. If the cluster parameters are not provided, the processing reverts to local as in (1).
3. The tool provides chunk processing, and there is some general-purpose framework at the workflow level that uses this as a building block (along with a merge algorithm) to process an entire image in a distributed manner. @Tong LI does this drive at what you were thinking about?
4. Are there other programming models that should be considered?Tong LI
02/02/2026, 7:25 PM1. But maybe not in the most efficient way.
Very few, if not none, can natively can do 2?
And yes, 3 is what I meant. because from a pragmatical point of view, I believe it's the easiest to achieve.
For 4 , I believe some Java/Fiji support is needed?
It depends on whether the natural chunk size is larger or smaller than the native chunks and whether the boundaries align vs. overlap. There isn't a one-size-fits-all solution, rather best practices and common strategies.@Jeremy Muhlich agreed. What's why I think having the tool supporting a flexible subsetting/slicing will make the task much easier. Or as what we all are doing, adding a wrapper on top of the tool that enables slicing and then call the algorithm on a chunk within the wrapper.
Jeremy Muhlich
02/03/2026, 3:04 PMJeremy Muhlich
02/03/2026, 3:11 PMsegment_tile. It calls cellpose (cp_model) and then dilates the label mask objects, pretty simple. The loop that iterates over the tile coordinates, performs the work, and merges the label masks is 315-361. The output is saved to a zarr on disk at each iteration so the whole thing runs in constant memory (which was actually the original problem being solved here, which is how this thread started). In this case the final output is re-saved as ome-tiff, but the working zarr could also just be used as the output directly.Jeremy Muhlich
02/03/2026, 3:24 PM