vvStructureSetActor.cxx
vvROIActor.cxx
vvToolResample.cxx
+ vvBlendImageActor.cxx
)
QT4_WRAP_CPP(vv_SRCS
<item row="1" column="2">
<widget class="QSlider" name="colorHorizontalSlider">
<property name="maximum">
- <number>180</number>
+ <number>359</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
--- /dev/null
+ /*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ ======================================================================-====*/
+
+#include "vvBlendImageActor.h"
+
+#include <vtkOpenGLRenderWindow.h>
+#include <vtkOpenGLExtensionManager.h>
+#include <vtkOpenGLRenderer.h>
+#include <vtkOpenGL.h>
+#include <vtkgl.h>
+#include <vtkObjectFactory.h>
+
+vtkStandardNewMacro(vvBlendImageActor);
+
+vvBlendImageActor::vvBlendImageActor()
+{
+}
+
+vvBlendImageActor::~vvBlendImageActor()
+{
+}
+
+// Actual actor render method.
+void vvBlendImageActor::Render(vtkRenderer *ren)
+{
+ //Change blending to maximum per component instead of weighted sum
+ vtkOpenGLRenderWindow *renwin = dynamic_cast<vtkOpenGLRenderWindow*>(ren->GetRenderWindow());
+ vtkOpenGLExtensionManager *extensions = renwin->GetExtensionManager();
+ if (extensions->ExtensionSupported("GL_EXT_blend_minmax"))
+ {
+ extensions->LoadExtension("GL_EXT_blend_minmax");
+ vtkgl::BlendEquationEXT( vtkgl::MAX );
+ }
+
+ //Call normal render
+ vtkOpenGLImageActor::Render(ren);
+
+ //Move back blending to weighted sum
+ if (vtkgl::BlendEquationEXT!=0)
+ {
+ vtkgl::BlendEquationEXT( vtkgl::FUNC_ADD );
+ }
+}
+
+void vvBlendImageActor::PrintSelf(ostream& os, vtkIndent indent)
+{
+ this->Superclass::PrintSelf(os,indent);
+}
--- /dev/null
+ /*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ ======================================================================-====*/
+
+#ifndef VVBLENDIMAGEACTOR_H
+#define VVBLENDIMAGEACTOR_H
+
+#include <vtkActor.h>
+#include <vtkSmartPointer.h>
+#include <vtkOpenGLImageActor.h>
+
+class vvBlendImageActor : public vtkOpenGLImageActor
+{
+public:
+ static vvBlendImageActor *New();
+ vtkTypeMacro(vvBlendImageActor, vtkOpenGLImageActor);
+ virtual void PrintSelf(ostream& os, vtkIndent indent);
+
+ // Description:
+ // Implement base class method.
+ void Render(vtkRenderer *ren);
+
+protected:
+ vvBlendImageActor();
+ ~vvBlendImageActor();
+
+private:
+ vvBlendImageActor(const vvBlendImageActor&); // Not implemented.
+ void operator=(const vvBlendImageActor&); // Not implemented.
+};
+
+#endif
#include <vtkImageMapToWindowLevelColors.h>
#include <vtkImageData.h>
#include <vtkImageActor.h>
+#include <vvBlendImageActor.h>
#include <vtkToolkits.h>
#include <vtkObjectFactory.h>
#include <vtkPointData.h>
//------------------------------------------------------------------------------
-vtkImageActor* vvSlicer::GetOverlayActor() {
+vvBlendImageActor* vvSlicer::GetOverlayActor() {
return mOverlayActor.GetPointer();
}
//------------------------------------------------------------------------------
if (!mOverlayActor)
{
- mOverlayActor = vtkImageActor::New();
+ mOverlayActor = vvBlendImageActor::New();
mOverlayActor->SetInput(mOverlayMapper->GetOutput());
mOverlayActor->SetPickable(0);
mOverlayActor->SetVisibility(false);
class vtkProperty2D;
class vtkClipPolyData;
class vtkImageActor;
+class vvBlendImageActor;
class vtkBox;
class vtkCornerAnnotation;
class vtkExtractVOI;
}
vtkImageMapToWindowLevelColors* GetOverlayMapper();
- vtkImageActor* GetOverlayActor() ;
+ vvBlendImageActor* GetOverlayActor() ;
vtkImageMapToWindowLevelColors* GetFusionMapper() ;
vtkImageActor* GetFusionActor() ;
vtkActor* GetVFActor() ;
vvLandmarks* mLandmarks;
vtkSmartPointer<vtkImageMapToWindowLevelColors> mOverlayMapper;
- vtkSmartPointer<vtkImageActor> mOverlayActor;
+ vtkSmartPointer<vvBlendImageActor> mOverlayActor;
vtkSmartPointer<vtkImageMapToWindowLevelColors> mFusionMapper;
vtkSmartPointer<vtkImageActor> mFusionActor;
vtkSmartPointer<vtkCornerAnnotation> ca;
#include "vvImageReader.h"
#include "vvMesh.h"
#include "vvImageMapToWLColors.h"
+#include "vvBlendImageActor.h"
#include <vtkImageActor.h>
#include <vtkImageData.h>
void SetColorMap(int colormap);
void SetPreset(int preset);
void SetOverlayColor(int color) {
- mOverlayColor = color;
+ mOverlayColor = (color/60)*60; //SR: new vvBlendImageActor needs 0 or 255 per component
}
void SetFusionOpacity(int opacity) {
mFusionOpacity = opacity;