void DialogTransformVolume::RespondTextRotate( int n )
{
  if ( isVisible() )
  {
    bool bOK;
    double dvalue = m_textAngle[n]->text().toDouble(&bOK);
    if ( bOK )
    {
      LayerMRI* layer = ( LayerMRI* )MainWindow::GetMainWindow()->GetActiveLayer( "MRI" );
      if ( layer )
      {
        double angle[3];
        layer->GetRotate( angle );
        angle[n] = dvalue;
        layer->SetRotate( angle, ui->radioButtonAroundCenter->isChecked() );
        MainWindow::GetMainWindow()->RequestRedraw();

        while (dvalue > 180)
          dvalue -= 360;
        while (dvalue < -180)
          dvalue += 360;

        m_sliderRotate[n]->blockSignals(true);
        m_sliderRotate[n]->setValue( (int)dvalue );
        m_sliderRotate[n]->blockSignals(false);
        UpdateUI( 1 );
      }
    }
  }
}
void DialogTransformVolume::RespondSliderRotate( int n )
{
  if ( isVisible() )
  {
    LayerMRI* layer = ( LayerMRI* )MainWindow::GetMainWindow()->GetActiveLayer( "MRI" );
    if ( layer )
    {
      double angle[3];
      layer->GetRotate( angle );
      angle[n] = m_sliderRotate[n]->value();
      layer->SetRotate( angle, ui->radioButtonAroundCenter->isChecked() );
      MainWindow::GetMainWindow()->RequestRedraw();
      ChangeLineEditNumber(m_textAngle[n], angle[n] );
      UpdateUI( 1 );
    }
  }
}