CellProfiler Invalid Image Dimensions

Hello,

I need to count cells in 3D for an experiment and have modified the 3D monolayer pipeline to analyze my images. However, every time I start the pipeline I get the same error message: “Invalid dimensions for image data.”

I found the dimensions for voxel size by opening my images up in ImageJ and opening “Show Info” and scrolling down to voxel size.

The pipeline seems to work well if I use single z slices and click “No” for process as 3D.

Any help would be greatly appreciated!

Sorry you are having trouble, sounds like hopefully a simple configuration issue.

If you could post your pipeline so far, and an example image that may help folks to diagnose!

3d_cell_counter_test.cpproj (694.0 KB)
Channel 1: https://drive.google.com/file/d/1PBdwQsOrJ4Asr1xp76mSfSbsmLyHfRVZ/view?usp=sharing

Channel 0: https://drive.google.com/file/d/1PBdwQsOrJ4Asr1xp76mSfSbsmLyHfRVZ/view?usp=sharing

Hi @mah3mu,

Could I ask about the origins of your image stacks? The scaling of your images is really quite odd. Currently, the sizing is 30769.229 pixels per pixel which is frankly impossible

I totally made up some scaling based on what I considered average based on the size of your nucleus and it was fine. The scaling I made up was 0.645 in X and Y and 1 in Z.

Hey @lmurphy,

The images were taken using an inverted Nikon Eclipse Ti2 and a Hamamatsu C11440-22C camera.
I have attached the image info from ImageJ. Hopefully this is the information you needed.
I tried to run the pipeline with the voxel size 0.645x0.645x1 and still got the same error message.

Thanks for the help!
3d_cell_counter_test.txt (169.9 KB)

Ah right, so from that text file I can see that your dimensions should be 0.325 x 0.325 x 1. I got that from the line “Voxel size: 0.3250x0.3250x1 micron^3”.

I tried your pipeline but just changing to those dimensions and still got the error so then I re-saved your Tiff in FIJI with the correct dimensions as below and then loaded that into CellProfiler and it ran through fine. So I guess even though you write in the dimensions in the NamesAndTypes module CellProfiler is also checking the metadata too.

image.

I also noticed that in the Metadata module you aren’t extracting the multiple slices which I think is also needed for CellProfiler to run this properly. So if you click “Add another extraction method” then “Extract from Image File Headers” and click “Update Metadata” button and then “Update” button on the table, you should then see the table populate with all the slices and channels (so for this file you should have 64 rows).

Hope this information helps! Let us know how you get on.

2 Likes

@lmurphy That fixed that issue, but now I am getting another issue in the pipeline.

When the pipeline gets to ImageMath #24, it says that the images are of different sizes. The image that becomes MonolayerInvert is multiplied by 0.25 at one point and then multiplied by 4, so there should be no net change in size, right?

I really appreciate your help so far!

Thanks!

Okay, to try and help with that I think I’ll need both channels. I didn’t mention it before but both your links to the two different channels are actually the same link so I only have one channel!

Sorry about that!


Okay, I have found the issue. Your images start with xy dimensions of 1024 x 246. In module 18 you resize by 0.25 which calculates as 256 x 61.5 but you can’t really have 0.5 of a pixel and I suspected that was the issue

To test this I put a SaveImage after your second Resize module and looked at the dimensions of the resultant image, finding they were 1024 x 258 which means CellProfiler rounds up the half pixel to 62.

To get round this, you could set the second Resize to the method where you specify the dimensions and set them as 1024 and 246.

Good luck!

1 Like

Awesome sleuthing, Laura!

1 Like