[Insight-developers] Very suspicious behavior.

Johnson, Hans J hans-johnson at uiowa.edu
Mon Feb 28 08:09:08 EST 2011


Dan,

I found a tangentially related bug in ITKv3 & ITKv4 that was complicating my understanding of the BRAINSFit threading issues that you are so kindly looking into.

Rather than make the entire program single threaded, I wanted to isolate and force just itk::MattesMutualInformationImageToImageMetric  into single threaded mode:

BRAINSCommonLib/BRAINSFitHelper.cxx :  Inserted line 115:
106   if(this->m_CostMetric == "MMI")
107     {
108     typedef itk::MattesMutualInformationImageToImageMetric<FixedVolumeType,MovingVolumeType> MetricType;
109     this->SetupRegistration<MetricType>();
110
111     MetricType::Pointer localCostMetric = this->GetCostMetric<MetricType>();
112     localCostMetric->SetNumberOfHistogramBins(this->m_NumberOfHistogramBins);
113     const bool UseCachingOfBSplineWeights = ( m_UseCachingOfBSplineWeightsMode == "ON" ) ? true : false;
114     localCostMetric->SetUseCachingOfBSplineWeights(UseCachingOfBSplineWeights);
115     localCostMetric->SetNumberOfThreads(1);
116     this->RunRegistration<MetricType>();
117     }

The problem was the that ImageRegistrationMethod was modifying the state of my localCostMetric and resetting the number of threads to a larger value.

I've posted patches to both ITKv3 and ITKv4 to avoid changing the prescribed localCostMetric number of threads:
http://review.source.kitware.com/#change,1088
http://review.source.kitware.com/#change,1087

=============================================

Once the ITKv[3,4] bugs are fixed, then I can sacrifice time to get a consistent result in BRAINSFit ( by forcing localCostMetric for MMI to  only use 1 thread).

=============================================

I hope you can find a way to give consistent threaded results from "MMI" because that greatly increases the processing time when it is single threaded.

Thanks,
Hans



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110228/72a78c88/attachment.htm>


More information about the Insight-developers mailing list