title: Best Way to Segment Lung Nodules in Matlab
body: <p>I am working with images processing in Matlab.  I am trying to segment out only malignant (cancerous) lung nodules. Initially I managed to segment out Lung and all possible nodules. </p>
  
  <p><img src="https://i.stack.imgur.com/QiEwS.png" alt="enter image description here"></p>
  
  <p>I have used following Matlab code:</p>
  
  <pre><code>segM = % Segmented Lung 
  % Segment nodules
  BW = im2bw(segM, 0.55);
  </code></pre>
  
  <p>Now, I want to apply some filter that will filter all benign (noncancerous) nodules. I am looking for solution from long time but I haven’t found any way to continue it.</p>
  
  <p>Here is the segmented Lung:</p>
  
  <p><img src="https://i.stack.imgur.com/lfik3.png" alt="enter image description here"></p>
  
  <p><strong>Update:</strong></p>
  
  <p>Consider the nodule size greater than 3mm is malignant (cancerous). How to calculate the size in mm from the image?</p>