Relative image link



Is it possible to have relative image link in the database for Cellprofiler Analyst (Sqlite database). I would like to share the images and database created with CellProfiler but it is not possible for other people to see images from CP Analyst so they are not able to use the classifier or to see the cells corresponding to some dot in the scatter plot.

Thank you,


Hi Daniel,

It is possible to do this; however, the assumption is that the path to the images is specified relative to the location of the properties file.

As an example, look at the CPA example here; the image path columns are specified as simply “images” which refers to the “image” folder. “images” is comntained in the same folder as the properties file, so if you move it, CPA will no longer be able to find it.

CellProfiler will always include the absolute path in the database, but the SQLite file can be modified after the fact. I’ve used the SQLite Manger extension in Firefox to change database contents; I’m sure there are others. For the example above, you can change the paths to whatever you need with the following statement query:UPDATE per_image SET Image_PathNames_Path_OrigDNA = "<relative_path>"where <relative_path> is the relative path to the images, in this case “images”.



Another thought is to make your images accessible via URL, and share the URL location. An example pipeline using this method is on CP’s Welcome screen (Help->Show Welcome Screen), under “See a pipeline in action”.



Thanks a lot for the answers.
I changed the image path in the database for a relative path and everything works fine.



Glad to hear that - thanks for writing back.


Rekindling a really old topic but seeing as it helped me make sense of the file naming, we made a really short python script to modify all columns of a SQLite file.
Hopefully someone else will find it useful

The file can be downloaded here