From 2ca1c05ce7fda98336f241a4c71708871060f532 Mon Sep 17 00:00:00 2001
From: la_29 <la538@drexel.edu>
Date: Fri, 10 Jan 2025 11:35:56 -0500
Subject: [PATCH] non-emtpy files

---
 src/MATLAB/ssf_vs_cn/goFigure3-C.m    | 66 ++++++++++++++++++++++++++
 src/MATLAB/ssf_vs_cn/goPhantomImage.m | 67 +++++++++++++++++++++++++++
 2 files changed, 133 insertions(+)

diff --git a/src/MATLAB/ssf_vs_cn/goFigure3-C.m b/src/MATLAB/ssf_vs_cn/goFigure3-C.m
index e69de29..7fb9db1 100644
--- a/src/MATLAB/ssf_vs_cn/goFigure3-C.m
+++ b/src/MATLAB/ssf_vs_cn/goFigure3-C.m
@@ -0,0 +1,66 @@
+
+cnRatios = zeros(9,100);
+ssfVals = zeros(9,100);
+
+% i = 9;
+
+for i = 1:10
+    for j = 1:100
+        
+%         [cnRatio,ssfVal] = ssfPhantom(i/10);
+        [cnRatio,ssfVal] = ssfPhantom((i-1)/10);
+        
+        cnRatios(i,j) = cnRatio;
+        ssfVals(i,j) = ssfVal;
+        
+    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);
+
+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(ms,ss/(2*sqrt(size(ssfVals,2))),'color',[0.4660 0.6740 0.1880])
+% 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')
+set(gcf,'color','white')
+ylim([0 5])
+
+f = getframe(gcf);
+
+cap = frame2im(f);
+outName = 'phantomLinear.tif';
+outRoot = 'F:\leverjs\agne\images\ssfFigures';
+
+outFile = fullfile(outRoot,outName);
+imwrite(cap,outFile);
+
+
+4;
\ No newline at end of file
diff --git a/src/MATLAB/ssf_vs_cn/goPhantomImage.m b/src/MATLAB/ssf_vs_cn/goPhantomImage.m
index e69de29..373b132 100644
--- a/src/MATLAB/ssf_vs_cn/goPhantomImage.m
+++ b/src/MATLAB/ssf_vs_cn/goPhantomImage.m
@@ -0,0 +1,67 @@
+wl = 200;
+
+imRef = zeros(wl,wl);
+
+xc = wl/2;
+yc = wl/2;
+
+r = wl/10;
+
+for x = 1:size(imRef,1)
+    for y = 1:size(imRef,2)
+ 
+        d = sqrt((x-xc)^2+(y-yc)^2);
+        if d >= r
+            imRef(x,y) = 1;
+        end
+        
+    end
+end
+
+figure;
+imagesc(imRef);axis square
+colormap gray
+hold on;
+set(gcf,'color','white')
+
+drawCircle(xc,yc,r-3,'m')
+drawCircle(xc,yc,r+3,'b')
+drawCircle(xc,yc,r,'r')
+
+xlim([60 140])
+ylim([60 140])
+
+f = getframe(gcf);
+
+cap = frame2im(f);
+outName = 'phantomReference.tif';
+outRoot = 'F:\leverjs\agne\images\ssfFigures';
+
+outFile = fullfile(outRoot,outName);
+% imwrite(cap,outFile);
+
+imNoise = imnoise(imRef,'salt & pepper',0.4);
+
+figure;
+imagesc(imNoise);axis square
+colormap gray
+hold on;
+set(gcf,'color','white')
+
+drawCircle(xc,yc,r-3,'m')
+drawCircle(xc,yc,r+3,'b')
+drawCircle(xc,yc,r,'r')
+
+xlim([60 140])
+ylim([60 140])
+
+f = getframe(gcf);
+
+cap = frame2im(f);
+outName = 'phantomNoise.tif';
+outRoot = 'F:\leverjs\agne\images\ssfFigures';
+
+outFile = fullfile(outRoot,outName);
+% imwrite(cap,outFile);
+
+4;
\ No newline at end of file
-- 
GitLab