how to save this new images using dicomwrite
Show older comments
I have a programm where i take 4 sets of images, do certain equations on them and after that i would like to save the new set of images in my program (R) to a folder without changing the matrices of R the problem is with dicomwrite (either it is giving me errors and if i change a bit in my program, it gives me another matrices for R from type of UNI and not double). if someone good solve this i would really appreciate it note : i am saving the matrices resultes to my workspace without any problem thanks in advance
for c=1:sizeOfStruct1(1,2)
name1 = fullfile(folder_name1,filesStruct1(c).name);
name2 = fullfile(folder_name2,filesStruct2(c).name);
name3 = fullfile(folder_name3,filesStruct3(c).name);
name4 = fullfile(folder_name4,filesStruct4(c).name);
% Read image from the first fcheckNplotolder, image from the second one,
% convert their matrices to double and store them in A and B.
inv1{c} = double(dicomread(name1));
inv1_pha{c} = double(dicomread(name2));
inv2{c} = double(dicomread(name3));
inv2_pha{c} = double(dicomread(name4));
alpha{c} = ((inv1_pha{c}.*pi)./(4096)) - (pi./2);
beta{c} = ((inv2_pha{c}.*pi)./(4096)) - (pi./2);
metadata = dicominfo(name1);
inv1_com{c} = inv1{c}.* exp(i.*alpha{c});
inv2_com{c} = inv2{c}.* exp(i.*beta{c});
N{c} = inv1_com{c}.* conj(inv2_com{c});
D{c} = abs(inv1_com{c}.^2) + abs(inv2_com{c}.^2);
R{c} = N{c}./D{c};
dicomwrite(R, fullfile('Results',filesStruct1(c).name));
end
save('R');
3 Comments
tarek abousaleh
on 21 Mar 2018
tarek abousaleh
on 21 Mar 2018
tarek abousaleh
on 21 Mar 2018
Answers (0)
Categories
Find more on Polygons in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!