Cellprofiler 3D threshold error


I have been trying to segment DAPI stained nuclei with the new 3D functionality. I am getting the following error when processing the Threshold module:

Failed to run module Threshold
Traceback (most recent call last):
File “CellProfiler\cellprofiler\gui\pipelinecontroller.py”, line 2887, in do_step
File “CellProfiler\cellprofiler\pipeline.py”, line 2022, in run_module
File “CellProfiler\cellprofiler\modules\threshold.py”, line 658, in run
File “CellProfiler\cellprofiler\modules\threshold.py”, line 740, in get_threshold
File “CellProfiler\cellprofiler\modules\threshold.py”, line 844, in _threshold_otsu3
File “site-packages\centrosome\threshold.py”, line 237, in get_adaptive_threshold
File “site-packages\scipy\interpolate\fitpack2.py”, line 1174, in init
error: (1<=kx && kx<=5) failed for 5th keyword kx: regrid_smth:kx=0

I have built this pipepline from scratch in v3 and am not doing anything complicated at this stage (just want to see if it can actually segment my cells well enough in 3D). I only Resize (0.5) and medianFilter prior to thresholding.
Any help would be appreciated.



Can you upload your pipeline and the sample image causing the error? Thanks!


180223 DAPI screen 3D stepXstep.cppipe (11.7 KB)

here is the pipeline, I haven’t tested past the threshold module though.
Having problems with the image upload (can’t tell the image size and stating it may be corrupt). They work fine in imageJ and can be visualised in Windows…


Can you upload it to GoogleDrive/Dropbox/etc and post a link?



Let me know if you can access this. It is a reduced size/stack version of my image.



I found the source of your error- it appears to be thrown when you’re doing Adaptive thresholding but your adaptive window size is >50% the size of your image. I’ve filed a bug report here, but the simplest thing to do is simply adjust your adaptive window size (or use global thresholding).


Hi, thanks for looking into that for me. I will take another look at it with smaller window sizes (the original image is much larger than the small cropped version I added to dropbox). I have been trying without thresholding by moving straight to watershed (I preprocess my images which is kind of like a thresholding in its own right I suppose) and this has been working well so far.
I have a complex dataset (tightly packed nuclei) but remain hopeful that 3D cellprofiler can do the job.