0

每当我在彩色 mri 上运行 fcm 以将其分割成簇时,它总是为每列中的同一索引提供 0.95 所有权

%img is a pre read image file I use jpg and k is number of clusters
function findTumor(img,k)
    file=double(img);
    output = img;
    [nrow ncol noneed]=size(file);
    file=reshape(file,nrow*ncol,3);
    [c,idx]=fcm(file,k);
    % taking the max ownerhip would make this the same as normal k means
    %[c,idx] = max(idx,[],1);
    %file=reshape(idx,nrow,ncol);
    idx
    for p = 1:k
       for i = 1:nrow
          for j= 1:ncol

             if idx(p,(nrow*ncol)) < .7
                output(i,j,:)= 0;
             end
          end
      end

    figure, imshow(uint8(round(output)));


    output=img;
  end

end

这张图片是我的 idx 样本,显示了索引 3 总是像 0.99 一样拥有所有权 样本 FCM idx 输出

4

0 回答 0