13
$\begingroup$

The task is to identify the image region of the tumor.

tomography of kidneys with tumor (white area on the left kidney)

I try to use example from documentation centre:

tom1 = Import["https://i.stack.imgur.com/mZ4fR.jpg"];
tumor = SelectComponents[
          DeleteBorderComponents[ Binarize[ tom1, {0.75, 1}]], 
          {"Area", "Holes"}, 2800 < #1 < 2900 && #2 > 0 &];
circle = ComponentMeasurements[ 
           ImageMultiply[ tom1, tumor], 
           {"Centroid", "EquivalentDiskRadius"}][[All, 2]];
Show[ tom1, Graphics[{Red, Thick, Circle @@ # & /@ circle}]]

but get unsatisfactory result:

tumor detection

i try to identify tumor like this but selection was noisy:

SelectComponents[
  DeleteBorderComponents[ Binarize[ tom1, {0.75, 1}]], 
  {"Area", "Holes"}, 2800 < #1 < 2900 && #2 > 0 &]

tumor

So, can you help me to make clearer allocation of the tumor and then calculate the area of ​​selection?

$\endgroup$
1
  • $\begingroup$ If this is a tomogram wouldn't it be better to measure the tumor volume in 3D instead of the area of a single slice? $\endgroup$
    – s0rce
    Mar 26, 2014 at 20:30

1 Answer 1

14
$\begingroup$

Your approach is quite good. I would smooth the data a bit and do an Opening to cut one extra part:

tom1 = Import["https://i.stack.imgur.com/mZ4fR.jpg"];
smooth = GaussianFilter[tom1, 2];
tumor = SelectComponents[
  DeleteBorderComponents[
   Opening[Binarize[smooth, {0.8, 1}], 1]], {"Area", "Holes"}, 
  2000 < #1 < 2200 &];

HighlightImage[tom1, tumor]

Mathematica graphics

And for the second part of your question, you can then use, as pointed out by bobthechemist

ComponentMeasurements[tumor, "Area"]
(* {1 -> 2062.} *)
$\endgroup$
2
  • $\begingroup$ +1. Should you include something like ComponentMeasurements[tumor, "Area"] to answer the 2nd part of the question? $\endgroup$ Mar 26, 2014 at 20:06
  • $\begingroup$ @bobthechemist I have missed this completely. Thanks. $\endgroup$
    – halirutan
    Mar 26, 2014 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.