<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;">
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">F1: </span><span style=" font-size:12pt;">Help (this window)</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; text-decoration: underline;">Slice Selection</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">F2:</span><span style=" font-size:12pt;"> Sagital</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">0,1,2,3,4,5</span><span style=" font-size:12pt;"> : Windowing Preset Selection</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">6,7,8,9</span><span style=" font-size:12pt;">: Colormap Selection</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">w</span><span style=" font-size:12pt;">: Local </span><span style=" font-size:12pt; text-decoration: underline;">w</span><span style=" font-size:12pt;">indowing around mouse cursor</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Ctrl+w</span><span style=" font-size:12pt;">: Idem for fusion or overlay</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; text-decoration: underline;">Miscellaneous</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">l</span><span style=" font-size:12pt;">: Toggle </span><span style=" font-size:12pt; text-decoration: underline;">l</span><span style=" font-size:12pt;">inear interpolation</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">c</span><span style=" font-size:12pt;">: Toggle </span><span style=" font-size:12pt; text-decoration: underline;">c</span><span style=" font-size:12pt;">ontour superposition mode</span></p></body></html></string>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
- <layout class="QGridLayout">
+ <layout class="QGridLayout" name="compareGridLayout">
<property name="margin">
<number>2</number>
</property>
</property>
</widget>
</item>
- <item row="1" column="2">
+ <item row="1" column="1" colspan="5">
<widget class="QSlider" name="colorHorizontalSlider">
<property name="maximum">
<number>359</number>
</property>
</widget>
</item>
- <item row="2" column="0" colspan="3">
+ <item row="2" column="0" colspan="5">
<widget class="QLabel" name="refValueLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
</property>
</widget>
</item>
- <item row="3" column="0" colspan="3">
+ <item row="3" column="0" colspan="5">
<widget class="QLabel" name="valueLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
</property>
</widget>
</item>
- <item row="4" column="0" colspan="3">
+ <item row="4" column="0" colspan="5">
<widget class="QLabel" name="diffValueLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
</property>
</widget>
</item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label_10">
+ <property name="text">
+ <string>Window :</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QDoubleSpinBox" name="overlayWindowSpinBox">
+ <property name="decimals">
+ <number>4</number>
+ </property>
+ <property name="minimum">
+ <double>-999999.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>999999.000000000000000</double>
+ </property>
+ <property name="singleStep">
+ <double>10.000000000000000</double>
+ </property>
+ <property name="value">
+ <double>100.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="2">
+ <widget class="QLabel" name="label_11">
+ <property name="text">
+ <string>Level :</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="3">
+ <widget class="QDoubleSpinBox" name="overlayLevelSpinBox">
+ <property name="decimals">
+ <number>4</number>
+ </property>
+ <property name="minimum">
+ <double>-999999.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>999999.000000000000000</double>
+ </property>
+ <property name="singleStep">
+ <double>10.000000000000000</double>
+ </property>
+ <property name="value">
+ <double>1000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="4">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="5" column="5">
+ <widget class="QCheckBox" name="overlayLinkCheckBox">
+ <property name="text">
+ <string>Link</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
- <layout class="QGridLayout" name="gridLayout">
+ <layout class="QGridLayout" name="fusionGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="maximumSize">
</widget>
</item>
<item row="4" column="2" colspan="2">
- <widget class="QDoubleSpinBox" name="windowSpinBox">
+ <widget class="QDoubleSpinBox" name="fusionWindowSpinBox">
<property name="decimals">
<number>4</number>
</property>
</widget>
</item>
<item row="4" column="5">
- <widget class="QDoubleSpinBox" name="levelSpinBox">
+ <widget class="QDoubleSpinBox" name="fusionLevelSpinBox">
<property name="decimals">
<number>4</number>
</property>
</layout>
</widget>
<resources>
- <include location="../vvIcons.qrc"/>
<include location="../vvIcons.qrc"/>
<include location="vvIcons.qrc"/>
</resources>
}
if(win!="" && lev!="") {
- window.WindowLevelChanged(atof(win.c_str()), atof(lev.c_str()), 6, 0);
+ window.SetWindowLevel(atof(win.c_str()), atof(lev.c_str()));
window.ApplyWindowLevelToAllImages();
}
connect(linkPanel,SIGNAL(addLink(QString,QString)),this,SLOT(AddLink(QString,QString)));
connect(linkPanel,SIGNAL(removeLink(QString,QString)),this,SLOT(RemoveLink(QString,QString)));
connect(overlayPanel,SIGNAL(VFPropertyUpdated(int,int,int,int,double,double,double)),this,SLOT(SetVFProperty(int,int,int,int,double,double,double)));
- connect(overlayPanel,SIGNAL(OverlayPropertyUpdated(int)),this,SLOT(SetOverlayProperty(int)));
+ connect(overlayPanel,SIGNAL(OverlayPropertyUpdated(int,int,double,double)),
+ this,SLOT(SetOverlayProperty(int,int,double,double)));
connect(overlayPanel,SIGNAL(FusionPropertyUpdated(int,int,int,double,double)),
this,SLOT(SetFusionProperty(int,int,int,double,double)));
connect(landmarksPanel,SIGNAL(UpdateRenderWindows()),this,SLOT(UpdateRenderWindows()));
this, SLOT(OverlayChanged(int,double,double)));
connect(mSlicerManagers.back(), SIGNAL(UpdateFusion(int, double)),
this, SLOT(FusionChanged(int,double)));
- connect(mSlicerManagers.back(), SIGNAL(WindowLevelChanged(double, double,int, int)),
- this,SLOT(WindowLevelChanged(double, double, int, int)));
+ connect(mSlicerManagers.back(), SIGNAL(WindowLevelChanged()),
+ this,SLOT(WindowLevelChanged()));
connect(mSlicerManagers.back(), SIGNAL(UpdateSlice(int,int)),
this,SLOT(UpdateSlice(int,int)));
connect(mSlicerManagers.back(), SIGNAL(UpdateTSlice(int, int)),
break;
}
}
- windowSpinBox->setValue(mSlicerManagers[index]->GetColorWindow());
- levelSpinBox->setValue(mSlicerManagers[index]->GetColorLevel());
- presetComboBox->setCurrentIndex(mSlicerManagers[index]->GetPreset());
- colorMapComboBox->setCurrentIndex(mSlicerManagers[index]->GetColorMap());
infoPanel->setFileName(image);
infoPanel->setDimension(dim);
break;
}
}
- windowSpinBox->setValue(mSlicerManagers[index]->GetColorWindow());
- levelSpinBox->setValue(mSlicerManagers[index]->GetColorLevel());
- presetComboBox->setCurrentIndex(mSlicerManagers[index]->GetPreset());
- colorMapComboBox->setCurrentIndex(mSlicerManagers[index]->GetColorMap());
+ WindowLevelChanged();
if (mSlicerManagers[index]->GetSlicer(0)->GetVF()) {
overlayPanel->getVFName(mSlicerManagers[index]->GetVFName().c_str());
}
if (mSlicerManagers[index]->GetSlicer(0)->GetOverlay()) {
overlayPanel->getOverlayName(mSlicerManagers[index]->GetOverlayName().c_str());
- overlayPanel->getOverlayProperty(mSlicerManagers[index]->GetOverlayColor());
} else {
overlayPanel->getOverlayName(mSlicerManagers[index]->GetOverlayName().c_str());
- overlayPanel->getOverlayProperty(-1);
}
if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) {
overlayPanel->getFusionName(mSlicerManagers[index]->GetFusionName().c_str());
- overlayPanel->getFusionProperty(mSlicerManagers[index]->GetFusionOpacity(),
- mSlicerManagers[index]->GetFusionThresholdOpacity(),
- mSlicerManagers[index]->GetFusionColorMap(),
- mSlicerManagers[index]->GetFusionWindow(),
- mSlicerManagers[index]->GetFusionLevel());
} else {
overlayPanel->getFusionName(mSlicerManagers[index]->GetFusionName().c_str());
- overlayPanel->getFusionProperty(-1, -1, -1, -1, -1);
}
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvMainWindow::WindowLevelChanged(double window, double level,int preset,int colormap)
+void vvMainWindow::WindowLevelChanged()
{
- windowSpinBox->setValue(window);
- levelSpinBox->setValue(level);
- colorMapComboBox->setCurrentIndex(colormap);
- presetComboBox->setCurrentIndex(preset);
+ // Base image
+ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
+ if(index==-1) return;
+ windowSpinBox->setValue(mSlicerManagers[index]->GetColorWindow());
+ levelSpinBox->setValue(mSlicerManagers[index]->GetColorLevel());
+ colorMapComboBox->setCurrentIndex(mSlicerManagers[index]->GetColorMap());
+ presetComboBox->setCurrentIndex(mSlicerManagers[index]->GetPreset());
+
+ // Overlay image
+ if (mSlicerManagers[index]->GetSlicer(0)->GetOverlay())
+ overlayPanel->getOverlayProperty(mSlicerManagers[index]->GetOverlayColor(),
+ mSlicerManagers[index]->GetLinkOverlayWindowLevel(),
+ mSlicerManagers[index]->GetOverlayColorWindow(),
+ mSlicerManagers[index]->GetOverlayColorLevel());
+ else
+ overlayPanel->getOverlayProperty(-1,0,0.,0.);
+
+ // Fusion image
+ if (mSlicerManagers[index]->GetSlicer(0)->GetFusion())
+ overlayPanel->getFusionProperty(mSlicerManagers[index]->GetFusionOpacity(),
+ mSlicerManagers[index]->GetFusionThresholdOpacity(),
+ mSlicerManagers[index]->GetFusionColorMap(),
+ mSlicerManagers[index]->GetFusionWindow(),
+ mSlicerManagers[index]->GetFusionLevel());
+ else
+ overlayPanel->getFusionProperty(-1, -1, -1, -1, -1);
}
//------------------------------------------------------------------------------
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvMainWindow::SetWindowLevel(double w, double l)
+{
+ windowSpinBox->setValue(w);
+ levelSpinBox->setValue(l);
+ presetComboBox->setCurrentIndex(6);
+ colorMapComboBox->setCurrentIndex(0);
+ UpdateWindowLevel();
+}
+//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::UpdateWindowLevel()
{
mSlicerManagers[index]->SetColorLevel(levelSpinBox->value());
mSlicerManagers[index]->SetPreset(presetComboBox->currentIndex());
mSlicerManagers[index]->Render();
- windowSpinBox->setValue(mSlicerManagers[index]->GetColorWindow());
- levelSpinBox->setValue(mSlicerManagers[index]->GetColorLevel());
+ WindowLevelChanged();
}
}
//------------------------------------------------------------------------------
error += mSlicerManagers[index]->GetLastError().c_str();
QMessageBox::information(this,tr("Problem reading image !"),error);
}
+ WindowLevelChanged();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvMainWindow::SetOverlayProperty(int color)
+void vvMainWindow::SetOverlayProperty(int color, int linked, double window, double level)
{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if (mSlicerManagers[index]->GetSlicer(0)->GetOverlay()) {
mSlicerManagers[index]->SetOverlayColor(color);
mSlicerManagers[index]->SetColorMap(0);
+ mSlicerManagers[index]->SetLinkOverlayWindowLevel(linked);
+ mSlicerManagers[index]->SetOverlayColorWindow(window);
+ mSlicerManagers[index]->SetOverlayColorLevel(level);
mSlicerManagers[index]->Render();
}
}
this, SLOT(OverlayChanged(int,double,double)));
connect(mSlicerManagers.back(), SIGNAL(UpdateFusion(int, double)),
this, SLOT(FusionChanged(int,double)));
- connect(mSlicerManagers.back(), SIGNAL(WindowLevelChanged(double, double,int, int)),
- this,SLOT(WindowLevelChanged(double, double, int, int)));
+ connect(mSlicerManagers.back(), SIGNAL(WindowLevelChanged()),
+ this,SLOT(WindowLevelChanged()));
connect(mSlicerManagers.back(), SIGNAL(UpdateSlice(int,int)),
this,SLOT(UpdateSlice(int,int)));
connect(mSlicerManagers.back(), SIGNAL(UpdateTSlice(int, int)),
void SegmentationOnCurrentImage();
void SurfaceViewerLaunch();
- void WindowLevelChanged(double window, double level,int preset, int colormap);
+ void WindowLevelChanged();
void UpdateSlice(int slicer, int slice);
void UpdateTSlice(int slicer, int slice);
void UpdateSliceRange(int slicer, int min, int max, int tmin, int tmax);
void WindowLevelEdited();
+ void SetWindowLevel(double w, double l);
void UpdateColorMap();
void UpdateWindowLevel();
void SwitchWindowLevel();
void ResetTransformationToIdentity();
void SetVFProperty(int subsampling,int scale,int lut, int width, double r, double g, double b);
- void SetOverlayProperty(int color);
+ void SetOverlayProperty(int color, int linked, double window, double level);
void SetFusionProperty(int opacity, int tresOpacity, int colormap,double window,double level);
void GoToCursor();
connect(opacityHorizontalSlider,SIGNAL(valueChanged(int)),this,SLOT(setFusionProperty()));
connect(thresOpacityHorizontalSlider,SIGNAL(valueChanged(int)),this,SLOT(setFusionProperty()));
connect(fusionColorMapComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(setFusionProperty()));
- connect(windowSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setFusionProperty()));
- connect(levelSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setFusionProperty()));
-
+ connect(fusionWindowSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setFusionProperty()));
+ connect(fusionLevelSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setFusionProperty()));
+ connect(overlayWindowSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setOverlayProperty()));
+ connect(overlayLevelSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setOverlayProperty()));
+ connect(overlayLinkCheckBox,SIGNAL(stateChanged(int)),this,SLOT(setOverlayProperty()));
+
disableFusionSignals = false;
}
imageComparedLabel->setText(filename.toStdString().c_str());
}
-void vvOverlayPanel::getOverlayProperty(int value)
+void vvOverlayPanel::getOverlayProperty(int color, int linked, double window, double level)
{
- if (value > -1) {
+ if (color > -1) {
compareFrame->show();
compareFrame->setEnabled(1);
colorHorizontalSlider->setEnabled(1);
- colorHorizontalSlider->setValue(value);
+ colorHorizontalSlider->setValue(color);
+ overlayLinkCheckBox->setCheckState( (linked)?Qt::Checked:Qt::Unchecked );
+ overlayWindowSpinBox->setValue(window);
+ overlayLevelSpinBox->setValue(level);
} else {
compareFrame->hide();
compareFrame->setEnabled(0);
void vvOverlayPanel::setOverlayProperty()
{
- emit OverlayPropertyUpdated(colorHorizontalSlider->value());
+ overlayWindowSpinBox->setEnabled(!overlayLinkCheckBox->checkState());
+ overlayLevelSpinBox->setEnabled(!overlayLinkCheckBox->checkState());
+ emit OverlayPropertyUpdated(colorHorizontalSlider->value(),
+ overlayLinkCheckBox->checkState(),
+ overlayWindowSpinBox->value(),
+ overlayLevelSpinBox->value());
}
void vvOverlayPanel::getCurrentOverlayInfo(int visibility,double valueOver, double valueRef)
opacityHorizontalSlider->setValue(opacity);
thresOpacityHorizontalSlider->setEnabled(1);
thresOpacityHorizontalSlider->setValue(thresOpacity);
- windowSpinBox->setEnabled(1);
- levelSpinBox->setEnabled(1);
- windowSpinBox->setValue(window);
- levelSpinBox->setValue(level);
+ fusionWindowSpinBox->setEnabled(1);
+ fusionLevelSpinBox->setEnabled(1);
+ fusionWindowSpinBox->setValue(window);
+ fusionLevelSpinBox->setValue(level);
// re-enable signals and trigger slot function
disableFusionSignals = false;
thresOpacityHorizontalSlider->setValue(0);
fusionColorMapComboBox->setEnabled(0);
fusionColorMapComboBox->setCurrentIndex(-1);
- windowSpinBox->setEnabled(0);
- levelSpinBox->setEnabled(0);
+ fusionWindowSpinBox->setEnabled(0);
+ fusionLevelSpinBox->setEnabled(0);
}
}
return;
emit FusionPropertyUpdated(opacityHorizontalSlider->value(), thresOpacityHorizontalSlider->value(), fusionColorMapComboBox->currentIndex(),
- windowSpinBox->value(), levelSpinBox->value());
+ fusionWindowSpinBox->value(), fusionLevelSpinBox->value());
}
void vvOverlayPanel::getCurrentFusionInfo(int visibility,double value)
void getVFProperty(int subsampling, int scale, int log);
void getVFName(QString name);
- void getOverlayProperty(int color);
+ void getOverlayProperty(int color, int linked, double window, double level);
void getOverlayName(QString name);
void getFusionProperty(int opacity, int thresOpacity, int colormap, double window, double level);
signals:
void VFPropertyUpdated(int subsampling, int scale, int log, int width, double r, double g, double b);
- void OverlayPropertyUpdated(int color);
+ void OverlayPropertyUpdated(int color, int linked, double window, double level);
void FusionPropertyUpdated(int opacity, int thresOpacity, int colormap, double window, double level);
this->WindowLevel = vvImageMapToWLColors::New();
this->InstallPipeline();
+
+ mLinkOverlayWindowLevel = true;
}
//------------------------------------------------------------------------------
}
//----------------------------------------------------------------------------
-
//----------------------------------------------------------------------------
void vvSlicer::SetColorLevel(double level)
{
}
//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+double vvSlicer::GetOverlayColorWindow()
+{
+ if(mOverlayMapper)
+ return mOverlayMapper->GetWindow();
+ else
+ return 0.;
+}
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+double vvSlicer::GetOverlayColorLevel()
+{
+ if(mOverlayMapper)
+ return mOverlayMapper->GetLevel();
+ else
+ return 0.;
+}
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+void vvSlicer::SetOverlayColorWindow(double window)
+{
+ mOverlayMapper->SetWindow(window);
+}
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+void vvSlicer::SetOverlayColorLevel(double level)
+{
+ mOverlayMapper->SetLevel(level);
+}
+//----------------------------------------------------------------------------
+
//----------------------------------------------------------------------------
// Returns the min an the max value in a 41x41 region around the mouse pointer
-void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max)
+void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max, vtkImageData *image)
{
//Get mouse pointer position in view coordinates
double fLocalExtents[6];
//Convert to image pixel coordinates (rounded)
int iLocalExtents[6];
for(int i=0; i<3; i++) {
- fLocalExtents[i*2 ] = (fLocalExtents[i*2 ] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
- fLocalExtents[i*2+1] = (fLocalExtents[i*2+1] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
+ fLocalExtents[i*2 ] = (fLocalExtents[i*2 ] - image->GetOrigin()[i])/image->GetSpacing()[i];
+ fLocalExtents[i*2+1] = (fLocalExtents[i*2+1] - image->GetOrigin()[i])/image->GetSpacing()[i];
iLocalExtents[i*2 ] = lrint(fLocalExtents[i*2 ]);
iLocalExtents[i*2+1] = lrint(fLocalExtents[i*2+1]);
}
vtkSmartPointer<vtkExtractVOI> voiFilter = vtkSmartPointer<vtkExtractVOI>::New();
- voiFilter->SetInput(this->GetInput());
+ voiFilter->SetInput(image);
voiFilter->SetVOI(iLocalExtents);
voiFilter->Update();
if (!voiFilter->GetOutput()->GetNumberOfPoints()) {
if (mOverlay && mOverlayActor->GetVisibility()) {
- mOverlayMapper->SetWindow(this->GetColorWindow());
- mOverlayMapper->SetLevel(this->GetColorLevel());
+ if(mLinkOverlayWindowLevel) {
+ mOverlayMapper->SetWindow(this->GetColorWindow());
+ mOverlayMapper->SetLevel(this->GetColorLevel());
+ }
mOverlayMapper->GetOutput()->SetUpdateExtent(mOverlayActor->GetDisplayExtent());
mOverlayMapper->GetOutput()->Update();
mOverlayMapper->Update();
void SetCornerAnnotationVisibility(bool s);
bool GetCornerAnnotationVisibility();
- void GetExtremasAroundMousePointer(double & min, double & max);
+ void GetExtremasAroundMousePointer(double & min, double & max, vtkImageData *image);
void UpdateLandmarks();
void ForceUpdateDisplayExtent();
virtual void SetColorWindow(double s);
virtual void SetColorLevel(double s);
+ double GetOverlayColorWindow();
+ double GetOverlayColorLevel();
+ bool GetLinkOverlayWindowLevel() { return mLinkOverlayWindowLevel; }
+
+ void SetOverlayColorWindow(double s);
+ void SetOverlayColorLevel(double s);
+ void SetLinkOverlayWindowLevel(bool b) { mLinkOverlayWindowLevel = b; }
+
/**
* When it is enabled, beware of a call to GetExtent.
* we must have setted mReducedExtent otherwhise random values
bool mUseReducedExtent;
int * mReducedExtent;
int * mInitialExtent;
+ bool mLinkOverlayWindowLevel;
private:
void UpdateOrientation();
}
//----------------------------------------------------------------------------
-
//----------------------------------------------------------------------------
void vvSlicerManager::SetColorLevel(double s)
{
}
//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+void vvSlicerManager::SetOverlayColorWindow(double s)
+{
+ for ( unsigned int i = 0; i < mSlicers.size(); i++) {
+ mSlicers[i]->SetOverlayColorWindow(s);
+ }
+}
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+void vvSlicerManager::SetOverlayColorLevel(double s)
+{
+ for ( unsigned int i = 0; i < mSlicers.size(); i++) {
+ mSlicers[i]->SetOverlayColorLevel(s);
+ }
+}
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+void vvSlicerManager::SetLinkOverlayWindowLevel(bool b)
+{
+ for ( unsigned int i = 0; i < mSlicers.size(); i++) {
+ mSlicers[i]->SetLinkOverlayWindowLevel(b);
+ }
+}
+//----------------------------------------------------------------------------
+
//----------------------------------------------------------------------------
void vvSlicerManager::SetCursorAndCornerAnnotationVisibility(int s)
{
}
//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+double vvSlicerManager::GetOverlayColorWindow()
+{
+ if (mSlicers.size())
+ return mSlicers[0]->GetOverlayColorWindow();
+ return -1;
+}
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+double vvSlicerManager::GetOverlayColorLevel()
+{
+ if (mSlicers.size())
+ return mSlicers[0]->GetOverlayColorLevel();
+ return -1;
+}
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+bool vvSlicerManager::GetLinkOverlayWindowLevel()
+{
+ if (mSlicers.size())
+ return mSlicers[0]->GetLinkOverlayWindowLevel();
+ return -1;
+}
+//----------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvSlicerManager::ResetTransformationToIdentity(const std::string actorType)
{
}
//----------------------------------------------------------------------------
+
//----------------------------------------------------------------------------
void vvSlicerManager::UpdateWindowLevel()
{
- emit WindowLevelChanged(mSlicers[0]->GetColorWindow(),mSlicers[0]->GetColorLevel(),mPreset,mColorMap);
+ emit WindowLevelChanged();
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
-void vvSlicerManager::SetLocalColorWindowing(const int slicer)
+void vvSlicerManager::SetLocalColorWindowing(const int slicer, const bool bCtrlKey)
{
double min, max;
- this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max);
- this->SetColorWindow(max-min);
- this->SetColorLevel(0.5*(min+max));
- this->UpdateWindowLevel();
+ int t = this->mSlicers[slicer]->GetTSlice();
+ if(bCtrlKey && this->mSlicers[slicer]->GetFusion()) {
+ this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max, this->mSlicers[slicer]->GetFusion()->GetVTKImages()[t]);
+ this->SetFusionWindow(max-min);
+ this->SetFusionLevel(0.5*(min+max));
+ this->SetColorMap(mColorMap);
+ }
+ else if(bCtrlKey && this->mSlicers[slicer]->GetOverlay()) {
+ this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max, this->mSlicers[slicer]->GetOverlay()->GetVTKImages()[t]);
+ if(this->mSlicers[slicer]->GetLinkOverlayWindowLevel()){
+ this->SetColorWindow(max-min);
+ this->SetColorLevel(0.5*(min+max));
+ } else {
+ this->SetOverlayColorWindow(max-min);
+ this->SetOverlayColorLevel(0.5*(min+max));
+ }
+ }
+ else {
+ this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max, this->mSlicers[slicer]->GetInput());
+ this->SetColorWindow(max-min);
+ this->SetColorLevel(0.5*(min+max));
+ this->SetPreset(6);
+ }
this->Render();
+ this->UpdateWindowLevel();
}
//----------------------------------------------------------------------------
void GenerateDefaultLookupTable();
void SetColorWindow(double s);
void SetColorLevel(double s);
- void SetLocalColorWindowing(const int slicer);
+ void SetOverlayColorWindow(double s);
+ void SetOverlayColorLevel(double s);
+ void SetLinkOverlayWindowLevel(bool b);
+ void SetLocalColorWindowing(const int slicer, const bool bCtrlKey);
void SetOpacity(int i, double factor);
void SetColorMap(int colormap);
void SetPreset(int preset);
double GetColorWindow();
double GetColorLevel();
+ double GetOverlayColorWindow();
+ double GetOverlayColorLevel();
+ bool GetLinkOverlayWindowLevel();
int GetColorMap() {
return mColorMap;
}
int GetOverlayColor() {
return mOverlayColor;
}
-
int GetFusionOpacity() {
return mFusionOpacity;
}
void UpdateSlice(int slicer, int slice);
void UpdateTSlice(int slicer, int slice);
void UpdateSliceRange(int slice, int min, int max, int tmin, int tmax);
- void WindowLevelChanged(double window, double level, int preset, int colormap);
+ void WindowLevelChanged();
void UpdateLinkManager(std::string, int slicer, double x, double y, double z, int temps);
void UpdateLinkedNavigation(std::string, vvSlicerManager*, vvSlicer*);
void LandmarkAdded();
return;
}
if (KeyPress == "w") {
- this->SM->SetLocalColorWindowing(VisibleInWindow);
+ this->SM->SetLocalColorWindowing(VisibleInWindow, bCtrlKey);
return;
}
if (KeyPress == "0") {
return;
}
if (KeyPress == "h") {
- std::cout << "KeyPress == \"h\"\n";
this->SM->SetCursorAndCornerAnnotationVisibility(0);
this->SM->Render();
return;
this->SM->SetColorWindow(window*dx);
this->SM->SetColorLevel(level-dy);
this->SM->SetPreset(6);
- this->SM->UpdateWindowLevel();
this->SM->Render();
+ this->SM->UpdateWindowLevel();
return;
}
}