Closed mkeays closed 4 years ago
Hi @mkeays ,
The issue is that the CellProfiler U-Net requires the height and width of the images to be evenly divisible by 2 raised to the number of layers in the network, which in this case works out to be 2^3 = 8. Are your images actually 251 x 336 (rows x cols) after ignoring overlap? That seems pretty small so perhaps it's a configuration error. If that is correct though, then you can set the "target_shape" property like it is set here. This will resize the image before sending it to the U-Net to avoid that error and based on what I'm seeing, I would suggest setting that to [256, 336]
(though I would first make sure you're really expecting them to be that small).
For posterity, the issue was also raised at https://github.com/CellProfiler/CellProfiler-plugins/issues/65.
Hi @eric-czech , thank you very much for explaining this. The tiles are 1007 x 1344 without overlap, and setting the target_shape to the [504, 672]
seems to have solved it and the pipeline is now progressing.
Another important caveat I have found with that network is that images really need to be in the ballpark of 20x magnification for it to work well. In other words, if your original images were not taken at 40x and then downsampled by about 1/2 such as in that example I linked to, you may very well not get good results. I think what you did is best if you were using a 40x objective but if it was 20x, then I'd change the target_shape to [1024, 1344]
.
One last thought: Assuming that works, you might also consider setting this property in your configuration (for CP Analyst exports): https://github.com/hammerlab/cytokit/blob/master/pub/config/codex-spleen/experiment.yaml#L129
The "Explorer" app with Cytokit is useful for quick QC for properties like that target_shape (i.e. it's probably the fastest way to get a fast sense of whether or not the segmentation worked well) but for going beyond that CP Analyst is definitely the best option if you were looking for a GUI (though it will slow the processing down a lot).
Hi @eric-czech , thanks for the further explanation. This data is 20x so I will try [1024, 1344]
for the target_shape as you suggest. My ultimate goal is to build an automatic pipeline with minimal manual input but I will take a look with the GUI for QC purposes.
Sounds good, I'll close this out then.
Hello,
I am trying Cytokit with some CODEX data from a collaborator, and have run into the error below and I'm not sure how to overcome it. Would you have any idea what might be causing this?
Thanks, Maria