-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[format] automatic format all matlab script with miss_hit
- Loading branch information
Showing
78 changed files
with
3,665 additions
and
3,598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
project_root | ||
|
||
suppress_rule: "redundant_brackets" | ||
suppress_rule: "line_length" | ||
suppress_rule: "file_length" | ||
suppress_rule: "copyright_notice" | ||
suppress_rule: "naming_functions" | ||
suppress_rule: "naming_parameters" | ||
suppress_rule: "naming_scripts" | ||
suppress_rule: "unicode" | ||
indent_function_file_body: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
fid=fopen('mtest.mask','rb'); | ||
dat=fread(fid,inf,'uchar'); | ||
fid = fopen('mtest.mask', 'rb'); | ||
dat = fread(fid, inf, 'uchar'); | ||
fclose(fid); | ||
|
||
dat=reshape(dat,[8 8 8]); | ||
pcolor(dat(:,:,1)') | ||
dat = reshape(dat, [8 8 8]); | ||
pcolor(dat(:, :, 1)'); | ||
|
||
r=3; | ||
s=0:pi/20:2*pi; | ||
c0=[4.9,4.1]; | ||
x=c0(1)+r*cos(s); | ||
y=c0(2)+r*sin(s); | ||
|
||
hold on | ||
plot(x,y,'y-'); | ||
r = 3; | ||
s = 0:pi / 20:2 * pi; | ||
c0 = [4.9, 4.1]; | ||
x = c0(1) + r * cos(s); | ||
y = c0(2) + r * sin(s); | ||
|
||
hold on; | ||
plot(x, y, 'y-'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
dat=loadjson('multipattern.jnii',[3 60 60 60]); | ||
dat = loadjson('multipattern.jnii', [3 60 60 60]); | ||
figure; | ||
subplot(131); | ||
imagesc(squeeze(log10(abs(dat(1,:,:,10))))') | ||
axis equal | ||
imagesc(squeeze(log10(abs(dat(1, :, :, 10))))'); | ||
axis equal; | ||
subplot(132); | ||
imagesc(squeeze(log10(abs(dat(2,:,:,10))))') | ||
axis equal | ||
imagesc(squeeze(log10(abs(dat(2, :, :, 10))))'); | ||
axis equal; | ||
subplot(133); | ||
imagesc(squeeze(log10(abs(dat(3,:,:,10))))') | ||
axis equal | ||
imagesc(squeeze(log10(abs(dat(3, :, :, 10))))'); | ||
axis equal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
fid=fopen('jsonshape.mask','rb'); | ||
dat=fread(fid,inf,'uchar'); | ||
fid = fopen('jsonshape.mask', 'rb'); | ||
dat = fread(fid, inf, 'uchar'); | ||
fclose(fid); | ||
|
||
dat=reshape(dat,[40 60 50]); | ||
dat = reshape(dat, [40 60 50]); | ||
figure; | ||
imagesc(squeeze(dat(:,:,15))); | ||
axis equal | ||
|
||
imagesc(squeeze(dat(:, :, 15))); | ||
axis equal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,55 @@ | ||
%%----------------------------------------------------------------- | ||
%% ----------------------------------------------------------------- | ||
%% add paths to the necessary toolboxes | ||
%%----------------------------------------------------------------- | ||
%% ----------------------------------------------------------------- | ||
|
||
addpath('~/space/Projects/mcx/utils/') | ||
addpath('~/space/Projects/mmc/matlab/') | ||
addpath('~/space/Projects/mcx/utils/'); | ||
addpath('~/space/Projects/mmc/matlab/'); | ||
|
||
c0=299792458000; | ||
twin=[5e-11:1e-10:5e-9]; | ||
gates=50; | ||
clines=[-1:0.5:8]; | ||
c0 = 299792458000; | ||
twin = [5e-11:1e-10:5e-9]; | ||
gates = 50; | ||
clines = [-1:0.5:8]; | ||
|
||
%%----------------------------------------------------------------- | ||
%% ----------------------------------------------------------------- | ||
%% load MCX results | ||
%%----------------------------------------------------------------- | ||
mcx=loadmc2('spherebox.mc2', [60 60 60 gates]); | ||
cwmcx=sum(mcx,4); | ||
%% ----------------------------------------------------------------- | ||
mcx = loadmc2('spherebox.mc2', [60 60 60 gates]); | ||
cwmcx = sum(mcx, 4); | ||
|
||
%%----------------------------------------------------------------- | ||
%% ----------------------------------------------------------------- | ||
%% generate/load analytical solution for sphere inside infinite slab | ||
%%----------------------------------------------------------------- | ||
%% ----------------------------------------------------------------- | ||
|
||
%[phi_ana,xa,ya,za]=sphdiffusionslab(0,0,60,-22:0.8:22,0,-30:0.8:10); | ||
%save sphdiffsemiinf.mat phi_ana xa ya za | ||
% [phi_ana,xa,ya,za]=sphdiffusionslab(0,0,60,-22:0.8:22,0,-30:0.8:10); | ||
% save sphdiffsemiinf.mat phi_ana xa ya za | ||
|
||
load sphdiffsemiinf.mat | ||
idx=find((xa(:)<-12 | xa(:)>12) & za(:)>-5); | ||
phi_ana(idx)=nan; | ||
idx=find((xa(:)<-10 | xa(:)>10) & za(:)>0); | ||
phi_ana(idx)=nan; | ||
load sphdiffsemiinf.mat; | ||
idx = find((xa(:) < -12 | xa(:) > 12) & za(:) > -5); | ||
phi_ana(idx) = nan; | ||
idx = find((xa(:) < -10 | xa(:) > 10) & za(:) > 0); | ||
phi_ana(idx) = nan; | ||
|
||
%%----------------------------------------------------------------- | ||
%% ----------------------------------------------------------------- | ||
%% generate the contour of the inclusion | ||
%%----------------------------------------------------------------- | ||
|
||
[xcirc,ycirc] = cylinder(10,200); | ||
xcirc=xcirc(1,:)+30; | ||
ycirc=ycirc(1,:)+30; | ||
|
||
figure | ||
hold on | ||
[cc,hc]=contour(xa+30,za+31,log10(abs(phi_ana))+10,clines,'color',[0.7 0.7 0.7],'linewidth',2); | ||
contour(log10(squeeze(abs(cwmcx(:,30,:)))'),clines,'b-') | ||
plot(xcirc,ycirc,'k--','linewidth',2); | ||
|
||
axis equal | ||
set(gca,'xlim',[1 60]); | ||
set(gca,'ylim',[1 60]); | ||
set(gca,'fontsize',18) | ||
xlabel('x (mm)') | ||
ylabel('z (mm)') | ||
legend('Diffusion','MCX') | ||
%% ----------------------------------------------------------------- | ||
|
||
[xcirc, ycirc] = cylinder(10, 200); | ||
xcirc = xcirc(1, :) + 30; | ||
ycirc = ycirc(1, :) + 30; | ||
|
||
figure; | ||
hold on; | ||
[cc, hc] = contour(xa + 30, za + 31, log10(abs(phi_ana)) + 10, clines, 'color', [0.7 0.7 0.7], 'linewidth', 2); | ||
contour(log10(squeeze(abs(cwmcx(:, 30, :)))'), clines, 'b-'); | ||
plot(xcirc, ycirc, 'k--', 'linewidth', 2); | ||
|
||
axis equal; | ||
set(gca, 'xlim', [1 60]); | ||
set(gca, 'ylim', [1 60]); | ||
set(gca, 'fontsize', 18); | ||
xlabel('x (mm)'); | ||
ylabel('z (mm)'); | ||
legend('Diffusion', 'MCX'); | ||
legend boxoff; | ||
box on; | ||
set(gcf,'PaperPositionMode','auto'); | ||
|
||
set(gcf, 'PaperPositionMode', 'auto'); |
Oops, something went wrong.