How do you autoload a pipeline using MATLAB?

Hi, I used

open(‘file location of cellprofiler.exe’) in MATLAB to load cellprofiler, what MATLAB coding should be used to automatically load a pipeline in cellprofiler as soon as it starts up?

The syntax for this would be:

open("<path to CP>/CellProfiler.exe -p <path to pipeline>/pipeline.cp")

As an added note, if you type ‘cellprofiler.exe --help’, you can see all the other optional arguments that CellProfiler can take.

Hope this helps!

So I tried this line in matlab

open(‘C:\Program Files\CellProfiler\CellProfiler.exe -p C:\Program Files\CellProfiler\06-25-10PIPE_3.cp’)

The first part is the .exe location then the next part is the part with the pipeline but the code is not working.

If I try (‘C:\Program Files\CellProfiler\CellProfiler.exe’) it loads cellprofiler, but it does not automatically load the pipeline.

Oops, I left a couple of additional arguments out that need/should be specified:

  • -i
    will point CP to a specified default input folder on startup
  • -o
    will do the same for the output folder.
  • -r
    and -c will run the specified pipeline after loading and without showing the interface, respectively.

My guess is that the pipeline didn’t (apparently) work since the -i and -r arguments were omitted.


Thank you very much for your help,

Do you think you could give an example code of this?

Also, I tried to call CellProfiler.exe–help on matlab but that didn’t work. How do you call the help function that shows you the arguments?

Thanks again.

A simple case would be the following: CellProfiler.exe -c -r -i c:\my_image_directory -o c:\my_output_directory -p c:\my_pipeline.cp

Open a command window (Start Menu -> Run… -> Type ‘cmd’) then from the window that appears, type:

Assuming that you installed CP to the Program Files folder. Since there’s a space in the root folder name, you’ll need the quotes. Also, there is a space before the double-hyphen.