Skip to content

Commit

Permalink
Add new file and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
zclhit committed Jul 20, 2016
1 parent e387dee commit 583ad06
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
44 changes: 44 additions & 0 deletions ImgROIselection.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
%Name:ImgROIselection
%Function:将img文件读取并转换为一列扫描格式的txt文件(用于unity输入)
%Author:Changle Zhang, [email protected]
clc;clear all;close all;
cd ('D:\temp_store');
[hdr,filetype,fileprefix,machine] = load_nii_hdr('co20120918_15434810277192s002a1001_7Labels_MNI.hdr');
[img,hdr] = load_nii_img(hdr,filetype,fileprefix,machine);

%pic=double(img(:,:,60));
%imshow(pic,[0 255]);
%savemat=zeros(1,216*256);
%counter=1;
for label=1:7
sizex=length(find(img==label));
savemat=zeros(sizex,3); %存储信息用的表
flag=1;
for i=1:181
for j=1:217
for k=1:181
if img(i,j,k)==label
savemat(flag,1)=i;
savemat(flag,2)=j;
savemat(flag,3)=k;
flag=flag+1;
end
end
end
end
% savenamex=[int2str(label) 'x.txt']; %保存使用的文件名
% savenamey=[int2str(label) 'y.txt']; %保存使用的文件名
% savenamez=[int2str(label) 'z.txt']; %保存使用的文件名
% savematx=savemat(:,1);
% savematy=savemat(:,2);
% savematz=savemat(:,3);
% save (savenamex,'savematx','-ascii');
% save (savenamey,'savematy','-ascii');
% save (savenamez,'savematz','-ascii');
% clear savematx;
% clear savematy;
% clear savematz;
savename=[int2str(label) '.txt'];
save (savename,'savemat','-ascii');
clear savemat;
end
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ Sorting the standard space output files of PANDA software.
Change the information of ROIs in JHU T1 286 images into level3, which compact them into 52 regions and other named 'xxxxx' regions with 0 value in the lookup table.

15.ppg_peakdetect.m
PPGsorting programme of GongPing
PPGsorting programme of GongPing

16.ImgROIselection.m
Select all the ROIs in segmented T1 image and save their location (x,y,z) in txt files.

0 comments on commit 583ad06

Please sign in to comment.