微细胞计数


Matlab 实现的可用于细胞计数的程序
资源截图
代码片段和文件信息
%a Learning To Count example for cell microscopy images 
%generated with SIMCEP tool (http://www.cs.tut.fi/sgn/csb/simcep/tool.html)
%see the data/ folder
%
%Code copyright: Victor Lempitsky 2011

clear all;
disp(‘LEARNING TO COUNT CELLS IN MICROSCOPY IMAGES‘);
disp(‘----------‘);

disp(‘Loading pre-trained SIFT codebook...‘);
load(‘dictionary256.mat‘‘Dict‘); 

features = cell(321);
weights = cell(321);
gtDensities = cell(321);

if ~exist(‘vl_dsift‘)
    error(‘Please install VLFeat toolbox (http://www.vlfeat.org/) to run this example.‘)
end

disp(‘----------‘);

if exist(‘features_CELL_IMAGES.mat‘)
    disp(‘Loading features precomputed at previous run‘);
    load(‘features_CELL_IMAGES.mat‘‘features‘‘weights‘‘gtDensities‘);
else
    for j=1:32
        disp([‘Processing image #‘ num2str(j) ‘ (out of 32)...‘]);
        im = imread([‘data/‘ num2str(j ‘%03d‘) ‘cell.png‘]);
        im = im(::3); %using the blue channel to compute data

        disp(‘Computing dense SIFT...‘);
        [f d] = vl_dsift(single(im)); %computing the dense sift descriptors centered at each pixel
        %estimating the crop parameters where SIFTs were not computed:
        minf = floor(min(f[]2));
        maxf = floor(max(f[]2));
        minx = minf(2);
        miny = minf(1);
        maxx = maxf(2);
        maxy = maxf(1);   

        %simple quantized dense SIFT each image is encoded as MxNx1 numbers of
        %dictionary entries numbers with weight 1 (see the NIPS paper):
        disp(‘Quantizing SIFTs...‘);
        features{j} = vl_ikmeanspush(uint8(d)Dict);
        features{j} = reshape(features{j} maxy-miny+1 maxx-minx+1);
        weights{j} = ones(size(features{j}));    

        %computing ground truth densities:
        gtDensities{j} = imread([‘data/‘ num2str(j‘%03d‘) ‘dots.png‘]);
        gtDensities{j} = double(gtDensities{j}(::1))/255;
        %the following line may be commented out:
        gtDensities{j} = imfilter(gtDensities{j} fspecial(‘gaussian‘ 4.0*6 4.0));  
        gtDensities{j} = gtDensities{j}(miny:maxyminx:maxx); %cropping GT densities to match the window where features are computable
        disp(‘----------‘);
    end
    save(‘features_CELL_IMAGES.mat‘‘features‘‘weights‘‘gtDensities‘);
end

disp(‘Mexifying MaxSubarray procedure‘);
mex maxsubarray2D.cpp

nTrain = 16;
trainFeatures = features(1:nTrain);
trainWeights = weights(1:nTrain);
trainGtDensities = gtDensities(1:nTrain);

disp(‘Now using the first 16 images to train the model.‘);
nFeatures = 256;
maxIter = 100;
verbose = true;
weightMap = ones([size(features{1}1) size(features{1}2)]);

disp(‘--------------‘);
disp(‘Training the model with L1 regularization:‘);
disp(‘--------------‘);
wL1 = LearnToCount(nFeatures trainFeatures trainWeights ...
        weightMap trainGtDensities -0.1/nTrain maxIter verbose);

disp(‘--------------‘);
disp(‘Training the model with Tikhonov r

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        4154  2011-02-20 22:05  CellCountingExample.m
     目录           0  2011-02-18 11:37  data
     文件       79159  2010-05-06 17:05  data01cell.png
     文件         673  2010-05-06 17:05  data01dots.png
     文件       83138  2010-05-06 17:05  data02cell.png
     文件         919  2010-05-06 17:05  data02dots.png
     文件       75010  2010-05-06 17:06  data03cell.png
     文件         528  2010-05-06 17:06  data03dots.png
     文件       74589  2010-05-06 17:06  data04cell.png
     文件         539  2010-05-06 17:06  data04dots.png
     文件       76450  2010-05-06 17:06  data05cell.png
     文件         569  2010-05-06 17:06  data05dots.png
     文件       80109  2010-05-06 17:06  data06cell.png
     文件         691  2010-05-06 17:06  data06dots.png
     文件       81623  2010-05-06 17:06  data07cell.png
     文件         752  2010-05-06 17:06  data07dots.png
     文件       78156  2010-05-06 17:06  data08cell.png
     文件         632  2010-05-06 17:06  data08dots.png
     文件       80962  2010-05-06 17:07  data09cell.png
     文件         749  2010-05-06 17:07  data09dots.png
     文件       77619  2010-05-06 17:07  data10cell.png
     文件         610  2010-05-06 17:07  data10dots.png
     文件       78373  2010-05-06 17:07  data11cell.png
     文件         621  2010-05-06 17:07  data11dots.png
     文件       85281  2010-05-06 17:08  data12cell.png
     文件        1088  2010-05-06 17:08  data12dots.png
     文件       74167  2010-05-06 17:08  data13cell.png
     文件         521  2010-05-06 17:08  data13dots.png
     文件       79442  2010-05-06 17:08  data14cell.png
     文件         696  2010-05-06 17:08  data14dots.png
     文件       79879  2010-05-06 17:08  data15cell.png
............此处省略39个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)