how to calculate power of fraction without getting complex double ?
Show older comments
Hi I am trying to make a map (Q). Everything goes well except for the section that delatR2_st = deltaR2_star .^(2/3); where this command creates a double complex matrix, and I dont want it to be complex. And this creates an error for the last command where I try to create the map Qmap(xsize_se,ysize_se) = deltaR2./deltaR2_st ; The errors I get are : Undefined function or variable 'deltaR2_st'.
Error in MVD (line 73) Qmap(xsize_se,ysize_se) = deltaR2./deltaR2_st ;
The code is attached bellow. Can you please help me out what to do.
SE = analyze75read('10_ep2d_ge_se_128_DCE_slice8.hdr'); GE = analyze75read('10_ep2d_ge_128_DCE_slice8.hdr'); TE = 120; % echo time 120 ms [xsize_se, ysize_se, tsize_se] = size(SE); [xsize_ge, ysize_ge, tsize_ge] = size(GE);
Qmap = zeros(xsize_se, ysize_se); IM_Slice = zeros(xsize_se, ysize_se);
for x = 1:xsize_se for y = 1:ysize_se
IM_signal_SE = squeeze(SE(x,y,:));
IM_signal_SE_baseline = squeeze(SE(x,y,4:15));
Spre = mean(IM_signal_SE_baseline);
Spre = double(Spre);
Spost = IM_signal_SE ; % post contrast signal SE
Spost = double (Spost);
deltaR2 = 1/TE .* log(Spre./Spost);
end
end
for n = 1:xsize_ge
for m = 1:ysize_ge
IM_signal_GE = squeeze(GE(n,m,:));
IM_signal_GE_baseline = squeeze(GE(n,m,4:16));
Spre_star = mean(IM_signal_GE_baseline);
Spost_star = IM_signal_GE ; % post contrast signal GE
Spre_star = double (Spre_star);
Spost_star = double (Spost_star);
deltaR2_star = 1/TE .* log(Spre_star./Spost_star);
end
end
delatR2_st = deltaR2_star .^(2/3);
Qmap(xsize_se,ysize_se) = deltaR2./deltaR2_st ;
1 Comment
dpb
on 19 Jun 2014
Well, I'm not sure what you're after, but as soon as you take log(anything) where anything<1 then log() will be negative and the 2/3rds root of a negative value is complex.
You need some other kind of scaling to keep deltaR2_star>0; what that should be I've no klew...
Accepted Answer
More Answers (0)
Categories
Find more on Template Matching 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!