hi Jingxuan,
I've forwarded your message to my student Rahul Ragunathan, who
had done comparisons between MCX and diffusion with SFDI sources.
He will follow up with your question shortly.
Qianqian
--
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcx-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mcx-users/3dded8d7-0702-7dd6-c52e-3d77496ace8c%40neu.edu.
Hello Jingxuan,
Sorry for jumping around messages, but this way I can post to the group as well as keep Dr .Fang in the loop.
So I found multiple issues and there is an additional clarification I want to add:
I have attached my modified version of the script as well as the aforementioned images. Dr. Fang might have additional input regarding the third point in specific.
Please let me know if this is useful and if you have any additional questions!
Rahul
Hello Jingxuan,
Thank you and I look forward to looking at the results!
Rahul
Hello Jingxuan,
I think a more direct way of addressing your comment is to list the normalization steps I used in my code. Note that I always keep my voxel size at 1 mm, and there likely is an area/volume scaling factor that would have to be accounted for in the script. Finding where that factor should be incorporated should be straightforward ( I had it working at one point). So for 1 mm voxel size:
AreaScaling=1/AreaBox ; % Scaling for Area Projected
scalingfactor=numphotons*AreaScaling;
I1=croppedimages(:,:,1)./scalingfactor;
I2=croppedimages(:,:,2)./scalingfactor;
I3=croppedimages(:,:,3)./scalingfactor;
Note that this is the mean of the normalized sinusoidal patterns of each phase ( 0 to 1). This should also account for fx=0, where your intensities of the pattern will be [1 0.25 0.25]. You will therefore divide by 0.5. This term is necessary as our patterns are discretized and we are simulating over a slab where a phase shift will not retain consistent src power over the entire surface. I found this to be the best match. Since you used the fourier option as your source, the mean of your pattern may need to be approximated over your surface independently.
%% EQN 20 Cuccia
term1=sqrt(2)/3;
term2=(I1-I2).^2;
term3=(I2-I3).^2;
term4=(I3-I1).^2;
MAC.reflectance_d=(term1*((term2+term3+term4).^(1/2)))./mean(meanpatterns); % This should roughly be equal to R_d derived analytically or through white MC using a pencil beam convolution
Please let me know if you have any other questions.
Rahul
From: JR <jingxu...@gmail.com>
Sent: Thursday, January 14, 2021 4:58 PM
To: Rahul Ragunathan <raguna...@northeastern.edu>
Cc: Fang, Qianqian <q.f...@northeastern.edu>; mcx-...@googlegroups.com
Subject: Re: [mcx-users] Fwd: Fwd: MCX simulation of SFDI
Hi Rahul,
Thank you for the explanation. Here are my new results with dref and corrected air padding. Although the MCX result is still not matching the diffusion theory, I believe the problem is the normalization. Below is my analysis.
What I calculated for the MCX R_d is actually the demodulated reflectance M_ac. The unit is the default unit of flux.dref from MCX and the quantity is around 1e4 (see the unNormalized figure). However, in the diffusion model, R_d is a ratio normalized by its source power (amplitude of the sinusoidal). I naturally took the assumption that the source power of MCX is the same for each fx if I set cfg.isnormalized=1. That's why I normalize the M_ac by the DC reflectance from MCX and compare them with the diffusion theory (see the Normalized figure). So my questions are:
1. What is the source power when I set cfg.isnormalized=1 and what unit is it? According to your previous email, a pattern of (cos(2*pi*fx+alpha)+1)/2 is projected. So the source amplitude is 1? If so, why is the demodulated M_ac is around 1e4? In your previous email, you showed the R_d of MCX. Could you explain how you convert the M_ac to R_d?
2. What is the source power when I set cfg.isnormalized=0?
Thank you very much!
Jingxuan
On Wed, Jan 13, 2021 at 6:45 PM Rahul Ragunathan <raguna...@northeastern.edu> wrote:
Hello Jingxuan,
1. I see your point for the first statement. What you are doing is what I do in m simulations as well. I just did not catch it.
2. Sorry! I did mean cfg.isnormalized. I accidentally used the name of my variable in my function instead. So essentially, for SFDI we are projecting a pattern in the form of (cos(2*pi*fx+alpha)+1)/2. For fx=0 and alpha=[0 2p/3 4pi/3], this simplifies to intensities of [1 0.25 0.25]. When cfg.isnormalized is set to 1, you are normalizing your source patterns to a unitary source which means you are actually obtaining the results of [1 1 1] for your 3 phases. This is why in my attached image for the 3 DC terms, the fluence output was exactly the same despite the phase change ( we would expect [1 0.25 0.25] in terms of the fluences). You can simply run one full DC simulation at phase=0 and divide the output by 4 for your other 2 images.
3. I am unsure of the acceptance angle of photons present in the boundary layer. Dr. Fang, would likely be able to answer this better.
I elected to use cfg.srctype=’pattern’ in order to utilize MCX’s photon sharing method and so that I could use other pattern types other than fourier using the same base code. The readme and help command should be useful but in general:
Cfg.srcpattern= patterns; à patterns is a 3D array of the form (pat idx, x,y) . I use the standard SFDI equation to solve over this grid using a 0.1 spacing. This can be different than your voxel spacing.)
Cfg.srcparam1=[height 0 0 size(patterns,2)] à height is src height in voxels
Cfg.srcparam2=[width 0 0 size(patterns,3)] à width is src width in voxels
Cfg.srcnum=size(patterns,1);
I compute the mean manually for each pattern when I create them. Yes, the mean is roughly 0.5 for all AC patterns as expected. The real purpose of the mean(mean(patterns))) is for the DC term as discussed before. I still feel that the issue is due to the change in voxel size not being accounted for. It seems that the R_d is consistently off what would be expected by a factor of 2 in your case which happens to be what the voxel size factor is ( 0.5 vs 1). Just curious, could you try to make your voxel size 0.25 mm^3 and tell me what you observe? Also is 1 mm^3 working fine?
Please let me know and hopefully what I have sent can be useful in solving this issue.
Thank you!
Sorry about the double post. Disregard my scaling factor comment as it does not appear to be a consistent 2x difference . Please do try the srcpattern change though. I do not have much experience using the fourier srctype , so I wonder if this could potentially fix the problem.
Thank you!
Rahul
From: JR <jingxu...@gmail.com>
Sent: Friday, January 15, 2021 3:33 AM