本文整理汇总了C++中LayerMRI::GetMinimumVoxelSize方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerMRI::GetMinimumVoxelSize方法的具体用法?C++ LayerMRI::GetMinimumVoxelSize怎么用?C++ LayerMRI::GetMinimumVoxelSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerMRI
的用法示例。
在下文中一共展示了LayerMRI::GetMinimumVoxelSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateStats
void Region2DPolyline::Update()
{
if ( !m_actorPolyline->GetVisibility() || m_worldPts.size() < 2 )
{
return;
}
double pt[3];
vtkSmartPointer<vtkPoints> pts = vtkSmartPointer<vtkPoints>::New();
vtkSmartPointer<vtkCellArray> lines = vtkSmartPointer<vtkCellArray>::New();
lines->InsertNextCell( m_worldPts.size() );
for ( size_t i = 0; i < m_worldPts.size(); i++ )
{
m_view->WorldToViewport( m_worldPts[i].pos[0], m_worldPts[i].pos[1], m_worldPts[i].pos[2], pt[0], pt[1], pt[2] );
pts->InsertNextPoint( pt );
lines->InsertCellPoint( i );
}
vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New();
polydata->SetPoints( pts );
polydata->SetLines( lines );
vtkSmartPointer<vtkPolyDataMapper2D> mapper = vtkSmartPointer<vtkPolyDataMapper2D>::New();
if ( !m_bSpline )
{
mapper->SetInput( polydata );
}
else
{
vtkSmartPointer<vtkSplineFilter> spline = vtkSmartPointer<vtkSplineFilter>::New();
spline->SetInput( polydata );
LayerMRI* layer = m_view->GetFirstNonLabelVolume();
if ( layer )
{
spline->SetSubdivideToLength();
spline->SetLength( 3*layer->GetMinimumVoxelSize() );
}
spline->Update();
mapper->SetInputConnection( spline->GetOutputPort() );
}
vtkSmartPointer<vtkCoordinate> coords = vtkSmartPointer<vtkCoordinate>::New();
coords->SetCoordinateSystemToViewport();
mapper->SetTransformCoordinate( coords );
m_actorPolyline->SetMapper( mapper );
vtkSmartPointer<vtkPolyData> polydata2 = vtkSmartPointer<vtkPolyData>::New();
polydata2->SetPoints( pts );
vtkSmartPointer<vtkCellArray> verts = vtkSmartPointer<vtkCellArray>::New();
verts->Allocate( pts->GetNumberOfPoints() );
for ( int i = 0; i < pts->GetNumberOfPoints(); i++ )
{
vtkIdType n = i;
verts->InsertNextCell( 1, &n );
}
polydata2->SetVerts( verts );
mapper = vtkSmartPointer<vtkPolyDataMapper2D>::New();
mapper->SetInput( polydata2 );
mapper->SetTransformCoordinate( coords );
m_actorPoints->SetMapper( mapper );
// m_actorText->SetInput( GetShortStats().c_str() );
// double mid_pt[3];
m_actorText->SetPosition( pts->GetPoint( 0 ) );
UpdateStats();
}