Last change
on this file since 45 was
40,
checked in by dtax, 12 years ago
|
HEp 2 cell classification, ICPR 2012 competition
|
File size:
1.4 KB
|
Rev | Line | |
---|
[40] | 1 | % generate a simple dataset for the cell images |
---|
| 2 | %clear all; load cells_gabor; |
---|
| 3 | |
---|
| 4 | %dtype = 'max'; |
---|
| 5 | dtype = 'nothing'; |
---|
| 6 | |
---|
| 7 | N = size(x,1); |
---|
| 8 | if ndims(x{1,1})<3 |
---|
| 9 | dim = size(x{1,1},2); |
---|
| 10 | else |
---|
| 11 | dim = size(x{1,1},3); |
---|
| 12 | end |
---|
| 13 | feat = zeros(N,dim); |
---|
| 14 | imlab = zeros(N,1); |
---|
| 15 | for i=1:N |
---|
| 16 | i |
---|
| 17 | if strcmp(dtype,'nothing') |
---|
| 18 | feat(i,:) = x{i,:}; |
---|
| 19 | else |
---|
| 20 | for j=1:dim |
---|
| 21 | gim = x{i,1}(:,:,j); |
---|
| 22 | gim = gim(find(x{i,2})); |
---|
| 23 | switch dtype |
---|
| 24 | case 'max' |
---|
| 25 | feat(i,j) = max(gim); |
---|
| 26 | case 'mean' |
---|
| 27 | feat(i,j) = mean(abs(gim)); |
---|
| 28 | case 'var' |
---|
| 29 | feat(i,j) = var(gim); |
---|
| 30 | end |
---|
| 31 | end |
---|
| 32 | end |
---|
| 33 | xlab(i,:) = x{i,4}; |
---|
| 34 | imlab(i,1) = x{i,3}; |
---|
| 35 | end |
---|
| 36 | a = dataset(feat,xlab); |
---|
| 37 | a = setident(a,imlab,'image'); |
---|
| 38 | M = size(z,1); |
---|
| 39 | feat = zeros(M,dim); |
---|
| 40 | imlab = zeros(M,1); |
---|
| 41 | for i=1:M |
---|
| 42 | i |
---|
| 43 | if strcmp(dtype,'nothing') |
---|
| 44 | feat(i,:) = z{i,:}; |
---|
| 45 | else |
---|
| 46 | for j=1:dim |
---|
| 47 | gim = z{i,1}(:,:,j); |
---|
| 48 | gim = gim(find(z{i,2})); |
---|
| 49 | switch dtype |
---|
| 50 | case 'max' |
---|
| 51 | feat(i,j) = max(gim); |
---|
| 52 | case 'mean' |
---|
| 53 | feat(i,j) = mean(abs(gim)); |
---|
| 54 | case 'var' |
---|
| 55 | feat(i,j) = var(gim); |
---|
| 56 | end |
---|
| 57 | end |
---|
| 58 | end |
---|
| 59 | zlab(i,:) = z{i,4}; |
---|
| 60 | imlab(i,1) = z{i,3}; |
---|
| 61 | end |
---|
| 62 | b = dataset(feat,zlab); |
---|
| 63 | b = setident(b,imlab,'image'); |
---|
| 64 | |
---|
| 65 | switch dtype |
---|
| 66 | case 'max' |
---|
| 67 | save cellssimplemax a b; |
---|
| 68 | case 'mean' |
---|
| 69 | save cellssimplemean a b; |
---|
| 70 | case 'var' |
---|
| 71 | save cellssimplevar a b; |
---|
| 72 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.