4 #include "ui_controlswidget.h" 10 timer =
new QTimer(
this );
11 timer->setInterval( 1000 / ui->spinBoxSpeed->value( ) );
13 ui->pushButton4Views->hide( );
14 ui->pushButton_3RGB->hide( );
17 ui->horizontalSliderZoom->setEnabled(
false );
18 ui->horizontalSliderBrightness->setEnabled(
false );
19 ui->horizontalSliderContrast->setEnabled(
false );
44 connect( ui->folderSpinBox, SIGNAL(valueChanged(
int)), controller, SLOT(setCurrentImagePos(
int)) );
49 void ControlsWidget::imageChanged( ) {
51 if( img ==
nullptr ) {
66 ui->pushButtonGrid->setChecked(
true );
69 ui->pushButtonHorizontal->setChecked(
true );
72 ui->pushButtonVertical->setChecked(
true );
77 ui->pushButton1View->setChecked(
true );
78 ui->pushButtonAxial->setChecked(
true );
79 ui->pushButton_RGB->setChecked(
true );
82 ui->pushButton1View->setChecked(
true );
83 ui->pushButtonCoronal->setChecked(
true );
84 ui->pushButton_R->setChecked(
true );
87 ui->pushButton1View->setChecked(
true );
88 ui->pushButtonSagittal->setChecked(
true );
89 ui->pushButton_G->setChecked(
true );
92 ui->pushButton1View->setChecked(
true );
93 ui->pushButton_B->setChecked(
true );
96 ui->pushButton3Views->setChecked(
true );
99 ui->pushButton3Views->setChecked(
true );
102 ui->pushButton4Views->setChecked(
true );
106 ui->groupBoxNiftiAxis->setVisible( format->
showNiftiAxis( ) );
108 ui->groupBoxPpmViews->setVisible( format->
showPpmViews( ) );
111 ui->groupBoxLabels->setVisible(
false );
116 void ControlsWidget::imageUpdated( ) {
119 void ControlsWidget::updateRange( ) {
120 size_t images = controller->
size( );
122 ui->folderSpinBox->setMaximum( images );
123 ui->folderHorizontalSlider->setMaximum( images - 1 );
124 ui->folderHorizontalSlider->setMinimum( 0 );
126 else if( images == 0 ) {
127 ui->folderSpinBox->setMaximum( 0 );
128 ui->folderHorizontalSlider->setMaximum( 0 );
129 ui->folderHorizontalSlider->setMinimum( 0 );
131 ui->folderSpinBox->setEnabled( images > 1 );
132 ui->folderHorizontalSlider->setEnabled( images > 1 );
133 ui->groupBoxFolderControls->setVisible( images > 1 );
134 setVisible( images > 0 );
137 void ControlsWidget::on_spinBoxSpeed_valueChanged(
int value ) {
138 timer->setInterval( 1000 / value );
141 void ControlsWidget::on_buttonPlay_clicked(
bool checked ) {
150 void ControlsWidget::on_pushButton1View_clicked( ) {
154 void ControlsWidget::on_pushButton3Views_clicked( ) {
158 void ControlsWidget::on_pushButton4Views_clicked( ) {
162 void ControlsWidget::on_pushButton_1RGB_clicked( ) {
166 void ControlsWidget::on_pushButton_3RGB_clicked( ) {
170 void ControlsWidget::on_pushButton_4RGB_clicked( ) {
174 void ControlsWidget::on_pushButtonGrid_clicked( ) {
178 void ControlsWidget::on_pushButtonHorizontal_clicked( ) {
182 void ControlsWidget::on_pushButtonVertical_clicked( ) {
186 void ControlsWidget::on_pushButtonAxial_clicked( ) {
190 void ControlsWidget::on_pushButtonCoronal_clicked( ) {
194 void ControlsWidget::on_pushButtonSagittal_clicked( ) {
198 void ControlsWidget::on_pushButton_RGB_clicked( ) {
202 void ControlsWidget::on_pushButton_R_clicked( ) {
206 void ControlsWidget::on_pushButton_G_clicked( ) {
210 void ControlsWidget::on_pushButton_B_clicked( ) {
214 void ControlsWidget::on_pushButtonInterpolation_clicked( ) {
215 COMMENT(
"Toggled interpolation button.", 1 );
219 void ControlsWidget::on_rotate_clicked( ) {
223 void ControlsWidget::on_pushButtonHistogramNormalization_clicked( ) {
229 void ControlsWidget::on_pushButtonFitInView_clicked( ) {
void setCurrentImagePos(int position)
setCurrentImagePos
DisplayFormat * currentFormat()
currentFormat returns the modality of current image.
The GuiImage class is a bridge to the Bial::Image data structure to the QImage data structure...
bool getEqualizeHistogram() const
getEqualizeHistogram returns a boolean value that says if the image must be equalized or not...
void setInterpolation(bool isSmooth)
setInterpolation switches between smoot and fast interpolation.
The Controller class is one of the most important classes of the User Interface, and is responsible t...
void rotateAll90()
rotateAll90 rotates all views in 90 degrees.
void loadNextImage()
loadNextImage is a slot called from controlsdock that loads the next image ( like an circular list )...
GuiImage * currentImage()
currentImage
int currentImagePos() const
currentImagePos
void currentImageChanged()
This signal is emmited every time the current image changes.
void setEqualizeHistogram(bool equalizeHistogram)
setEqualizeHistogram updates a boolean value that says if the image must be equalized or not...
void containerUpdated()
This signal is emmited avery time the m_images vector is updated.
void imageUpdated()
This signal is emmited every time the current image is updated.