本文整理汇总了C++中LayerMRI::GetSlicePosition方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerMRI::GetSlicePosition方法的具体用法?C++ LayerMRI::GetSlicePosition怎么用?C++ LayerMRI::GetSlicePosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerMRI
的用法示例。
在下文中一共展示了LayerMRI::GetSlicePosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateIntensity
void DialogRepositionSurface::UpdateIntensity()
{
LayerMRI* mri = (LayerMRI*)MainWindow::GetMainWindow()->GetTopVisibleLayer("MRI");
LayerSurface* surf = (LayerSurface*)MainWindow::GetMainWindow()->GetActiveLayer( "Surface" );
if (mri && surf)
{
double ras[3], surf_ras[3];
mri->GetSlicePosition(ras);
surf->GetSurfaceRASAtTarget(ras, surf_ras);
mri->RemapPositionToRealRAS(ras, ras);
double val = mri->GetSampledVoxelValueByRAS(ras);
if (val >= 0)
{
ui->lineEditTarget->setText(QString::number(val, 'f', 2));
OnCoordinateTypeChanged();
}
ui->lineEditTargetX->setText(QString::number(surf_ras[0], 'f', 2));
ui->lineEditTargetY->setText(QString::number(surf_ras[1], 'f', 2));
ui->lineEditTargetZ->setText(QString::number(surf_ras[2], 'f', 2));
}
}
示例2: OnEditContourValue
void ToolWindowEdit::OnEditContourValue( wxCommandEvent& event )
{
double value;
if ( m_editContourValue->GetValue().ToDouble( &value ) && value > 0 )
{
BrushProperty* bp = MainWindow::GetMainWindowPointer()->GetBrushProperty();
LayerMRI* mri = (LayerMRI*)bp->GetReferenceLayer();
for ( int i = 0; i < 3; i++ )
{
RenderView2D* view = ( RenderView2D* )MainWindow::GetMainWindowPointer()->GetRenderView( i );
Contour2D* c2d = view->GetContour2D();
if ( c2d->GetInputImage() )
c2d->SetContourValue( value );
else if ( mri )
{
c2d->SetInput( mri->GetSliceImageData( view->GetViewPlane() ), value, mri->GetSlicePosition()[i], mri->GetActiveFrame() );
c2d->SetVisible( true );
}
}
UpdateTools();
}
}
示例3: OnButtonCenterToCursor
void DialogTransformVolume::OnButtonCenterToCursor()
{
if ( isVisible() )
{
LayerMRI* layer = ( LayerMRI* )MainWindow::GetMainWindow()->GetActiveLayer( "MRI" );
if ( layer )
{
double pos[3];
layer->GetSlicePosition(pos);
layer->SetTranslateByCenterPosition( pos );
MainWindow::GetMainWindow()->RequestRedraw();
double* vs = layer->GetWorldVoxelSize();
for (int n = 0; n < 3; n++)
{
int range = m_scrollTranslate[n]->maximum();
m_scrollTranslate[n]->blockSignals(true);
m_scrollTranslate[n]->setValue(range/2 + (int)( pos[n] / vs[n] ) );
m_scrollTranslate[n]->blockSignals(false);
}
UpdateUI( 0 );
}
}
}