Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I understand you correctly, you have a binary image of the boundary of the kidney and now need to set the inside of the boundary to 1s. To do this, you can use the <a href="http://www.mathworks.com/help/toolbox/images/ref/imfill.html" rel="nofollow">imfill()</a> function with the 'holes' setting on. </p> <pre><code>BW2 = imfill(BW,'holes'); </code></pre> <p>EDIT: Looking at the code, it seems that it does what you want already. </p> <pre><code>% Outputs: % J: Binary mask (with the same size as the input image) indicating % 1 (true) for associated pixel/voxel and 0 (false) for outside </code></pre> <p>so you just need to get the second output as well:</p> <pre><code> IR=imread('nfliver5.jpg'); figure, imshow(IR), hold all [poly im] = regionGrowing(IR,[],15,1200); % click somewhere inside the liver imshow(im,[]) </code></pre> <p>Now <code>im</code> is a binary image with your segmented region. </p> <p>EDIT2: </p> <p>Once you have the binary image <code>im</code>, you can simply use element-wise multiplication to remove all parts of the orignal image outside the segmented region.</p> <pre><code>SEG = IR.*im; imshow(SEG,[]) </code></pre> <p>EDIT3:</p> <p>For 3D images, you need to specify the coordinates manually, and not by using the mouse. This is because the mouse only gives us 2 coordinates (x and y) and you need 3 (x,y and z). So just find the coordinates you need by looking at the image, and then choosing an appropriate z coordinate.</p> <pre><code>%Example coordinates, coordinates = [100 100 5] poly = regionGrowing(squeeze(IR), coordinates, 60, Inf, [], true, false); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload