]> Creatis software - cpPlugins.git/commitdiff
Some bugs
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 15 Dec 2014 14:47:51 +0000 (15:47 +0100)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 15 Dec 2014 14:47:51 +0000 (15:47 +0100)
cmake/cpPluginsConfig.cmake.in
lib/cpPlugins/Extensions/Visualization/MPRActors.cxx
lib/cpPlugins/Extensions/Visualization/MPRWithDifferentWindows.cxx
lib/cpPlugins/Extensions/Visualization/MPRWithDifferentWindows.h

index a31bc50f8a57827d65783e2f346623947cc163f2..23f0a8948d3c7852b3d6a076e1d3d8f049839557 100644 (file)
@@ -47,6 +47,16 @@ FIND_LIBRARY(
   @CMAKE_INSTALL_PREFIX@/lib
   )
 
+FIND_LIBRARY(
+  cpPlugins_Extensions_LIBRARY_NAME
+  cpPlugins_Extensions
+  PATHS
+  /usr/lib
+  /usr/local/lib
+  @PROJECT_BINARY_DIR@
+  @CMAKE_INSTALL_PREFIX@/lib
+  )
+
 FIND_LIBRARY(
   cpPlugins_LIBRARY_NAME
   cpPlugins
@@ -66,6 +76,7 @@ SET(
 SET(
   cpPlugins_Interface_LIBRARIES
   ${cpPlugins_Interface_LIBRARY_NAME}
+  ${cpPlugins_Extensions_LIBRARY_NAME}
   )
 SET(
   cpPlugins_LIBRARIES
index b8332786b7ad36d2afcdfc381c1b594554bf559b..e16ba0ad9e76a839cb1191185739fedc157abf99 100644 (file)
@@ -1,6 +1,7 @@
 #include <cpPlugins/Extensions/Visualization/MPRActors.h>
 
 #include <vtkImageData.h>
+#include <vtkLookupTable.h>
 #include <vtkOutlineSource.h>
 #include <vtkPolyDataMapper.h>
 #include <vtkProperty.h>
@@ -40,10 +41,10 @@ SetInputData( vtkImageData* image )
 
   for( int i = 0; i < 3; ++i )
   {
-    Slices[ i ]->SetInputConnection(
+    this->Slices[ i ]->SetInputConnection(
       this->ImageToWindowLevel->GetOutputPort( ), i
       );
-    Slices[ i ]->UpdateText( this->GetWindow( ), this->GetLevel( ) );
+    this->Slices[ i ]->UpdateText( this->GetWindow( ), this->GetLevel( ) );
 
   } // rof
 
@@ -139,6 +140,25 @@ SetInputData( vtkImageData* image )
 void cpPlugins::Extensions::Visualization::MPRActors::
 SetSegmentationData( vtkImageData* segmentation )
 {
+  double range[ 2 ];
+  this->Segmentation = segmentation;
+  this->Segmentation->GetScalarRange( range );
+
+  vtkSmartPointer< vtkLookupTable > lut =
+    vtkSmartPointer< vtkLookupTable >::New( );
+  lut->SetNumberOfTableValues( 2 );
+  lut->SetTableRange( range );
+  lut->SetTableValue( 0, 0, 0, 0, 0 );
+  lut->SetTableValue( 1, 1, 0, 0, 0.4 );
+
+  this->SegmentationToColors->SetInputData( this->Segmentation );
+  this->SegmentationToColors->SetLookupTable( lut );
+  this->SegmentationToColors->Update( );
+
+  for( int i = 0; i < 3; ++i )
+    this->Slices[ i ]->SetSegmentationConnection(
+      this->SegmentationToColors->GetOutputPort( )
+      );
 }
 
 // -------------------------------------------------------------------------
index f66c258f47d0292772374429de7cc5441565de44..e2716318d0aa63ed64a822c8a48de9426079e1f6 100644 (file)
@@ -89,6 +89,23 @@ SetImage( vtkImageData* image )
   this->RenderAll( );
 }
 
+// -------------------------------------------------------------------------
+void cpPlugins::Extensions::Visualization::MPRWithDifferentWindows::
+SetSegmentation( vtkImageData* image )
+{
+  this->m_MPRActors->SetSegmentationData( image );
+  this->m_MPRActors->PushDataInto(
+    this->m_Renderers[ 0 ],
+    this->m_Renderers[ 1 ],
+    this->m_Renderers[ 2 ],
+    this->m_Renderers[ 3 ]
+    );
+
+  this->Render( 0 );
+  this->Render( 1 );
+  this->Render( 2 );
+}
+
 // -------------------------------------------------------------------------
 void cpPlugins::Extensions::Visualization::MPRWithDifferentWindows::
 ResetCamera( const int& id )
index 152ea99ed6d41a7bca82691e232c99907bacac7b..bf15f04e0e95799e8310eb6ba7d9d67b75e48f05 100644 (file)
@@ -35,6 +35,7 @@ namespace cpPlugins
         virtual ~MPRWithDifferentWindows( );
 
         void SetImage( vtkImageData* image );
+        void SetSegmentation( vtkImageData* image );
 
         void ResetCamera( const int& id );
         void ResetCameras( );