Skip to content

Commit

Permalink
BUG: ComputeTrainingMask preserve image info. TubeExtractor count.
Browse files Browse the repository at this point in the history
ComputeTrainingMask was returning an image with default image
info (e.g., spacing = 1,1,1).  Now copies the info from the input image.

TubeExtractor was numbering tubes starting at 0 - but that made tracking
tubes by their Id in a mask image problematic.   Now the first extracted
tubes has the Id=1.
  • Loading branch information
aylward committed Dec 6, 2023
1 parent 1dc871d commit 7325399
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
Binary file removed examples/Demo-ManipulateTubes-JupyterNotebook.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions src/Segmentation/itktubeComputeTrainingMaskFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ ComputeTrainingMaskFilter< TInputImage, TLabelMap >
{
typename ImageType::Pointer input = ImageType::New();
input->Graft( const_cast< ImageType * >( this->GetInput() ) );
input->CopyInformation( this->GetInput() );

m_Threshold->SetInput( input );
m_Threshold->Update();
Expand Down
2 changes: 1 addition & 1 deletion src/Segmentation/itktubeTubeExtractor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ TubeExtractor<TInputImage>

typedef itk::MinimumMaximumImageCalculator<TubeMaskImageType> MinMaxCalcType;
typename MinMaxCalcType::Pointer maxCalc = MinMaxCalcType::New();
unsigned int count = 0;
unsigned int count = 1;
double successRatio = 1;
double maxValue = m_SeedExtractionMinimumProbability;
while( ( m_SeedMaskMaximumNumberOfPoints == 0
Expand Down

0 comments on commit 7325399

Please sign in to comment.