added new fields to COnfig View and Number Of hIstogram bins in MI
This commit is contained in:
@ -95,6 +95,7 @@ public:
|
|||||||
* typically results in narrower valleys in the cost fucntion.
|
* typically results in narrower valleys in the cost fucntion.
|
||||||
* Default value is false. */
|
* Default value is false. */
|
||||||
itkSetMacro(SubtractMean, bool);
|
itkSetMacro(SubtractMean, bool);
|
||||||
|
itkSetMacro(NumberOfHistogramBins, int);
|
||||||
itkGetConstReferenceMacro(SubtractMean, bool);
|
itkGetConstReferenceMacro(SubtractMean, bool);
|
||||||
itkBooleanMacro(SubtractMean);
|
itkBooleanMacro(SubtractMean);
|
||||||
|
|
||||||
@ -106,6 +107,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_SubtractMean;
|
bool m_SubtractMean;
|
||||||
|
int m_NumberOfHistogramBins;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace itk
|
} // end namespace itk
|
||||||
|
@ -36,6 +36,7 @@ MutualInformationTwoImageToOneImageMetric<TFixedImage,
|
|||||||
TMovingImage>::MutualInformationTwoImageToOneImageMetric()
|
TMovingImage>::MutualInformationTwoImageToOneImageMetric()
|
||||||
{
|
{
|
||||||
m_SubtractMean = false;
|
m_SubtractMean = false;
|
||||||
|
m_NumberOfHistogramBins = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename TFixedImage, typename TMovingImage>
|
template <typename TFixedImage, typename TMovingImage>
|
||||||
@ -147,7 +148,8 @@ MutualInformationTwoImageToOneImageMetric<TFixedImage, TMovingImage>::GetValue()
|
|||||||
//auto numberOfSamples = static_cast<unsigned int>(numberOfPixels * 0.50); //100%
|
//auto numberOfSamples = static_cast<unsigned int>(numberOfPixels * 0.50); //100%
|
||||||
// since we have a ROI, then we should not set allPixels to TRUE.
|
// since we have a ROI, then we should not set allPixels to TRUE.
|
||||||
//metric1->UseAllPixelsOn();
|
//metric1->UseAllPixelsOn();
|
||||||
metric1->SetNumberOfHistogramBins(50);
|
std::cout << "m_NumberOfHistogramBins " << m_NumberOfHistogramBins << std::endl;
|
||||||
|
metric1->SetNumberOfHistogramBins(m_NumberOfHistogramBins);
|
||||||
|
|
||||||
// InternalImageType::IndexType pIndex;
|
// InternalImageType::IndexType pIndex;
|
||||||
// pIndex[0]=200;
|
// pIndex[0]=200;
|
||||||
@ -183,7 +185,7 @@ MutualInformationTwoImageToOneImageMetric<TFixedImage, TMovingImage>::GetValue()
|
|||||||
//numberOfSamples = static_cast<unsigned int>(numberOfPixels * 0.50); //100%
|
//numberOfSamples = static_cast<unsigned int>(numberOfPixels * 0.50); //100%
|
||||||
//metric2->SetNumberOfSpatialSamples(numberOfSamples);
|
//metric2->SetNumberOfSpatialSamples(numberOfSamples);
|
||||||
//metric2->UseAllPixelsOn();
|
//metric2->UseAllPixelsOn();
|
||||||
metric2->SetNumberOfHistogramBins(50);
|
metric2->SetNumberOfHistogramBins(m_NumberOfHistogramBins);
|
||||||
metric2->SetFixedImage(fixedImage2);
|
metric2->SetFixedImage(fixedImage2);
|
||||||
metric2->SetMovingImage(this->m_Filter2->GetOutput());
|
metric2->SetMovingImage(this->m_Filter2->GetOutput());
|
||||||
metric2->Initialize();
|
metric2->Initialize();
|
||||||
|
@ -1236,8 +1236,9 @@ void itkImageProcessor::SetAmoebaOptimParameters(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void itkImageProcessor::SetMIMetricParameters(double dMaxT){
|
void itkImageProcessor::SetMIMetricParameters(double dMaxT,int iNhb){
|
||||||
m_MIMetricMetaInfo->SetMaxTranslation(dMaxT);
|
m_MIMetricMetaInfo->SetMaxTranslation(dMaxT);
|
||||||
|
m_MIMetricMetaInfo->SetNumberOfHistogramBins(iNhb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void itkImageProcessor::SetNCCMetricParameters(double dMaxT,bool bSm){
|
void itkImageProcessor::SetNCCMetricParameters(double dMaxT,bool bSm){
|
||||||
|
@ -111,7 +111,7 @@ public:
|
|||||||
void SetAmoebaOptimParameters(double,double,double,int);
|
void SetAmoebaOptimParameters(double,double,double,int);
|
||||||
|
|
||||||
/** Set MI */
|
/** Set MI */
|
||||||
void SetMIMetricParameters(double);
|
void SetMIMetricParameters(double,int);
|
||||||
|
|
||||||
/** Set NCC */
|
/** Set NCC */
|
||||||
void SetNCCMetricParameters(double,bool);
|
void SetNCCMetricParameters(double,bool);
|
||||||
|
@ -13,6 +13,7 @@ itkReg23::itkReg23()
|
|||||||
NCCmetric = MetricType::New();
|
NCCmetric = MetricType::New();
|
||||||
MImetric = MIMetricType::New();
|
MImetric = MIMetricType::New();
|
||||||
|
|
||||||
|
|
||||||
// Optimizers
|
// Optimizers
|
||||||
PowellOptimizer = PowellOptimizerType::New();
|
PowellOptimizer = PowellOptimizerType::New();
|
||||||
AmoebaOptimizer = AmoebaOptimizerType::New();
|
AmoebaOptimizer = AmoebaOptimizerType::New();
|
||||||
@ -205,6 +206,7 @@ void itkReg23::InitializeRegistration()
|
|||||||
std::cout<< "Using MI Metric" <<std::endl;
|
std::cout<< "Using MI Metric" <<std::endl;
|
||||||
|
|
||||||
registration->SetMetric(MImetric);
|
registration->SetMetric(MImetric);
|
||||||
|
MImetric->SetNumberOfHistogramBins(m_MIMeta->GetNumberOfHistogramBins());
|
||||||
MImetric->ComputeGradientOff();
|
MImetric->ComputeGradientOff();
|
||||||
MImetric->SetMaxTranslation(m_MIMeta->GetMaxTranslation());
|
MImetric->SetMaxTranslation(m_MIMeta->GetMaxTranslation());
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ MIMetricMetaInformation::
|
|||||||
MIMetricMetaInformation(){
|
MIMetricMetaInformation(){
|
||||||
|
|
||||||
this->m_MaxTranslation = 100.0;
|
this->m_MaxTranslation = 100.0;
|
||||||
|
this->m_NumberOfHistogramBins = 50;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,11 +150,15 @@ public:
|
|||||||
itkSetMacro(MaxTranslation,double);
|
itkSetMacro(MaxTranslation,double);
|
||||||
itkGetMacro(MaxTranslation,double);
|
itkGetMacro(MaxTranslation,double);
|
||||||
|
|
||||||
|
itkSetMacro(NumberOfHistogramBins,int);
|
||||||
|
itkGetMacro(NumberOfHistogramBins,int);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
double m_MaxTranslation;
|
double m_MaxTranslation;
|
||||||
|
|
||||||
|
int m_NumberOfHistogramBins;
|
||||||
|
|
||||||
|
|
||||||
/** Default Constructor **/
|
/** Default Constructor **/
|
||||||
MIMetricMetaInformation ();
|
MIMetricMetaInformation ();
|
||||||
|
Reference in New Issue
Block a user