diff --git a/readme.md b/readme.md index 73d3cc913d672c5ee9ac0ebe4913748527f00867..a1364b0961aba2359c369743a3adcc29f5f887e1 100644 --- a/readme.md +++ b/readme.md @@ -44,7 +44,7 @@ path(path, 'PATH\hydra-image-processor\src\MATLAB'); # USE To recreate Figure 6: -1. Run phantomVelocitySSF\goFigure.m +1. Run phantomVelocitySSF\genPhantomVelocityFigure.m ## Phantom Velocity SSF Dataset Generation To create a new synethetic dataset: @@ -54,7 +54,7 @@ To create a new synethetic dataset: - phantomVelocity_mu: the different mean velocity values per class i.e., the number of means determines the number of classes. - phantomVelocity_sigma: the standard deviation for velocity per class. - numOutput: how many phantom images to generate per class. -2. Run phantomVelocitySSF\goFigure.m, specifying the saved .mat file as the input. +2. Run phantomVelocitySSF\genPhantomVelocityFigure.m, specifying the saved .mat file as the input. ## Notes 1. The NCD code uses the [FLIF](https://flif.info/) compression library. The thunker file for the FLIF library was generated on Ubuntu 22.04 and **may not work** on other Unix platforms. @@ -62,3 +62,5 @@ This has not been tested. The Windows version works on both Windows 10 and Windows 11. 2. The default settings for phantomVelocitySSF\goSyntheticDataset will create a dataset of 150 phantom velocity SSF images. This can be CPU intensive. For testing purposes it is recommended to lower the number of generated images (numOutput) to 5-10. + +## Phantom SSF diff --git a/src/MATLAB/phantomSSF/genPhantomFigure.asv b/src/MATLAB/phantomSSF/genPhantomFigure.asv new file mode 100644 index 0000000000000000000000000000000000000000..8f6feb3eae1946e926510d4429d34d4f2679d4f4 --- /dev/null +++ b/src/MATLAB/phantomSSF/genPhantomFigure.asv @@ -0,0 +1,72 @@ + +cnRatios = zeros(9,100); +ccnRatios = zeros(9,100); +ssfVals = zeros(9,100); + +% i = 9; + +for i = 1:10 + for j = 1:100 + % [cnRatio,ssfVal] = ssfPhantom(i/10); + % [cnRatio,ccnRatio,ssfVal] = ssfPhantom((i-1)/10); + [cnRatio,ccnRatio,ssfVal] = ssfPhantom + + cnRatios(i,j) = cnRatio; + ssfVals(i,j) = ssfVal; + ccnRatios(i,j) = ccnRatio; + end +end + +4; + +[cnRefVal,ssfRefVal] = ssfPhantom(0); + +mc = mean(cnRatios,2); +sc = std(cnRatios,0,2); +ms = mean(ssfVals,2); +ss = std(ssfVals,0,2); + +mccn = mean(ccnRatios,2); +sccn = std(ccnRatios,0,2); + +msNorm = mean(ssfVals,2)./ssfRefVal; +ssNorm = std(ssfVals./ssfRefVal,0,2); + +% figure('WindowState','maximized'); +figure; + +plot([1:-.1:.1],'color','y','LineWidth',4,'linestyle','-'); hold on; +errorbar(mc,sc/(2*sqrt(size(ssfVals,2))),'color','r') +errorbar(mccn,sccn/(2*sqrt(size(ssfVals,2))),'color',[0.4660 0.6740 0.1880]) +errorbar(ms,ss/(2*sqrt(size(ssfVals,2))),'color','m') +% errorbar(msNorm,ssNorm/(2*sqrt(size(ssfVals,2))),'-ro','color','k','markersize',8,'markerfacecolor','r'); +errorbar(msNorm,ssNorm/(2*sqrt(size(ssfVals,2))),'color','k'); + +for i = 0:9 + l = [num2str(i*10) '%']; + xlab{i+1} = l; +end + +xticklabels(xlab) +% xlabel('Percentage of Noise Applied to Reference Image'); +xlabel('Percentage of signal added to nucleus and cytoplasm'); +ylabel('Cell signal activation') +% set(gca, 'YScale', 'log') + +% legend('GT','Nuclear/Cyto Ratio','LoG','SSF') +% legend('GT','CN_{ratio}','LoG','SSF','\frac{C}{C+N}') +legend('GT','$\frac{C}{N}$','$\frac{C}{C+N}$','LoG','SSF','Interpreter','latex') +set(gcf,'color','white') +ylim([0 5]) + +f = getframe(gcf); + +cap = frame2im(f); +outName = 'phantomLinear.tif'; +outRoot = './'; + +outFile = fullfile(outRoot,outName); +imwrite(cap,outFile); + + +4; \ No newline at end of file diff --git a/src/MATLAB/ssf_vs_cn/goFigure3C.m b/src/MATLAB/phantomSSF/genPhantomFigure.m similarity index 92% rename from src/MATLAB/ssf_vs_cn/goFigure3C.m rename to src/MATLAB/phantomSSF/genPhantomFigure.m index e44eb3b545e2e00da09716f154096fbbbd6434ea..ea0201e01cf5455301bfa89e7d1ac1f643cdd708 100644 --- a/src/MATLAB/ssf_vs_cn/goFigure3C.m +++ b/src/MATLAB/phantomSSF/genPhantomFigure.m @@ -7,10 +7,9 @@ ssfVals = zeros(9,100); for i = 1:10 for j = 1:100 - -% [cnRatio,ssfVal] = ssfPhantom(i/10); - [cnRatio,ccnRatio, ssfVal] = ssfPhantom((i-1)/10); - + % [cnRatio,ssfVal] = ssfPhantom(i/10); + [cnRatio,ccnRatio,ssfVal] = ssfPhantom((i-1)/10); + cnRatios(i,j) = cnRatio; ssfVals(i,j) = ssfVal; ccnRatios(i,j) = ccnRatio; diff --git a/src/MATLAB/ssf_vs_cn/goPhantomImage.m b/src/MATLAB/phantomSSF/goPhantomImage.m similarity index 100% rename from src/MATLAB/ssf_vs_cn/goPhantomImage.m rename to src/MATLAB/phantomSSF/goPhantomImage.m diff --git a/src/MATLAB/ssf_vs_cn/goSSF_CN.m b/src/MATLAB/phantomSSF/goSSF_CN.m similarity index 100% rename from src/MATLAB/ssf_vs_cn/goSSF_CN.m rename to src/MATLAB/phantomSSF/goSSF_CN.m diff --git a/src/MATLAB/ssf_vs_cn/ssfPhantom.m b/src/MATLAB/phantomSSF/ssfPhantom.m similarity index 94% rename from src/MATLAB/ssf_vs_cn/ssfPhantom.m rename to src/MATLAB/phantomSSF/ssfPhantom.m index fbddbe8c8d7f0f1dc001393b30a8779167a4ad67..f41dac56df8aee0cdfc93a84d1d7a95951c55146 100644 --- a/src/MATLAB/ssf_vs_cn/ssfPhantom.m +++ b/src/MATLAB/phantomSSF/ssfPhantom.m @@ -1,4 +1,4 @@ -function [cnRatio,ccnRatio, ssfValue] = ssfPhantom(density) +function [cnRatio,ccnRatio,ssfValue] = ssfPhantom(density) % set width/length of the image wl = 200; diff --git a/src/MATLAB/phantomKymograph/createPhantom.m b/src/MATLAB/phantomVelocitySSF/createPhantom.m similarity index 100% rename from src/MATLAB/phantomKymograph/createPhantom.m rename to src/MATLAB/phantomVelocitySSF/createPhantom.m diff --git a/src/MATLAB/phantomKymograph/createSyntheticDataset.m b/src/MATLAB/phantomVelocitySSF/createSyntheticDataset.m similarity index 100% rename from src/MATLAB/phantomKymograph/createSyntheticDataset.m rename to src/MATLAB/phantomVelocitySSF/createSyntheticDataset.m diff --git a/src/MATLAB/phantomKymograph/drawSyntheticSSF.m b/src/MATLAB/phantomVelocitySSF/drawSyntheticSSF.m similarity index 100% rename from src/MATLAB/phantomKymograph/drawSyntheticSSF.m rename to src/MATLAB/phantomVelocitySSF/drawSyntheticSSF.m diff --git a/src/MATLAB/phantomKymograph/goFigure.m b/src/MATLAB/phantomVelocitySSF/genPhantomVelocityFigure.m similarity index 100% rename from src/MATLAB/phantomKymograph/goFigure.m rename to src/MATLAB/phantomVelocitySSF/genPhantomVelocityFigure.m diff --git a/src/MATLAB/phantomKymograph/getPhantomClipLimits.m b/src/MATLAB/phantomVelocitySSF/getPhantomClipLimits.m similarity index 100% rename from src/MATLAB/phantomKymograph/getPhantomClipLimits.m rename to src/MATLAB/phantomVelocitySSF/getPhantomClipLimits.m diff --git a/src/MATLAB/phantomKymograph/goSyntheticDataset.m b/src/MATLAB/phantomVelocitySSF/goSyntheticDataset.m similarity index 100% rename from src/MATLAB/phantomKymograph/goSyntheticDataset.m rename to src/MATLAB/phantomVelocitySSF/goSyntheticDataset.m diff --git a/src/MATLAB/phantomKymograph/goSyntheticSSF.m b/src/MATLAB/phantomVelocitySSF/goSyntheticSSF.m similarity index 100% rename from src/MATLAB/phantomKymograph/goSyntheticSSF.m rename to src/MATLAB/phantomVelocitySSF/goSyntheticSSF.m diff --git a/src/MATLAB/phantomKymograph/sampleDataset_01.mat b/src/MATLAB/phantomVelocitySSF/sampleDataset_01.mat similarity index 100% rename from src/MATLAB/phantomKymograph/sampleDataset_01.mat rename to src/MATLAB/phantomVelocitySSF/sampleDataset_01.mat diff --git a/src/MATLAB/ssf_vs_cn/phantomLinear.tif b/src/MATLAB/ssf_vs_cn/phantomLinear.tif deleted file mode 100644 index e53eae496b03a35d5f5daf4f62c6e3505acb5285..0000000000000000000000000000000000000000 Binary files a/src/MATLAB/ssf_vs_cn/phantomLinear.tif and /dev/null differ