Home > vis > vis_detection_analysis.m

vis_detection_analysis

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 
0003 load _param/_detectionAnalysis
0004 load _param/_negativeTempDiff
0005 P = initParam('wbc');
0006 
0007 %% Calculate displacement matrix
0008 load _param/_report
0009 displaceMatrix = zeros(0,3);
0010 for se = 1: 6
0011     idVector = unique(SS(se).GT.tracks(:,1));
0012     for tr = 1: length(idVector)
0013         id = idVector(tr);
0014         track = SS(se).GT.tracks(SS(se).GT.tracks(:,1)==id,:);
0015 
0016         ptStart = track(1,3:4);
0017         ptEnd   = track(end,3:4);
0018         v= [(ptEnd(1) - ptStart(1)) (ptEnd(2) - ptStart(2)) ];
0019         displacement = norm(v);
0020         displaceMatrix(end+1,:) = [se id displacement];
0021     end
0022 end
0023 displaceMatrix(91:98,:)=[];
0024 displaceMatrix(104,:)=[];
0025 test = displaceMatrix(:,2) == tracksMatrix(:,2);
0026 if sum(test)==length(test)    
0027    displaceMatrixLite = repmat(displaceMatrix(:,3),1,47);     
0028 end
0029 
0030 %% Post processing
0031 speedsMatrixLite = speedsMatrix(:,4:end);
0032 tracksMatrixLite = tracksMatrix(:,4:end);
0033 radialMatrixLite = radialMatrix(:,4:end);
0034 temporMatrixLite = temporMatrix(:,4:end);
0035 % Avoid 0 speed to be confused when multiple fnCountMatrix
0036 speedsMatrixLite = speedsMatrixLite+ 1;
0037 
0038 
0039 
0040 %% Filter FN
0041 fnCountMatrix = tracksMatrixLite==2;
0042 
0043 fnSpeedsMatrix = speedsMatrixLite.*fnCountMatrix;
0044 fnRadialMatrix = radialMatrixLite.*fnCountMatrix;
0045 fnTemporMatrix = temporMatrixLite.*fnCountMatrix;
0046 % fnSpeedMatrix(fnSpeedMatrix == 0) = 50;
0047 % speedsMatrixLite(isnan(speedsMatrixLite))= 50;
0048 fnDisplaMatrix = displaceMatrixLite.*fnCountMatrix;
0049 
0050 
0051 
0052 
0053 
0054 %% Filter TP
0055 tpCountMatrix = tracksMatrixLite==1;
0056 tpRadialMatrix = radialMatrixLite.*tpCountMatrix;
0057 tpSpeedsMatrix = speedsMatrixLite.*tpCountMatrix;
0058 tpTemporMatrix = temporMatrixLite.*tpCountMatrix; 
0059 tpDisplaMatrix = displaceMatrixLite.*tpCountMatrix;
0060 
0061 
0062 %% Distribution
0063 fnTrackDist = distribution(fnRadialMatrix);
0064 fnSpeedDist = distribution(fnSpeedsMatrix);
0065 fnDisplDist = distribution(fnDisplaMatrix);
0066 
0067 tpTrackDist = distribution(tpRadialMatrix);
0068 tpSpeedDist = distribution(tpSpeedsMatrix);
0069 tpDisplDist = distribution(tpDisplaMatrix);
0070 
0071 
0072 %% Display figures
0073 % figure, imagesc(fnSpeedMatrix');
0074 % figure, imagesc((~fnCountMatrix)');
0075 %
0076 % figure, imagesc(speedsMatrixLite');
0077 
0078 % C = colormap('jet');
0079 
0080 % figure, imagesc(radialMatrixLite'); colormap(C);
0081 % figure, imagesc(fnRadialMatrix');
0082 % Plot all radial mean distribution
0083 figure, errorbar(fnTrackDist(:,1),fnTrackDist(:,2),'.r');
0084 hold on; errorbar(tpTrackDist(:,1),tpTrackDist(:,2),'.g');
0085 title('Radial Mean Score Distribution');
0086 xlabel('Cell track','Fontsize',12);
0087 ylabel('Radial Mean Score','Fontsize',12);
0088 legend('False Negatives','True Positives','Fontsize',20);
0089 line([-50 250],[P.THR_RM P.THR_RM],'Color','b');
0090 text(-50 ,P.THR_RM,'Threshold line','Color','b','Fontsize',20);
0091 
0092 %% Plot all speed distribution
0093 figure, plot(tpSpeedDist(:,1),'.g');
0094 hold on; plot(fnSpeedDist(:,1),'.r');
0095 title('Mean Speed of GT cells','Fontsize',15);
0096 xlabel('Cell track','Fontsize',15);
0097 ylabel('Mean Speed','Fontsize',15);
0098 legend('True Positives','False Negatives','Fontsize',20);
0099 
0100 %% Plot all displacement distribution
0101 figure, plot(tpDisplDist(:,1),'.g');
0102 hold on; plot(fnDisplDist(:,1),'.r');
0103 
0104 title('Displacement of GT cells','Fontsize',15);
0105 xlabel('Cell track','Fontsize',15);
0106 ylabel('Displacement','Fontsize',15);
0107 legend('True Positives','False Negatives','Fontsize',20);
0108 
0109 %% Plot mean speed vs. rm score
0110 figure, hold on; 
0111 
0112 for tr = 1: size(tracksMatrix,1)
0113     plot(tpRadialMatrix(tr,:),tpSpeedsMatrix(tr,:),'.g');
0114     plot(fnRadialMatrix(tr,:),fnSpeedsMatrix(tr,:),'.r');
0115 end
0116 
0117 title('Radial Mean vs. Mean Speed','Fontsize',15);
0118 xlabel('Radial Mean Score','Fontsize',15);
0119 ylabel('Mean Speed','Fontsize',15);
0120 legend('True Positives','False Negatives');
0121 
0122 %% Plot FN mean speed vs. td score
0123 figure, hold on;
0124 for tr = 1: size(tracksMatrix,1)
0125     plot(fnSpeedsMatrix(tr,:),fnTemporMatrix(tr,:),'.r');
0126 end
0127 grid on;
0128 title('Temporal Difference vs. Mean Speed','Fontsize',15);
0129 xlabel('Mean Speed','Fontsize',15);
0130 ylabel('Temporal Difference','Fontsize',15);
0131 legend('False Negatives');
0132 
0133 %% Plot TP mean speed vs. td score
0134 figure, hold on;
0135 for tr = 1: size(tracksMatrix,1)
0136     plot(tpSpeedsMatrix(tr,:),tpTemporMatrix(tr,:),'.r');
0137 end
0138 grid on;
0139 title('Temporal Difference vs. Mean Speed','Fontsize',15);
0140 xlabel('Mean Speed','Fontsize',15);
0141 ylabel('Temporal Difference','Fontsize',15);
0142 legend('True Positives');
0143 
0144 %% Plot FN mean speed vs. td score
0145 figure, hold on;
0146 for tr = 1: size(tracksMatrix,1)
0147     plot(fnRadialMatrix(tr,:),fnTemporMatrix(tr,:),'.r');
0148 end
0149 grid on;
0150 title('Temporal Difference vs. RadialMean','Fontsize',15);
0151 xlabel('Radial Mean','Fontsize',15);
0152 ylabel('Temporal Difference','Fontsize',15);
0153 legend('False Negatives');
0154 
0155 %% Plot FN tempdiff and negative tempdiff
0156 figure, hold on;
0157 
0158 
0159 for tr = 1: size(tracksMatrix,1)
0160     plot(fnTemporMatrix(tr,:),'.r');
0161 end
0162 plot(tempDiff(:,end),'.b');
0163 grid on;
0164 title('False Negatives vs. Negatives','Fontsize',15);
0165 xlabel('Samples','Fontsize',15);
0166 ylabel('Temporal Difference','Fontsize',15);
0167 legend('False Negatives','Negatives');
0168

Generated on Thu 17-Mar-2011 14:45:51 by m2html © 2005