Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ class ITK_EXPORT MaskFeaturePointSelectionFilter: public ImageToMeshFilter< TIma
itkSetMacro(BlockRadius, SizeType);
itkGetConstReferenceMacro(BlockRadius, SizeType);

/** set/get half size of the block for the connectivity */
itkSetMacro(ConnectivityRadius, SizeType);
itkGetConstReferenceMacro(ConnectivityRadius, SizeType);

/** enable/disable tensor computations */
itkSetMacro(ComputeStructureTensors, bool);
itkGetMacro(ComputeStructureTensors, bool);
Expand Down Expand Up @@ -162,6 +166,7 @@ class ITK_EXPORT MaskFeaturePointSelectionFilter: public ImageToMeshFilter< TIma
unsigned m_NonConnectivity;
std::vector< OffsetType > m_NonConnectivityOffsets;
SizeType m_BlockRadius;
SizeType m_ConnectivityRadius;
double m_SelectFraction;
bool m_ComputeStructureTensors;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ MaskFeaturePointSelectionFilter< TImage, TMask, TFeatures >
m_NonConnectivity = Self::VERTEX_CONNECTIVITY;
m_SelectFraction = 0.1;
m_BlockRadius.Fill( 2 );
m_ConnectivityRadius.Fill( 1 );
m_ComputeStructureTensors = true;
}

Expand Down Expand Up @@ -70,6 +71,7 @@ MaskFeaturePointSelectionFilter< TImage, TMask, TFeatures >
}
os << std::endl
<< indent << "m_BlockRadius: " << m_BlockRadius << std::endl
<< indent << "m_ConnectivityRadius: " << m_ConnectivityRadius << std::endl
<< indent << "m_ComputeStructureTensors: " << ( m_ComputeStructureTensors ? "yes" : "no" ) << std::endl
<< indent << "m_SelectFraction: " << m_SelectFraction << std::endl;
}
Expand All @@ -84,7 +86,7 @@ MaskFeaturePointSelectionFilter< TImage, TMask, TFeatures >
m_NonConnectivityOffsets.clear();
// use Neighbourhood to compute all offsets in radius 1
Neighborhood< unsigned, ImageDimension> neighborhood;
neighborhood.SetRadius( NumericTraits< SizeValueType >::One );
neighborhood.SetRadius( m_ConnectivityRadius );
for ( SizeValueType i = 0, n = neighborhood.Size(); i < n; i++ )
{
OffsetType off = neighborhood.GetOffset( i );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,9 @@ BlockMatchingImageFilter< TFixedImage, TMovingImage, TFeatures, TDisplacements,
for ( SizeValueType idx = first, last = first + count; idx < last; idx++ )
{
FeaturePointsPhysicalCoordinates originalLocation = featurePoints->GetPoint( idx );
ImageIndexType index;
fixedImage->TransformPhysicalPointToIndex( originalLocation, index );
ImageIndexType fixedIndex,floatIndex;
fixedImage->TransformPhysicalPointToIndex( originalLocation, fixedIndex );
floatingImage->TransformPhysicalPointToIndex( originalLocation, floatIndex );

// the block is selected for a minimum similarity metric
SimilaritiesValue similarity = NumericTraits< SimilaritiesValue >::Zero;
Expand All @@ -267,9 +268,9 @@ BlockMatchingImageFilter< TFixedImage, TMovingImage, TFeatures, TDisplacements,
DisplacementsVector displacement;

// set centers of window and center regions to current location
ImageIndexType start = index - this->m_SearchRadius;
ImageIndexType start = fixedIndex - this->m_SearchRadius;
window.SetIndex( start );
center.SetIndex( index );
center.SetIndex( floatIndex );

// iterate over neighborhoods in region window, for each neighborhood: iterate over voxels in blockRadius
ConstNeighborhoodIterator< FixedImageType > windowIterator( m_BlockRadius, fixedImage, window );
Expand Down