Images from database


I am a newbie to Cell Profiler. We are planning to use cell profiler as part of an image analysis project.

Right now, we are planning to work from a MYSQL database.

In the database we have stored the path of the images. We would like to access the images using these image path through cellprofiler. Is it possible to make changes to the source code as to access from the database. If so, can you please tell me where and how we need to implement it.

Once the images are accessed from the database, we want to perform certain operations on them and then save them back into the database (just the path of the images).


Regarding loading images whose path and filenames are stored in a database:

We currently do not have any modules that allow looking up image names from a database. Our typical usage of CellProfiler is to have image files stored in folders or subfolders. CellProfiler analyzes all images within a folder (or nested subfolders, as desired) and then creates a fresh database full of the resulting numerical data (using the ExportToDatabase module). Any processed images that the user wants to save are saved directly to the hard drive (not into a database - for most projects this would make the database unwieldy), in a location the user chooses.

However, you could presumably modify the LoadImages module in CellProfiler to feed it a list of path+filenames in plain text format, presuming that you would previously have created this text file by querying your database directly (in a manual step, outside of CellProfiler). That should be a fairly simple modification to make CellProfiler analyze a particular set of images, as specified by the text file, rather than ALL of the images in a particular folder. The LoadText module (with no modification, I think) will load the text file of path+filenames, and then the LoadImages module could be made to read that text list and use the loaded text as the place to look for images, instead of looking for images in the default image folder.

Regarding processed images, you could modify the SaveImages module to write out the path and file name of the resulting saved images in comma delimited format and feed it back into your database after processing completes. You could also modify the SaveImages module to store the pixel-by-pixel data for each processed image in a format that could be loaded into a database.