Skip to content

Commit

Permalink
Adjust aidaconnect t2w scripts to BIDS
Browse files Browse the repository at this point in the history
  • Loading branch information
mschneider1711 committed Feb 15, 2024
1 parent 01a74e9 commit 73ba807
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions T2/T2w_Processing/getMergedT2_data.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ function getMergedT2_data(t2Struct)
continue
end

infoT2 =struct();
namesOfMat = cell(length(all_mat_files),1);
lesionSize_mm = zeros(length(all_mat_files),1);
lesionSize_percent = zeros(length(all_mat_files),1);
affectedRegions_percent = zeros(length(all_mat_files),numOfRegions);

for i = 1:length(all_mat_files)
matFile_cur = all_mat_files{i};

infoT2 =struct();
namesOfMat = cell(length(all_mat_files),1);
lesionSize_mm = zeros(length(all_mat_files),1);
lesionSize_percent = zeros(length(all_mat_files),1);
affectedRegions_percent = zeros(length(all_mat_files),numOfRegions);


tempName = split(all_mat_files{i}.folder,filesep);
tempName = tempName(end-2:end-1);
tempName = strjoin(tempName,"_");
Expand All @@ -63,7 +63,7 @@ function getMergedT2_data(t2Struct)
lesionSize_percent(i) = curMatFile.volumePer;

end
if length(matFile_cur)>1
if length(all_mat_files)>=1
infoT2.group = groups(g);
infoT2.day = days(d);
infoT2.names = namesOfMat;
Expand All @@ -76,11 +76,12 @@ function getMergedT2_data(t2Struct)
if ~exist(targetPath,'dir')
mkdir(targetPath);
end
disp(strcat(targetPath,filesep,days(d),'.mat'))
disp(strcat(targetPath,filesep,days(d),groups(g),'.mat'))
disp(infoT2.names)
save(strcat(targetPath,filesep,days(d),'.mat'),'infoT2')
save(strcat(targetPath,filesep,days(d),groups(g),'.mat'),'infoT2')
end
end

end


Expand Down

0 comments on commit 73ba807

Please sign in to comment.