Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Components/Metrics/PCAMetric/elxPCAMetric.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ namespace elastix
* or by nearest neighbor interpolation of a precomputed central difference image.
* \li A minimum number of samples that should map within the moving image (mask) can be specified.
*
* \parameter SampleLastDimensionRandomly: randomly sample a number of time points to
* to compute the variance from. When set to "false", all time points are taken into
* account. When set to "true", a random number of time points is selected, which can
* be set with parameter NumSamplesLastDimension. \n
* \parameter NumSamplesLastDimension: the number of random samples to take in the time
* time direction of the data when SampleLastDimensionRandomly is set to true.
* \parameter UseZeroAverageDisplacementConstraint: uses the zero average displacement constraint, as described in
* <em>Nonrigid registration of dynamic medical imaging data using nD+t B-splines and a groupwise optimization
* approach</em>, Metz et al., Medical Image Analysis, 2011. Subtract the over time computed mean parameter value
Expand Down
6 changes: 0 additions & 6 deletions Components/Metrics/PCAMetric2/elxPCAMetric2.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ namespace elastix
* or by nearest neighbor interpolation of a precomputed central difference image.
* \li A minimum number of samples that should map within the moving image (mask) can be specified.
*
* \parameter SampleLastDimensionRandomly: randomly sample a number of time points to
* to compute the variance from. When set to "false", all time points are taken into
* account. When set to "true", a random number of time points is selected, which can
* be set with parameter NumSamplesLastDimension. \n
* \parameter NumSamplesLastDimension: the number of random samples to take in the time
* time direction of the data when SampleLastDimensionRandomly is set to true.
* \parameter UseZeroAverageDisplacementConstraint: uses the zero average displacement constraint, as described in
* <em>Nonrigid registration of dynamic medical imaging data using nD+t B-splines and a groupwise optimization
* approach</em>, Metz et al., Medical Image Analysis, 2011. Subtract the over time computed mean parameter value
Expand Down
10 changes: 0 additions & 10 deletions Components/Metrics/PCAMetric2/elxPCAMetric2.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,6 @@ PCAMetric2<TElastix>::BeforeEachResolution()
useZeroAverageDisplacementConstraint, "UseZeroAverageDisplacementConstraint", componentLabel, 0, 0);
this->SetUseZeroAverageDisplacementConstraint(useZeroAverageDisplacementConstraint);

/** Get and set the number of additional samples sampled at the fixed timepoint. */
unsigned int numAdditionalSamplesFixed = 0;
configuration.ReadParameter(numAdditionalSamplesFixed, "NumAdditionalSamplesFixed", componentLabel, level, 0);
this->SetNumAdditionalSamplesFixed(numAdditionalSamplesFixed);

/** Get and set the fixed timepoint number. */
unsigned int reducedDimensionIndex = 0;
configuration.ReadParameter(reducedDimensionIndex, "ReducedDimensionIndex", componentLabel, 0, 0);
this->SetReducedDimensionIndex(reducedDimensionIndex);

/** Set moving image derivative scales. */
this->SetUseMovingImageDerivativeScales(false);
MovingImageDerivativeScalesType movingImageDerivativeScales;
Expand Down
10 changes: 0 additions & 10 deletions Components/Metrics/PCAMetric2/itkPCAMetric2.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class ITK_TEMPLATE_EXPORT PCAMetric2 : public AdvancedImageToImageMetric<TFixedI
itkOverrideGetNameOfClassMacro(PCAMetric2);

/** Set functions. */
itkSetMacro(NumAdditionalSamplesFixed, unsigned int);
itkSetMacro(ReducedDimensionIndex, unsigned int);
itkSetMacro(UseZeroAverageDisplacementConstraint, bool);
itkSetMacro(GridSize, FixedImageSizeType);
itkSetMacro(TransformIsStackTransform, bool);
Expand Down Expand Up @@ -151,14 +149,6 @@ class ITK_TEMPLATE_EXPORT PCAMetric2 : public AdvancedImageToImageMetric<TFixedI
DerivativeType & imageJacobian) const override;

private:
/** Sample n random numbers from 0..m and add them to the vector. */
void
SampleRandom(const int n, const int m, std::vector<int> & numbers) const;

/** Variables to control random sampling in last dimension. */
unsigned int m_NumAdditionalSamplesFixed{};
unsigned int m_ReducedDimensionIndex{};

/** Bool to determine if we want to subtract the mean derivate from the derivative elements. */
bool m_UseZeroAverageDisplacementConstraint{ true };

Expand Down
35 changes: 0 additions & 35 deletions Components/Metrics/PCAMetric2/itkPCAMetric2.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,41 +74,6 @@ PCAMetric2<TFixedImage, TMovingImage>::PrintSelf(std::ostream & os, Indent inden
} // end PrintSelf()


/**
* ******************* SampleRandom *******************
*/

template <typename TFixedImage, typename TMovingImage>
void
PCAMetric2<TFixedImage, TMovingImage>::SampleRandom(const int n, const int m, std::vector<int> & numbers) const
{
/** Empty list of last dimension positions. */
numbers.clear();
numbers.reserve(m_NumAdditionalSamplesFixed + n);

// Retrieve random number generator.
Statistics::MersenneTwisterRandomVariateGenerator & randomVariateGenerator =
Deref(Superclass::GetRandomVariateGenerator());

/** Sample additional at fixed timepoint. */
for (unsigned int i = 0; i < m_NumAdditionalSamplesFixed; ++i)
{
numbers.push_back(m_ReducedDimensionIndex);
}

/** Get n random samples. */
for (int i = 0; i < n; ++i)
{
int randomNum = 0;
do
{
randomNum = static_cast<int>(randomVariateGenerator.GetVariateWithClosedRange(m));
} while (find(numbers.begin(), numbers.end(), randomNum) != numbers.end());
numbers.push_back(randomNum);
}
} // end SampleRandom()


/**
* *************** EvaluateTransformJacobianInnerProduct ****************
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ namespace elastix
* or by nearest neighbor interpolation of a precomputed central difference image.
* \li A minimum number of samples that should map within the moving image (mask) can be specified.
*
* \parameter SampleLastDimensionRandomly: randomly sample a number of time points to
* to compute the variance from. When set to "false", all time points are taken into
* account. When set to "true", a random number of time points is selected, which can
* be set with parameter NumSamplesLastDimension. \n
* \parameter NumSamplesLastDimension: the number of random samples to take in the time
* time direction of the data when SampleLastDimensionRandomly is set to true.
* \parameter UseZeroAverageDisplacementConstraint: uses the zero average displacement constraint, as described in
* <em>Nonrigid registration of dynamic medical imaging data using nD+t B-splines and a groupwise optimization
* approach</em>, Metz et al., Medical Image Analysis, 2011. Subtract the over time computed mean parameter value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,6 @@ SumOfPairwiseCorrelationCoefficientsMetric<TElastix>::BeforeEachResolution()
useZeroAverageDisplacementConstraint, "UseZeroAverageDisplacementConstraint", componentLabel, 0, 0);
this->SetUseZeroAverageDisplacementConstraint(useZeroAverageDisplacementConstraint);

/** Get and set the number of additional samples sampled at the fixed timepoint. */
unsigned int numAdditionalSamplesFixed = 0;
configuration.ReadParameter(numAdditionalSamplesFixed, "NumAdditionalSamplesFixed", componentLabel, level, 0);
this->SetNumAdditionalSamplesFixed(numAdditionalSamplesFixed);

/** Get and set the fixed timepoint number. */
unsigned int reducedDimensionIndex = 0;
configuration.ReadParameter(reducedDimensionIndex, "ReducedDimensionIndex", componentLabel, 0, 0);
this->SetReducedDimensionIndex(reducedDimensionIndex);

/** Set moving image derivative scales. */
this->SetUseMovingImageDerivativeScales(false);
MovingImageDerivativeScalesType movingImageDerivativeScales;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class ITK_TEMPLATE_EXPORT SumOfPairwiseCorrelationCoefficientsMetric
itkOverrideGetNameOfClassMacro(SumOfPairwiseCorrelationCoefficientsMetric);

/** Set functions. */
itkSetMacro(NumAdditionalSamplesFixed, unsigned int);
itkSetMacro(ReducedDimensionIndex, unsigned int);
itkSetMacro(UseZeroAverageDisplacementConstraint, bool);
itkSetMacro(GridSize, FixedImageSizeType);
itkSetMacro(TransformIsStackTransform, bool);
Expand Down Expand Up @@ -151,14 +149,6 @@ class ITK_TEMPLATE_EXPORT SumOfPairwiseCorrelationCoefficientsMetric
DerivativeType & imageJacobian) const override;

private:
/** Sample n random numbers from 0..m and add them to the vector. */
void
SampleRandom(const int n, const int m, std::vector<int> & numbers) const;

/** Variables to control random sampling in last dimension. */
unsigned int m_NumAdditionalSamplesFixed{};
unsigned int m_ReducedDimensionIndex{};

/** Bool to determine if we want to subtract the mean derivate from the derivative elements. */
bool m_UseZeroAverageDisplacementConstraint{ true };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,44 +66,6 @@ SumOfPairwiseCorrelationCoefficientsMetric<TFixedImage, TMovingImage>::PrintSelf
} // end PrintSelf()


/**
* ******************* SampleRandom *******************
*/

template <typename TFixedImage, typename TMovingImage>
void
SumOfPairwiseCorrelationCoefficientsMetric<TFixedImage, TMovingImage>::SampleRandom(const int n,
const int m,
std::vector<int> & numbers) const
{
/** Empty list of last dimension positions. */
numbers.clear();
numbers.reserve(m_NumAdditionalSamplesFixed + n);

// Retrieve random number generator.
Statistics::MersenneTwisterRandomVariateGenerator & randomVariateGenerator =
Deref(Superclass::GetRandomVariateGenerator());

/** Sample additional at fixed timepoint. */
for (unsigned int i = 0; i < m_NumAdditionalSamplesFixed; ++i)
{
numbers.push_back(m_ReducedDimensionIndex);
}

/** Get n random samples. */
for (int i = 0; i < n; ++i)
{
int randomNum = 0;
do
{
randomNum = static_cast<int>(randomVariateGenerator.GetVariateWithClosedRange(m));
} while (find(numbers.begin(), numbers.end(), randomNum) != numbers.end());
numbers.push_back(randomNum);
}

} // end SampleRandom()


/**
* *************** EvaluateTransformJacobianInnerProduct ****************
*/
Expand Down
Loading