NamesAndTypes not handling two image sets

I’m writing a pipeline that needs to load a bunch of microscopy images and some binary images (which I will convert to objects marking cell bodies). I have both image sets stored as tiffs, in the same folder. I’m using NamesAndTypes to try to form two sets.

As an example, I have a file containing:
fileA1.tif, fileA2.tif, fileA3.tif, fileA_Mask.tif, fileB1.tif, fileB2.tif, fileB3.tif, fileB_Mask.tif

I want to load this into two image sets:
Files: fileA1.tif, fileA2.tif, fileA3.tif, fileB1.tif, fileB2.tif, fileB3.tif
Masks: fileA_Mask.tif, fileB_Mask.tif

CellProfiler is forcing both sets to be the same size. So it will only load a number of the images from the larger set equal to the number of images in the smaller set. So:
Files: fileA1.tif, fileA2.tif
Masks: fileA_Mask.tif, fileB_Mask.tif

Does anyone have some ideas about why this is happening?

Unfortunately this is how ordering and matching of files done in CellProfiler. As Image sets are of different sizes and you want to use mask as well. CellProfiler produces image list which is equal to number in a low image set. Either you can try to upload equal no of image set or make separate pipeline to analyze them.


I ended up making a separate pipeline as a workaround. Thanks for the help!


For the record, there IS a way to do this in CellProfiler. As long as you can extract some piece of Metadata thank links your As and is different from your Bs (like in the example you posted above, ‘fileA’ vs ‘fileB’), you can use the ‘Metadata’ option for ‘Image set matching order’ to matching the many regular files to the single mask. The NamesAndTypes module help has some help on how to do this, and there are some good forum threads too.