Surface Brain Mets--IdentifyPrimaryObjects Issue


I posted a few weeks ago about calibrating pixels to microns and successfully came up with a CalcuateMath to do the calculation in cp v2.

However, now I’m struggling with the IdentifyPrimaryObjects. I am working with surface brain tumor mets. I need to count the number and get an surface area output for each met in each image. The problem I am having is that im either over selecting the large tumors or if i increase the threshold correction im loosing some of the smaller mets. Additionally, I have had issues with oversegmentation and thus increased the size of the smoothing filter. However, when I do that, I also seem to loose some of the very small tumors.

At this point, I’m wondering if I’m using the wrong thresholding method. I also tried using the three class vs. the two class otsu and found that the threeclass was missing way too much or overselecting. Do I need to add an IlluminationCorrection? Or is there a better way to threshold the images.

I tried to attached some images and my current pipeline, however im not getting an error that the board attachment quota has been reached! Is there someone I could email images and my pipeline too?

Example images (I tried to upload)
ns1_3_cranial is selecting too much of the area around the large tumor
sdc1_11_cranial is missing some of the smaller tumor mets
ns1_13_caudal can be over segmented (the current pipeline settings seem to be handling it at this time)
ns1_4_cranial is an example of something with NO mets


First, we have removed the board quota, so you should be able to attach pipelines, etc. So please attach an image or two and you pipeline for us to best help.

Re: segmentation, have you tried adaptive thresholding methods? They attempt to overcome some of the troubles you might be having. And you might want to turn off, or at least modify the “clumped objects” settings in IDPrimObjects. But do post your pipeline and images, and we can take a look.


hey thanks for getting back to me! i thought that finally getting 16 bit images would help…but it didn’t solve all the problems. i am still teaching people here how to acquire “proper” images on the microscope and how to save them!!!

i already have it on adaptive thresholding because there is so much variation in the background of the images when there is no tumor vs when there are large bright tumors.

as per the clumping, i have already modified the settings somewhat and still am running into problems. i found that increasing the smoothing was helping prevent the clumping, but as i noted in the previous post–when i did this i lost some of the small tumors.

here are the images and here is my pipeline.

thanks so much!

ns1_3_cranial is selecting too much of the area around the large tumor

sdc1_11_cranial is missing some of the smaller tumor mets

ns1_13_caudal can be over segmented (the current pipeline settings seem to be handling it at this time)

ms1_7_cranial should have three small tumors showing up on the left side, this is a good example of the “lowest” signal i want to mark as + for tumor (the current pipeline seems to be missing these)

ns1_4_cranial is an example of something with NO mets

pipeline in next post


SurfaceMets2.cp (6.35 KB)


I’m attaching a modification of your pipeline which should get you started; it still requires some fine tuning. It includes the following changes to your original pipeline:

  • Illumination correction: I think your assumption was correct, illumination correction is a good way to handle this issue (though not the only way). However, some adjustment may be needed on the block size and smoothing filter size in order to cover the variety of tumor sizes you are dealing with.

  • An initial IdentifyPrimObjs module to identify the entire tissue object.

  • Masking so that I can use per-object thresholding in the second IdentifyPrimObjs module to restrict the detection/thresholding to the tissue region only.

A couple of things to note:

  • On the negative control images, you’ll see that the 2nd IdentifyPrimObjs module identifies too much. This is so that you can use the threshold found here to come up with an appropriate lower bound on the threshold value. That way, it will (should?) identify nothing in the negative images and tumors in the experimental images.

  • I’ve used Otsu 3-class thresholding for the tumor detection, but RobustBackground may also work (it does well on images with little foreground and lots of background). You have to check ad see if it’s appropriate.

Hope this helps!
2010_04_05.cp (9.86 KB)


definitely progress. wahooo, great way to start a friday!

my one question now: on some of the images it seems like the illumination correction is actually a little too much. what do i need to adjust to change that? (i have yet to really figure out the ins and outs of that module). is this the block size that you mentioned before?

ns1_13 is an example of where this is too much removed and thus actually the tumors end up appearing smaller than they actually are.

thanks again!

You will probably need to adjust both, most likely decreasing them in tandem.

The key here is to make the illumination function resemble the tissue without the tumor as much as possible, such that when it is subtracted in CorrectIlluminationApply, you are left with the tumors only.