Skip to content

Commit

Permalink
Merge pull request #1840 from mathdugre/1838/enh
Browse files Browse the repository at this point in the history
ENH: use prefix from --output for --write-interval-volumes
  • Loading branch information
cookpa authored Feb 4, 2025
2 parents 2a91bc8 + 03b8c02 commit 20ec268
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ class antsDisplacementAndVelocityFieldRegistrationCommandIterationUpdate final :

itkSetMacro(CurrentStageNumber, unsigned int);

void
SetOutputPrefix(const std::string & outputPrefix)
{
this->m_OutputPrefix = outputPrefix;
}

void
SetNumberOfIterations(const std::vector<unsigned int> & iterations)
{
Expand Down Expand Up @@ -446,7 +452,7 @@ class antsDisplacementAndVelocityFieldRegistrationCommandIterationUpdate final :
const unsigned int curLevel = filter->GetCurrentLevel();
const unsigned int curIter = filter->GetCurrentIteration();
std::stringstream currentFileName;
currentFileName << "Stage" << this->m_CurrentStageNumber + 1 << "_level" << curLevel + 1;
currentFileName << this->m_OutputPrefix << "Stage" << this->m_CurrentStageNumber + 1 << "_level" << curLevel + 1;
/*
The name arrangement of written files are important to us.
To prevent: "Iter1 Iter10 Iter2 Iter20" we use the following style.
Expand Down Expand Up @@ -500,6 +506,7 @@ class antsDisplacementAndVelocityFieldRegistrationCommandIterationUpdate final :
*/
// itk::WeakPointer<OptimizerType> m_Optimizer;

std::string m_OutputPrefix;
std::vector<unsigned int> m_NumberOfIterations;
std::ostream * m_LogStream;
itk::TimeProbe m_clock;
Expand Down
1 change: 1 addition & 0 deletions Examples/itkantsRegistrationHelper.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -2165,6 +2165,7 @@ RegistrationHelper<TComputeType, VImageDimension>::DoRegistration()
displacementFieldRegistrationObserver2->SetNumberOfIterations(currentStageIterations);
displacementFieldRegistrationObserver2->SetOrigFixedImage(this->m_Metrics[0].m_FixedImage);
displacementFieldRegistrationObserver2->SetOrigMovingImage(this->m_Metrics[0].m_MovingImage);
displacementFieldRegistrationObserver2->SetOutputPrefix(this->m_OutputPrefix);
if (this->m_PrintSimilarityMeasureInterval != 0)
{
displacementFieldRegistrationObserver2->SetComputeFullScaleCCInterval(this->m_PrintSimilarityMeasureInterval);
Expand Down

0 comments on commit 20ec268

Please sign in to comment.