If you wanted to use CellProfiler as a stand-alone application on hundreds of images, you could simply put those images in a folder and run a CellProfiler pipeline on them. CellProfiler will cycle through all the images. This is the standard way most people use CellProfiler.
But, it sounds like you want to use your own software and call CellProfiler ‘headless’, that is - you want to run CellProfiler without its graphical user interface (GUI) and just use CellProfiler as an image processing back-end for your own software. This is feasible.
It’s a little sneaky - What you should do is first use CellProfiler in the normal way: set up a pipeline and process a few example images until the settings are appropriate. Then, add CreateBatchScripts module to the end of your pipeline and run the pipeline. At the end of the first cycle, this last module will create a text file that is essentially the sort of code you will need to add to your program to process individual images using the pipeline. You will also have created a handles structure (the output file) that you will need to provide as a variable to CellProfiler when you run it from within your own software. The major changes you will need to make to the output file is to remove the CreateBatchScripts module itself from the pipeline that is in this handles structure, and you will need to change the way images are fed into CellProfiler. Whereas the output file will have a few example images listed as the images to be processed, you will need to have your software tell CellProfiler which images to be processed. Lastly, you will have to handle the measurements which CellProfiler makes, which I imagine will feed into your own software somehow. There are other groups working on getting this to work with their own software. If you are successful and have more tips on accomplishing this, please post your advice here!
If, by contrast, you want to run an individual CellProfiler module by itself on an image, there are some instructions in Help > Programming Notes at the end (I’ve pasted the relevant part below) which describe how to do this. You basically set up a fake little handles structure and feed in the appropriate variables.
% *** RUNNING CELLPROFILER WITHOUT THE GRAPHICAL USER INTERFACE ***
% In order to run CellProfiler modules without the GUI you must have the
% following variables:
% handles.Settings.ModuleNames (for all modules in pipeline)
% handles.Settings.VariableValues (for all modules in pipeline)
% handles.Current.CurrentModuleNumber (must be consistent with pipeline)
% handles.Current.SetBeingAnalyzed (must be consistent with pipeline)
% handles.Current.FigureNumberForModuleXX (for all modules in pipeline)
% handles.Current.NumberOfImageSets (set by LoadImages, so if it is run
% first, you do not need to set it)
% handles.Preferences.IntensityColorMap (only used for display purposes)
% handles.Preferences.LabelColorMap (only used for display purposes)
% handles.Preferences.FontSize (only used for display purposes)
% You will also need to have the CPsubfunctions folder, since our Modules
% call CP subfunctions for many tasks. The CurrentModuleNumber needs to be
% set correctly for each module in the pipeline since this is how the
% variable values are called. In order to see what all of these variables
% look like, run a sample analysis and then go to File -> Tech Diagnosis.
% This will let you manipulate the handles variable in MatLab.