Dear Haiyong,

thank you for your question and sorry for the late reply.


The line

float ex_energy = 
m_EnergyComputer->ComputeExternalEnergy(prop_p.GetPos(),prop_p.GetDir(),p)
- m_EnergyComputer->ComputeExternalEnergy(p->GetPos(),p->GetDir(),p);


is correct. It is not possible to directly pass prop_p to 
ComputeExternalEnergy, because it is a copy of the "old" particle p and this 
copy is not yet added to the particle grid. The line that makes the difference 
is this:

https://phabricator.mitk.org/source/mitk/browse/master/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkGibbsEnergyComputer.cpp;ac2ffd02a187f023da289c60ca79a42b084f2413$139

If you would insert prop_p here, this expression will never be "false".


I hope this helps. If you have further questions, please send your email to the 
MITK-users mailing list (see Cc.).


Best,

Peter



________________________________
Von: [email protected] <[email protected]>
Gesendet: Samstag, 9. September 2017 16:11
An: Neher, Peter
Betreff: Fwd: A little confused on mitkMetropolishHastingsSampler.cpp



Hi Peter,

?I am sorry to disturb you again, the last test stament is modified.?

When I studied the codes of 
mitkMetropolishHastingsSampler.cpp<https://github.com/MITK/MITK/blob/master/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkMetropolisHastingsSampler.cpp>,
 I have a little confused on line 182 and line 247.

float ex_energy = 
m_EnergyComputer->ComputeExternalEnergy(prop_p.GetPos(),prop_p.GetDir(),p)
- m_EnergyComputer->ComputeExternalEnergy(p->GetPos(),p->GetDir(),p);

Both of the lines are computing the difference of external energy between the 
shifted particle prop_p and the original particle p. So it seems more 
reasonable as:

float ex_energy = 
m_EnergyComputer->ComputeExternalEnergy(prop_p.GetPos(),prop_p.GetDir(),&prop_p)
- m_EnergyComputer->ComputeExternalEnergy(p->GetPos(),p->GetDir(),p);

I have tested their distinctive through

float diff = 
m_EnergyComputer->ComputeExternalEnergy(prop_p.GetPos(),prop_p.GetDir(),&prop_p)
 -
m_EnergyComputer->ComputeExternalEnergy(prop_p.GetPos(),prop_p.GetDir(),p)

It always output difference.

Any suggestions will be deeply appreciated.


Best,
Haiyong





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to