ExportToDatabase Error: Not JSON Serializable

Hi there,
I keep getting an error during initialisation of my pipeline, when it gets to the ExportToDatabase module:

The object names for which I’m exporting measurements are just Nuclei, Cell and Cytoplasm so I’m not sure why it would have an issue with those. It also gives me a warning that Cytoplams is not in a 1:1 relationship with the other objects (though it should be, given it’s a tertiary object created from the other two…). Pipeline and a few images also attached. Hope you can help! I’d like to use the database module so I can put these measurements through CPA’s classifier.

Thank you,

A%20-%201(fld%201%20wv%20UV%20-%20DAPI)A%20-%201(fld%202%20wv%20UV%20-%20DAPI)A%20-%201(fld%203%20wv%20Green%20-%20dsRed)A%20-%201(fld%203%20wv%20UV%20-%20DAPI)A%20-%201(fld%204%20wv%20Green%20-%20dsRed)A%20-%201(fld%201%20wv%20Green%20-%20dsRed)A%20-%201(fld%205%20wv%20UV%20-%20DAPI)A%20-%201(fld%202%20wv%20Green%20-%20dsRed)A%20-%201(fld%205%20wv%20Green%20-%20dsRed)A%20-%201(fld%204%20wv%20UV%20-%20DAPI)180717_MacAct.cppipe (17.8 KB)


I can reproduce this on my Mac in 3.0.0, bug filed here. Sorry about that, we’ll have someone look into it!

FWIW, I expect the bug is due to the object filtering somehow; it’s a hassle, but if this is urgent to complete you could after IDSecondary in your current pipeline just adding a ‘ConvertObjectsToImage’ and ‘SaveImages’ modules to save your 3 types of objects you care about later (Nuclei, Cells, and Cytoplasm) as uint16 label matrix images- you could then make a SECOND pipeline that loads the original images, the object images (which you can load directly as objects in NamesAndTypes), then does your measurements and exports the data. I know it’s far from ideal to have to run two sets of pipelines, but that’s the temporary fix you could try now.

Hi Beth,

Thanks for the workaround idea - I’m giving that a go now. In SaveImages it’s asking me about the file format - tiff, npy etc. Do I need to choose a specific one to allow it to load them directly as objects?


I’d do tiff, but npy should work as well. Just make sure to do uint16 in ConvertObjectsToImage and also 16-bit tiff!

Thanks for this - it worked fine (though only with tiff files, not npy. But tiffs were smaller anyway so that worked well!)