1 #ifndef _vvOverlayPanel_CXX
2 #define _vvOverlayPanel_CXX
3 #include "vvOverlayPanel.h"
7 #include "QTreePushButton.h"
9 #include <vtksys/SystemTools.hxx>
11 //====================================================================
12 vvOverlayPanel::vvOverlayPanel(QWidget * parent):QWidget(parent)
19 subSamplingSpinBox->setEnabled(0);
20 scaleSpinBox->setEnabled(0);
22 lutCheckBox->setEnabled(0);
23 connect(subSamplingSpinBox,SIGNAL(editingFinished()),this,SLOT(setVFProperty()));
24 connect(scaleSpinBox,SIGNAL(editingFinished()),this,SLOT(setVFProperty()));
25 connect(lutCheckBox,SIGNAL(clicked()),this,SLOT(setVFProperty()));
26 connect(colorHorizontalSlider,SIGNAL(valueChanged(int)),this,SLOT(setOverlayProperty()));
27 connect(opacityHorizontalSlider,SIGNAL(valueChanged(int)),this,SLOT(setFusionProperty()));
28 connect(fusionColorMapComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(setFusionProperty()));
29 connect(windowSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setFusionProperty()));
30 connect(levelSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setFusionProperty()));
33 void vvOverlayPanel::getCurrentImageName(QString name)
35 QString filename = "<b>Current image : </b>";
36 filename += vtksys::SystemTools::GetFilenameWithoutExtension(name.toStdString()).c_str();
37 currentImageLabel->setText(filename.toStdString().c_str());
40 void vvOverlayPanel::getVFProperty(int subsampling, int scale, int log)
42 if (subsampling != -1)
45 vFFrame->setEnabled(1);
46 subSamplingSpinBox->setEnabled(1);
47 subSamplingSpinBox->setValue(subsampling);
48 scaleSpinBox->setEnabled(1);
49 scaleSpinBox->setValue(scale);
50 lutCheckBox->setEnabled(1);
52 lutCheckBox->setCheckState(Qt::Checked);
54 lutCheckBox->setCheckState(Qt::Unchecked);
59 vFFrame->setEnabled(0);
60 subSamplingSpinBox->setEnabled(0);
61 subSamplingSpinBox->setValue(0);
62 scaleSpinBox->setEnabled(0);
63 scaleSpinBox->setValue(0);
64 lutCheckBox->setEnabled(0);
65 lutCheckBox->setCheckState(Qt::Unchecked);
69 void vvOverlayPanel::getVFName(QString name)
71 QString filename = "<b>Deformation Field : </b>";
72 filename += vtksys::SystemTools::GetFilenameWithoutExtension(name.toStdString()).c_str();
73 vectorFieldNameLabel->setText(filename.toStdString().c_str());
76 void vvOverlayPanel::setVFProperty()
78 emit VFPropertyUpdated(subSamplingSpinBox->value(),
79 scaleSpinBox->value(),
80 lutCheckBox->checkState());
83 void vvOverlayPanel::getCurrentVectorInfo(int visibility, double x,double y,double z, double value)
85 QString motion = "<b>Displacement : </b>";
86 QString motionValue = "<b>Length : </b>";
89 motion += QString::number(x,'f',1) + " ";
90 motion += QString::number(y,'f',1) + " ";
91 motion += QString::number(z,'f',1) + " ";
93 motionValue += QString::number(value,'f',1);
95 coordinatesLabel->setText(motion);
96 normLabel->setText(motionValue);
99 void vvOverlayPanel::getOverlayName(QString name)
101 QString filename = "<b>Compare with : </b>";
102 filename += vtksys::SystemTools::GetFilenameWithoutExtension(name.toStdString()).c_str();
103 imageComparedLabel->setText(filename.toStdString().c_str());
106 void vvOverlayPanel::getOverlayProperty(int value)
110 compareFrame->show();
111 compareFrame->setEnabled(1);
112 colorHorizontalSlider->setEnabled(1);
113 colorHorizontalSlider->setValue(value);
117 compareFrame->hide();
118 compareFrame->setEnabled(0);
119 colorHorizontalSlider->setEnabled(0);
120 colorHorizontalSlider->setValue(0);
124 void vvOverlayPanel::setOverlayProperty()
126 emit OverlayPropertyUpdated(colorHorizontalSlider->value());
129 void vvOverlayPanel::getCurrentOverlayInfo(int visibility,double valueOver, double valueRef)
131 QString refValue = "<b>Pixel value in image 1 : </b>";
132 QString overlayValue = "<b>Pixel value in image 2 : </b>";
133 QString diffValue = "<b>Pixel difference : </b>";
136 refValue += QString::number(valueRef);
137 overlayValue += QString::number(valueOver,'f',1);
138 diffValue += QString::number(valueRef - valueOver,'f',1);
140 refValueLabel->setText(refValue);
141 valueLabel->setText(overlayValue);
142 diffValueLabel->setText(diffValue);
144 void vvOverlayPanel::getFusionName(QString name)
146 QString filename = "<b>Fusion with : </b>";
147 filename += vtksys::SystemTools::GetFilenameWithoutExtension(name.toStdString()).c_str();
148 dataFusionnedLabel->setText(filename.toStdString().c_str());
151 void vvOverlayPanel::getFusionProperty(int opacity, int colormap, double window, double level)
156 fusionFrame->setEnabled(1);
157 opacityHorizontalSlider->setEnabled(1);
158 opacityHorizontalSlider->setValue(opacity);
159 fusionColorMapComboBox->setEnabled(1);
160 fusionColorMapComboBox->setCurrentIndex(colormap);
161 windowSpinBox->setEnabled(1);
162 levelSpinBox->setEnabled(1);
163 windowSpinBox->setValue(window);
164 levelSpinBox->setValue(level);
169 fusionFrame->setEnabled(0);
170 opacityHorizontalSlider->setEnabled(0);
171 opacityHorizontalSlider->setValue(0);
172 fusionColorMapComboBox->setEnabled(0);
173 fusionColorMapComboBox->setCurrentIndex(-1);
174 windowSpinBox->setEnabled(0);
175 levelSpinBox->setEnabled(0);
179 void vvOverlayPanel::setFusionProperty()
181 emit FusionPropertyUpdated(opacityHorizontalSlider->value(), fusionColorMapComboBox->currentIndex(),
182 windowSpinBox->value(), levelSpinBox->value());
185 void vvOverlayPanel::getCurrentFusionInfo(int visibility,double value)
187 QString fusionValue = "<b>Pixel value in image 2 : </b>";
190 fusionValue += QString::number(value,'f',1);
192 valueFusionnedLabel->setText(fusionValue);
195 #endif /* end #define _vvOverlayPanel_CXX */