Error while using RunImageJMacro Module

Hi everyone!

I am trying to use the new RunImageJMacro module in CellProfiler 4.1.3 but I keep getting the following error:

Error while processing RunImageJMacro:
CellProfiler couldn’t find the output expected from the ImageJ Macro,
File output.tiff was missing

I do have an output.tiff file in the specified directory, but I don’t know why is telling me that I don’t. I made sure they are spelled correctly. I feel that I am making a small mistake but I don’t know where. I am attaching a snippet of my macro and my module. Any help will be greatly appreciated!!!

Screen Shot 2021-03-19 at 9.03.25 AM|690x357 Screen Shot 2021-03-19 at 9.05.12 AM|690x82

Sample image and/or code

  • Upload an original image file here directly or share via a link to a file-sharing site (such as Dropbox) – (make sure however that you are allowed to share the image data publicly under the conditions of this forum).
  • Share a minimal working example of your macro code.


  • What is the image about? Provide some background and/or a description of the image. Try to avoid field-specific “jargon”.

Analysis goals

  • What information are you interested in getting from this image?


  • What stops you from proceeding?
  • What have you tried already?
  • Have you found any related forum topics? If so, cross-link them.
  • What software packages and/or plugins have you tried?


Would you be able to upload an example image set, the macro file itself and the cellprofiler project file?

Also, if you run the macro within imageJ, does it work properly?

Hi @DStirling,
Thank you for reaching out. Yes, when I run the macro in Fiji it works properly. The only thing is that when running it, I have to specify which directory/folder to use. Then, if the image is in that file there are no issues. If I put an incorrect location, then there will be issues. Thank you for your help!

Z_Projection_Macro.ijm.ijm.ijm (243 Bytes)

Fiji+CellProfiler pipeline.cpproj (653.7 KB)

Sample Image:


Thanks, I’ve taken a look and I think the problem is that the image you’re working with is 3D. The pipeline is currently set up in 2D mode, which means that the RunImageJMacro module is only exporting the first plane of your image. 3D processing can be enabled in the NamesAndTypes module.

Unfortunately RunImageJMacro doesn’t support 3D (yet!). What we usually recommend is using the MakeProjection module in a dedicated pipeline for converting 3D images into 2D projections.

Hope that helps!

@DStirling Thanks for letting me know that RunImageJMacro doesn’t work with 3D images, I didn’t know. However, I tried using the MakeProjection module and that didn’t work either. I looked up in the manual and it says that module only works with 2D images not 3D. I guess I would have to do the z-projections in image J and then manually move them to CellProfiler, unless there is an alternative way?


To use MakeProjection you’d actually declare the pipeline as 2D, then load the 3D image in and add an “Extract metadata from file headers” extractor in the Metadata module. This should pull out the individual planes as 2D images, which can then be used with the MakeProjection module.