Skip to content

Commit

Permalink
save_nii
Browse files Browse the repository at this point in the history
  • Loading branch information
scott committed May 5, 2017
1 parent ce40224 commit 07c0801
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions svca4_calculate.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@

fname = sprintf('%s/weights/%s_GRAY_it%.2d.nii', svca4.outputPath, svca4.Names{targetID}, ifeedback);
OUT_struct.img = single(GRAY);
save_untouch_nii(OUT_struct, fname);
save_nii(OUT_struct, fname);

fname = sprintf('%s/weights/%s_WHITE_it%.2d.nii', svca4.outputPath, svca4.Names{targetID}, ifeedback);
OUT_struct.img = single(WHITE);
save_untouch_nii(OUT_struct, fname);
save_nii(OUT_struct, fname);

fname = sprintf('%s/weights/%s_BLOOD_it%.2d.nii', svca4.outputPath, svca4.Names{targetID}, ifeedback);
OUT_struct.img = single(BLOOD);
save_untouch_nii(OUT_struct, fname);
save_nii(OUT_struct, fname);

fname = sprintf('%s/weights/%s_TSPO_it%.2d.nii', svca4.outputPath, svca4.Names{targetID}, ifeedback);
OUT_struct.img = single(TSPO);
save_untouch_nii(OUT_struct, fname);
save_nii(OUT_struct, fname);

clear CLASS

Expand Down
8 changes: 4 additions & 4 deletions svca4_iterateGui.m
Original file line number Diff line number Diff line change
Expand Up @@ -311,19 +311,19 @@ function iterate_Callback(hObject, eventdata, handles)

fname = sprintf('%s/weights/%s_GRAY_q%d_it%.2d.nii', svca4.outputPath, svca4.Names{fi}, q*100,its);
OUT_struct.img = single(flip(GRAY));
save_untouch_nii(OUT_struct, fname);
save_nii(OUT_struct, fname);

fname = sprintf('%s/weights/%s_WHITE_q%d_it%.2d.nii', svca4.outputPath, svca4.Names{fi}, q*100,its);
OUT_struct.img = single(flip(WHITE));
save_untouch_nii(OUT_struct, fname);
save_nii(OUT_struct, fname);

fname = sprintf('%s/weights/%s_BLOOD_q%d_it%.2d.nii', svca4.outputPath, svca4.Names{fi}, q*100,its);
OUT_struct.img = single(flip(BLOOD));
save_untouch_nii(OUT_struct, fname);
save_nii(OUT_struct, fname);

fname = sprintf('%s/weights/%s_TSPO_q%d_it%.2d.nii', svca4.outputPath, svca4.Names{fi}, q*100,its);
OUT_struct.img = single(flip(TSPO));
save_untouch_nii(OUT_struct, fname);
save_nii(OUT_struct, fname);
end
end
clear grey white blood tspo
Expand Down
6 changes: 3 additions & 3 deletions svca4_mainGui.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ function flip_Callback(hObject, eventdata, handles)
PET_struct = load_nii(pname);
PET_struct.img = flip(PET_struct.img,4);
fname = [pname(1:end-4) '_flip.nii'];
save_untouch_nii(PET_struct, fname);
save_nii(PET_struct, fname);
elseif size(files,1) > 1
for s = 1:length(files)
pname = fullfile(filepath,files(s));
PET_struct = load_nii(pname);
PET_struct.img = flip(PET_struct.img,4);
fname = [pname(1:end-4) '_flipTime.nii'];
save_untouch_nii(PET_struct, fname);
save_nii(PET_struct, fname);
end
end

Expand Down Expand Up @@ -348,7 +348,7 @@ function copy_header_Callback(hObject, eventdata, handles)
change = load_nii(change_files{i});
out = orig;
out.img = change.img;
save_untouch_nii(out,change_files{i})
save_nii(out,change_files{i})
end
end

Expand Down
2 changes: 1 addition & 1 deletion svca4_timeShiftGui.m
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,5 @@ function shift_Callback(hObject, eventdata, handles)
% save the normalized and shifted dynamic PET data
oname = fullfile(svca4.PET_dir, [svca4.PET_list{inds(s)}(1:end-4) '_norm_shift_' num2str(peak_diff) '.nii']);
PET_struct.img = single(flip(PET_shift));
%save_untouch_nii(PET_struct, oname)
%save_nii(PET_struct, oname)
end

0 comments on commit 07c0801

Please sign in to comment.