]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 23 Sep 2015 17:14:51 +0000 (19:14 +0200)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 23 Sep 2015 17:14:51 +0000 (19:14 +0200)
29 files changed:
appli/ImageMPR/ImageMPR.cxx
appli/ImageMPR/ImageMPR.h
appli/examples/CMakeLists.txt
appli/examples/example_MPR.cxx
appli/examples/example_MarchingCubes.cxx
appli/examples/example_OtsuFilter.cxx
appli/examples/example_RGBImageToHSVChannels.cxx
appli/examples/example_RGBImageToYPbPrChannels.cxx
appli/examples/example_ReadWriteImage.cxx
lib/cpExtensions/Visualization/ImageInteractorStyle.cxx
lib/cpExtensions/Visualization/MPRActors.cxx
lib/cpExtensions/Visualization/MPRActors.h
lib/cpExtensions/Visualization/MPRObjects.cxx [moved from lib/cpExtensions/Visualization/MPRWithDifferentWindows.cxx with 60% similarity]
lib/cpExtensions/Visualization/MPRObjects.h [new file with mode: 0644]
lib/cpExtensions/Visualization/MPRWithDifferentWindows.h [deleted file]
lib/cpPlugins/Interface/Mesh.cxx
lib/cpPlugins/Interface/Mesh.h
lib/cpPlugins/Interface/ParametersQtDialog.cxx
lib/cpPlugins/Interface/ProcessObject.cxx
lib/cpPlugins/Interface/ProcessObject.h
lib/cpPlugins/Interface/ProcessObject.hxx
lib/cpPlugins/Plugins/ImageReader.cxx
lib/cpPlugins/Plugins/ImageWriter.cxx
lib/cpPlugins/Plugins/MarchingCubes.cxx
lib/cpPlugins/Plugins/MeshReader.cxx
lib/cpPlugins/Plugins/MeshWriter.cxx
lib/cpPlugins/Plugins/OtsuThresholdImageFilter.cxx
lib/cpPlugins/Plugins/RGBImageToOtherChannelsFilter.cxx
lib/cpPlugins/Plugins/SecondRankDiffusionTensorToPolyData.cxx

index 337aac1b17d37a6b4d8888db828b0947700f2073..f17e7195a9ced54f8117268ad5dc78ec2e511678 100644 (file)
@@ -30,18 +30,13 @@ ImageMPR::ImageMPR( QWidget* parent )
   this->m_UI->setupUi( this );
 
   // Create and associate renderers
-  this->m_MPRActors = vtkSmartPointer< TMPRActors >::New( );
-
-  for( unsigned int i = 0; i < 4; ++i )
-  {
-    this->m_Renderers[ i ] = vtkSmartPointer< vtkRenderer >::New( );
-    this->m_Renderers[ i ]->SetBackground( 0.1, 0.3, 0.8 );
-
-  } // rof
-  this->m_UI->m_XPlaneVTK->GetRenderWindow( )->AddRenderer( this->m_Renderers[ 0 ] );
-  this->m_UI->m_YPlaneVTK->GetRenderWindow( )->AddRenderer( this->m_Renderers[ 1 ] );
-  this->m_UI->m_ZPlaneVTK->GetRenderWindow( )->AddRenderer( this->m_Renderers[ 2 ] );
-  this->m_UI->m_3DVTK->GetRenderWindow( )->AddRenderer( this->m_Renderers[ 3 ] );
+  this->m_MPRObjects = vtkSmartPointer< TMPRObjects >::New( );
+  this->m_MPRObjects->SetRenderWindows(
+    this->m_UI->m_XPlaneVTK->GetRenderWindow( ),
+    this->m_UI->m_YPlaneVTK->GetRenderWindow( ),
+    this->m_UI->m_ZPlaneVTK->GetRenderWindow( ),
+    this->m_UI->m_3DVTK->GetRenderWindow( )
+    );
 
   // signals <-> slots
   QObject::connect(
@@ -80,6 +75,9 @@ ImageMPR::
 bool ImageMPR::
 _LoadPlugins( const std::string& filename )
 {
+  QApplication::setOverrideCursor( Qt::WaitCursor );
+  this->setEnabled( false );
+
   this->m_ImageReaderClass = "";
   this->m_ImageWriterClass = "";
   this->m_MeshReaderClass = "";
@@ -134,6 +132,9 @@ _LoadPlugins( const std::string& filename )
     } // fi
 
   } // rof
+  QApplication::restoreOverrideCursor( );
+  this->setEnabled( true );
+
   return( true );
 }
 
@@ -168,7 +169,7 @@ _triggered_actionOpenInputImage( )
   dialog.setFileMode( QFileDialog::ExistingFiles );
   dialog.setDirectory( tr( "." ) );
   dialog.setNameFilter(
-    tr( "Medical image files (*.mhd *.bin *.dcm *.nrri);;All files (*)" )
+    tr( "Medical image files (*.mhd *.bin *.dcm);;All files (*)" )
     );
   dialog.setDefaultSuffix( tr( "mhd" ) );
   if( !( dialog.exec( ) ) )
@@ -189,40 +190,34 @@ _triggered_actionOpenInputImage( )
   reader->SetParameters( reader_params );
 
   // Execute and get error message, if any
+  QApplication::setOverrideCursor( Qt::WaitCursor );
+  this->setEnabled( false );
   std::string err = reader->Update( );
+  QApplication::restoreOverrideCursor( );
+  this->setEnabled( true );
 
   // Assign fresh image, if any
   if( err == "" )
   {
-    this->m_InputImage =
-      dynamic_cast< TPluginImage* >( reader->GetOutput( 0 ) );
+    this->m_InputImage = reader->GetOutput< TPluginImage >( 0 );
     reader->DisconnectOutputs( );
     if( this->m_InputImage.IsNotNull( ) )
     {
-      this->m_MPRActors->SetInputData( this->m_InputImage->GetVTKImageData( ) );
-      this->m_MPRActors->PushDataInto(
-        this->m_Renderers[ 0 ],
-        this->m_Renderers[ 1 ],
-        this->m_Renderers[ 2 ],
-        this->m_Renderers[ 3 ]
-        );
-
-      /*
-        this->m_MPR.AssociatePlaneInteractor( 0, this->m_UI->m_XPlaneVTK->GetRenderWindow( )->GetInteractor( ) );
-        this->m_MPR.AssociatePlaneInteractor( 1, this->m_UI->m_YPlaneVTK->GetRenderWindow( )->GetInteractor( ) );
-        this->m_MPR.AssociatePlaneInteractor( 2, this->m_UI->m_ZPlaneVTK->GetRenderWindow( )->GetInteractor( ) );
-      */
+      vtkImageData* vtk_id = this->m_InputImage->GetVTKImageData( );
+      if( vtk_id != NULL )
+      {
+        this->m_MPRObjects->SetImage( vtk_id );
+        this->m_MPRObjects->ResetCameras( );
+        this->m_MPRObjects->RenderAll( );
+      }
+      else
+        QMessageBox::critical(
+          this,
+          tr( "Error message" ),
+          tr( "Read image does not have a valid VTK converter." )
+          );
 
     } // fi
-    this->m_Renderers[ 0 ]->ResetCamera( );
-    this->m_Renderers[ 1 ]->ResetCamera( );
-    this->m_Renderers[ 2 ]->ResetCamera( );
-    this->m_Renderers[ 3 ]->ResetCamera( );
-
-    this->m_UI->m_XPlaneVTK->GetRenderWindow( )->Render( );
-    this->m_UI->m_YPlaneVTK->GetRenderWindow( )->Render( );
-    this->m_UI->m_ZPlaneVTK->GetRenderWindow( )->Render( );
-    this->m_UI->m_3DVTK->GetRenderWindow( )->Render( );
   }
   else
     QMessageBox::critical(
@@ -236,64 +231,73 @@ _triggered_actionOpenInputImage( )
 void ImageMPR::
 _triggered_actionOpenInputPolyData( )
 {
-  /*
   // Show dialog and check if it was accepted
   QFileDialog dialog( this );
   dialog.setFileMode( QFileDialog::ExistingFile );
-  dialog.setDirectory( "." );
-  dialog.setNameFilter( tr( "VTK file (*.vtk);;All files (*)" ) );
+  dialog.setDirectory( tr( "." ) );
+  dialog.setNameFilter(
+    tr( "Mesh files (*.vtk *.obj);;All files (*)" )
+    );
   dialog.setDefaultSuffix( tr( "vtk" ) );
   if( !( dialog.exec( ) ) )
     return;
   
-  std::string fname = dialog.selectedFiles( ).at( 0 ).toStdString( );
-
   this->m_InputMesh = NULL;
 
   // Get a reader from plugins
   TPluginFilter::Pointer reader =
-    this->m_Plugins.CreateProcessObject(
-      this->m_BaseClasses[ "MeshReader" ]
-      );
+    this->m_Plugins.CreateProcessObject( this->m_MeshReaderClass );
 
-  // Configure plugin
+  // Configure reader
   TParameters reader_params = reader->GetDefaultParameters( );
-  reader_params.SetValueAsString( "FileName", fname );
+  QStringList q_fnames = dialog.selectedFiles( );
+  QStringList::const_iterator qIt = q_fnames.begin( );
+  for( ; qIt != q_fnames.end( ); ++qIt )
+    reader_params.SetValueAsString( "FileName", qIt->toStdString( ) );
   reader->SetParameters( reader_params );
 
   // Execute and get error message, if any
+  QApplication::setOverrideCursor( Qt::WaitCursor );
+  this->setEnabled( false );
   std::string err = reader->Update( );
+  QApplication::restoreOverrideCursor( );
+  this->setEnabled( true );
+
 
   // Assign fresh image, if any
   if( err == "" )
   {
-    this->m_InputMesh =
-      dynamic_cast< TPluginMesh* >( reader->GetOutput( 0 ) );
+    this->m_InputMesh = reader->GetOutput< TPluginMesh >( 0 );
     reader->DisconnectOutputs( );
     if( this->m_InputMesh.IsNotNull( ) )
     {
-      this->m_InputMeshMapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
-      this->m_InputMeshMapper->SetInputData( this->m_InputMesh->GetVTKPolyData( ) );
-      this->m_InputMeshActor = vtkSmartPointer< vtkActor >::New( );
-      this->m_InputMeshActor->SetMapper( this->m_InputMeshMapper );
-      this->m_MPR->Add3DActor( this->m_InputMeshActor );
+      vtkActor* vtk_actor = this->m_InputMesh->GetVTKActor( );
+      if( vtk_actor != NULL )
+      {
+        this->m_MPRObjects->Get3DRenderer( )->AddActor( vtk_actor );
+        this->m_MPRObjects->Render( 4 );
+      }
+      else
+        QMessageBox::critical(
+          this,
+          tr( "Error message" ),
+          tr( "Read mesh does not have a valid vtkActor." )
+          );
 
     } // fi
   }
   else
     QMessageBox::critical(
       this,
-      tr( "Error reading polydata" ),
+      tr( "Error reading mesh" ),
       tr( err.c_str( ) )
       );
-  */
 }
 
 // -------------------------------------------------------------------------
 void ImageMPR::
 _triggered_actionImageToImage( )
 {
-  /* TODO
   if( this->m_InputImage.IsNull( ) )
     return;
 
@@ -315,19 +319,22 @@ _triggered_actionImageToImage( )
     return;
 
   // Execute filter
+  QApplication::setOverrideCursor( Qt::WaitCursor );
+  this->setEnabled( false );
   filter->SetParameters( parameters );
   filter->SetInput( 0, this->m_InputImage );
   std::string err = filter->Update( );
+  QApplication::restoreOverrideCursor( );
+  this->setEnabled( true );
 
   // Update image
   if( err == "" )
   {
-    TPluginImage* result =
-      dynamic_cast< TPluginImage* >( filter->GetOutput( 0 ) );
+    TPluginImage* result = filter->GetOutput< TPluginImage >( 0 );
     result->DisconnectPipeline( );
     this->m_InputImage = result;
     if( this->m_InputImage.IsNotNull( ) )
-      this->m_MPR->SetImage( this->m_InputImage->GetVTKImageData( ) );
+      this->m_MPRObjects->SetImage( this->m_InputImage->GetVTKImageData( ) );
   }
   else
     QMessageBox::critical(
@@ -335,7 +342,6 @@ _triggered_actionImageToImage( )
       tr( "Error executing filter" ),
       tr( err.c_str( ) )
       );
-  */
 }
 
 // -------------------------------------------------------------------------
@@ -363,21 +369,24 @@ _triggered_actionImageToMesh( )
     return;
 
   // Execute filter
+  QApplication::setOverrideCursor( Qt::WaitCursor );
+  this->setEnabled( false );
   filter->SetParameters( parameters );
   filter->SetInput( 0, this->m_InputImage );
   std::string err = filter->Update( );
+  QApplication::restoreOverrideCursor( );
+  this->setEnabled( true );
 
   // Update image
   if( err == "" )
   {
-    /* TODO
-       TPluginImage* result =
-       dynamic_cast< TPluginImage* >( filter->GetOutput( 0 ) );
-       result->DisconnectPipeline( );
-       this->m_InputImage = result;
-       if( this->m_InputImage.IsNotNull( ) )
-       this->m_MPR->SetImage( this->m_InputImage->GetVTKImageData( ) );
-    */
+    TPluginMesh* result = filter->GetOutput< TPluginMesh >( 0 );
+    result->DisconnectPipeline( );
+    this->m_InputMesh = result;
+    if( this->m_InputMesh.IsNotNull( ) )
+      this->m_MPRObjects->Get3DRenderer( )->AddActor(
+        this->m_InputMesh->GetVTKActor( )
+        );
   }
   else
     QMessageBox::critical(
index 808c0ab012407e6b11a681e46b2cd0c9428de39c..ba05de9f9de5c0f88264f967132f8b1c3c93b35a 100644 (file)
@@ -9,9 +9,8 @@
 #include <QMainWindow>
 
 // vtk stuff
-#include <vtkRenderer.h>
 #include <vtkSmartPointer.h>
-#include <cpExtensions/Visualization/MPRActors.h>
+#include <cpExtensions/Visualization/MPRObjects.h>
 
 // Plugins interface
 #include <cpPlugins/Interface/Interface.h>
@@ -44,7 +43,7 @@ public:
   typedef cpPlugins::Interface::Parameters    TParameters;
 
   typedef std::set< std::string > TStringContainer;
-  typedef cpExtensions::Visualization::MPRActors TMPRActors;
+  typedef cpExtensions::Visualization::MPRObjects TMPRObjects;
 
 public:
   explicit ImageMPR( QWidget* parent = 0 );
@@ -79,10 +78,7 @@ private:
   TPluginMesh::Pointer  m_InputMesh;
 
   // Visualization stuff
-  vtkSmartPointer< TMPRActors >        m_MPRActors;
-  vtkSmartPointer< vtkRenderer >       m_Renderers[ 4 ];
-  vtkSmartPointer< vtkPolyDataMapper > m_InputMeshMapper;
-  vtkSmartPointer< vtkActor >          m_InputMeshActor;
+  vtkSmartPointer< TMPRObjects > m_MPRObjects;
 
   /* TODO
      vtkSmartPointer< vtkOrientationMarkerWidget > m_3DOrientationWidget;
index f233136b0c8d72eab44ea6f0f642230e56c588ac..586eddf18764c678ea82b15248fef7bb6e52442a 100644 (file)
@@ -25,6 +25,7 @@ FOREACH(prog ${EXAMPLES_PROGRAMS})
     )
   TARGET_LINK_LIBRARIES(
     ${prog}
+    cpExtensions
     cpPlugins_Interface
     )
 ENDFOREACH(prog)
index 1691e089a0ab571acf47238508146bc5a6327176..502302c48b7f1d2dcda5173f1125b3ca8c2d67ab 100644 (file)
 #include <cpPlugins/Interface/Interface.h>
 #include <cpPlugins/Interface/ProcessObject.h>
 #include <cpPlugins/Interface/Image.h>
-#include <cpExtensions/Visualization/MPRObjects.h>
 
+#include <vtkSmartPointer.h>
+#include <vtkCommand.h>
 #include <vtkRenderer.h>
 #include <vtkRenderWindow.h>
 #include <vtkRenderWindowInteractor.h>
+#include <vtkSliderRepresentation2D.h>
+#include <vtkSliderWidget.h>
 
+#include <cpExtensions/Visualization/MPRActors.h>
+
+// -------------------------------------------------------------------------
+typedef cpPlugins::Interface::Interface     TInterface;
+typedef cpPlugins::Interface::ProcessObject TFilter;
+typedef cpPlugins::Interface::Parameters    TParameters;
+typedef cpPlugins::Interface::Image         TImage;
+
+typedef cpExtensions::Visualization::MPRActors TMPRActors;
+
+// -------------------------------------------------------------------------
+class SliderCallback
+  : public vtkCommand
+{
+public:
+  static SliderCallback* New( )
+    {
+      return new SliderCallback;
+    }
+  virtual void Execute( vtkObject* caller, unsigned long eId , void* data )
+    {
+      vtkSliderWidget* wdg =
+        reinterpret_cast< vtkSliderWidget* >( caller );
+      if( wdg == NULL )
+        return;
+      vtkSliderRepresentation* rep =
+        static_cast< vtkSliderRepresentation* >(
+          wdg->GetRepresentation( )
+          );
+      if( rep == NULL )
+        return;
+      std::string title = rep->GetTitleText( );
+      if( title == "X" )
+        this->Actors->SetSlice( 0, int( rep->GetValue( ) ) );
+      else if( title == "Y" )
+        this->Actors->SetSlice( 1, int( rep->GetValue( ) ) );
+      else if( title == "Z" )
+        this->Actors->SetSlice( 2, int( rep->GetValue( ) ) );
+      else if( title == "Window" )
+        this->Actors->SetWindow( rep->GetValue( ) );
+      else if( title == "Level" )
+        this->Actors->SetLevel( rep->GetValue( ) );
+    }
+  SliderCallback( )
+    : vtkCommand( )
+    {
+    }
+
+public:
+  TMPRActors* Actors;
+};
+
+// -------------------------------------------------------------------------
+struct Slider
+{
+  vtkSmartPointer< vtkSliderRepresentation2D > Representation;
+  vtkSmartPointer< vtkSliderWidget >           Widget;
+
+  Slider(
+    double min_value,
+    double max_value,
+    double value,
+    const std::string& title,
+    vtkRenderWindowInteractor* iren,
+    double p1x, double p1y, double p2x, double p2y,
+    SliderCallback* callback = NULL
+    )
+    {
+      this->Representation =
+        vtkSmartPointer< vtkSliderRepresentation2D >::New( );
+      this->Representation->SetMinimumValue( min_value );
+      this->Representation->SetMaximumValue( max_value );
+      this->Representation->SetValue( value );
+      this->Representation->SetTitleText( title.c_str( ) );
+      this->Representation->GetPoint1Coordinate( )->
+        SetCoordinateSystemToNormalizedDisplay();
+      this->Representation->GetPoint1Coordinate( )->
+        SetValue( p1x, p1y );
+      this->Representation->GetPoint2Coordinate( )->
+        SetCoordinateSystemToNormalizedDisplay();
+      this->Representation->GetPoint2Coordinate( )->SetValue( p2x, p2y );
+
+      this->Widget = vtkSmartPointer< vtkSliderWidget >::New( );
+      this->Widget->SetInteractor( iren );
+      this->Widget->SetRepresentation( this->Representation );
+      this->Widget->SetAnimationModeToAnimate( );
+      this->Widget->EnabledOn( );
+      if( callback != NULL )
+        this->Widget->AddObserver( vtkCommand::InteractionEvent, callback );
+    }
+};
+
+// -------------------------------------------------------------------------
 int main( int argc, char* argv[] )
 {
   if( argc < 3 )
@@ -25,20 +121,15 @@ int main( int argc, char* argv[] )
   std::string plugins_file = argv[ 1 ];
 
   // Create interface
-  typedef cpPlugins::Interface::Interface TInterface;
-  typedef TInterface::TClasses            TClasses;
-
   TInterface plugins;
   plugins.Load( plugins_file );
 
-  // Create objects
-  typedef cpPlugins::Interface::ProcessObject TProcessObject;
-  typedef cpPlugins::Interface::Parameters    TParameters;
-  cpPlugins::Interface::ProcessObject::Pointer reader;
-  reader = plugins.CreateProcessObject( "cpPlugins::ImageReader" );
+  // Create reader
+  TFilter::Pointer reader =
+    plugins.CreateProcessObject( "cpPlugins::ImageReader" );
   if( reader.IsNull( ) )
   {
-    std::cerr << "No suitable reader found in plugins." << std::endl;
+    std::cerr << "No suitable image reader found in plugins." << std::endl;
     return( 1 );
 
   } // fi
@@ -57,10 +148,10 @@ int main( int argc, char* argv[] )
     return( 1 );
 
   } // fi
-  cpPlugins::Interface::Image* image =
-    dynamic_cast< cpPlugins::Interface::Image* >( reader->GetOutput( 0 ) );
-  vtkImageData* vtk_image = image->GetVTKImageData( );
-  if( vtk_image == NULL )
+
+  // Get input image's vtk representation
+  vtkImageData* image = reader->GetOutput< TImage >( 0 )->GetVTKImageData( );
+  if( image == NULL )
   {
     std::cerr
       << "ERROR: read image does not have a valid VTK conversion."
@@ -85,13 +176,51 @@ int main( int argc, char* argv[] )
   interactor->SetRenderWindow( window );
 
   // Actors
-  cpExtensions::Visualization::MPRObjects mpr;
-  mpr.SetImage( vtk_image );
-  /*
-    mpr.AssociatePlaneInteractor( 0, interactor );
-    mpr.AssociatePlaneInteractor( 1, interactor );
-    mpr.AssociatePlaneInteractor( 2, interactor );
-  */
+  vtkSmartPointer< TMPRActors > mpr_actors =
+    vtkSmartPointer< TMPRActors >::New( );
+  mpr_actors->SetInputData( image );
+  mpr_actors->PushDataInto( NULL, NULL, NULL, renderer );
+
+  // Callbacks
+  vtkSmartPointer< SliderCallback > cb =
+    vtkSmartPointer< SliderCallback >::New( );
+  cb->Actors = mpr_actors;
+
+  Slider x_slider(
+    mpr_actors->GetSliceNumberMinValue( 0 ),
+    mpr_actors->GetSliceNumberMaxValue( 0 ),
+    mpr_actors->GetSliceNumberMinValue( 0 ),
+    "X", interactor,
+    0.100, 0.15, 0.290, 0.15, cb
+    );
+  Slider y_slider(
+    mpr_actors->GetSliceNumberMinValue( 1 ),
+    mpr_actors->GetSliceNumberMaxValue( 1 ),
+    mpr_actors->GetSliceNumberMinValue( 1 ),
+    "Y", interactor,
+    0.300, 0.15, 0.490, 0.15, cb
+    );
+  Slider z_slider(
+    mpr_actors->GetSliceNumberMinValue( 2 ),
+    mpr_actors->GetSliceNumberMaxValue( 2 ),
+    mpr_actors->GetSliceNumberMinValue( 2 ),
+    "Z", interactor,
+    0.500, 0.15, 0.690, 0.15, cb
+    );
+  Slider w_slider(
+    mpr_actors->GetMinWindow( ),
+    mpr_actors->GetMaxWindow( ),
+    mpr_actors->GetWindow( ),
+    "Window", interactor,
+    0.100, 0.05, 0.290, 0.05, cb
+    );
+  Slider l_slider(
+    mpr_actors->GetMinWindow( ),
+    mpr_actors->GetMaxWindow( ),
+    mpr_actors->GetWindow( ),
+    "Level", interactor,
+    0.300, 0.05, 0.490, 0.05, cb
+    );
 
   // Begin interaction
   renderer->ResetCamera( );
index 7894fe0e18a47b7b5f8cec4b2e23c0eca1ef5ef1..fbd43bb4dc21c3f1fca02195d21a5c3beda4c7c0 100644 (file)
@@ -30,6 +30,7 @@ int main( int argc, char* argv[] )
 
   // Create objects
   typedef cpPlugins::Interface::ProcessObject TProcessObject;
+  typedef cpPlugins::Interface::DataObject    TDataObject;
   typedef cpPlugins::Interface::Parameters    TParameters;
   cpPlugins::Interface::ProcessObject::Pointer reader, writer, mc;
   reader = plugins.CreateProcessObject( "cpPlugins::ImageReader" );
@@ -59,8 +60,8 @@ int main( int argc, char* argv[] )
   writer->SetParameters( writer_params );
 
   // Connect pipeline
-  mc->SetInput( 0, reader->GetOutput( 0 ) );
-  writer->SetInput( 0, mc->GetOutput( 0 ) );
+  mc->SetInput( 0, reader->GetOutput< TDataObject >( 0 ) );
+  writer->SetInput( 0, mc->GetOutput< TDataObject >( 0 ) );
 
   // Execute pipeline
   std::string err = writer->Update( );
index 9f91835cfbff2ad65712d494fa86fa0523e3490a..21c7a7e2996a7ebbf6163e1865669a6cb18fbd3b 100644 (file)
@@ -30,6 +30,7 @@ int main( int argc, char* argv[] )
 
   // Create objects
   typedef cpPlugins::Interface::ProcessObject TProcessObject;
+  typedef cpPlugins::Interface::DataObject    TDataObject;
   typedef cpPlugins::Interface::Parameters    TParameters;
   cpPlugins::Interface::ProcessObject::Pointer reader, writer, otsu;
   reader = plugins.CreateProcessObject( "cpPlugins::ImageReader" );
@@ -61,8 +62,8 @@ int main( int argc, char* argv[] )
   writer->SetParameters( writer_params );
 
   // Connect pipeline
-  otsu->SetInput( 0, reader->GetOutput( 0 ) );
-  writer->SetInput( 0, otsu->GetOutput( 0 ) );
+  otsu->SetInput( 0, reader->GetOutput< TDataObject >( 0 ) );
+  writer->SetInput( 0, otsu->GetOutput< TDataObject >( 0 ) );
 
   // Execute pipeline
   std::string err = writer->Update( );
index 03d0eea05ff47583f445fa521681b523f9de02ac..57d0581ad4ad3a4b165a197c5557079de3c12368 100644 (file)
@@ -30,6 +30,7 @@ int main( int argc, char* argv[] )
 
   // Create objects
   typedef cpPlugins::Interface::ProcessObject TProcessObject;
+  typedef cpPlugins::Interface::DataObject    TDataObject;
   typedef cpPlugins::Interface::Parameters    TParameters;
   cpPlugins::Interface::ProcessObject::Pointer reader, writer, filter;
   reader = plugins.CreateProcessObject( "cpPlugins::ImageReader" );
@@ -59,8 +60,8 @@ int main( int argc, char* argv[] )
   writer->SetParameters( writer_params );
 
   // Connect pipeline
-  filter->SetInput( 0, reader->GetOutput( 0 ) );
-  writer->SetInput( 0, filter->GetOutput( 0 ) );
+  filter->SetInput( 0, reader->GetOutput< TDataObject >( 0 ) );
+  writer->SetInput( 0, filter->GetOutput< TDataObject >( 0 ) );
 
   // Execute pipeline
   std::string err = writer->Update( );
index 7806289dcd3fc5cad3d7ae78895927860ddc25d3..d589db9380d27f59896a7eb49aaab425ca46ed36 100644 (file)
@@ -30,6 +30,7 @@ int main( int argc, char* argv[] )
 
   // Create objects
   typedef cpPlugins::Interface::ProcessObject TProcessObject;
+  typedef cpPlugins::Interface::DataObject    TDataObject;
   typedef cpPlugins::Interface::Parameters    TParameters;
   cpPlugins::Interface::ProcessObject::Pointer reader, writer, filter;
   reader = plugins.CreateProcessObject( "cpPlugins::ImageReader" );
@@ -59,8 +60,8 @@ int main( int argc, char* argv[] )
   writer->SetParameters( writer_params );
 
   // Connect pipeline
-  filter->SetInput( 0, reader->GetOutput( 0 ) );
-  writer->SetInput( 0, filter->GetOutput( 0 ) );
+  filter->SetInput( 0, reader->GetOutput< TDataObject >( 0 ) );
+  writer->SetInput( 0, filter->GetOutput< TDataObject >( 0 ) );
 
   // Execute pipeline
   std::string err = writer->Update( );
index 0098973bd520c79049c6a60112d1327664adce30..5f01b44bc569247dfaaa3f222fdc354bb55a9b7e 100644 (file)
@@ -32,6 +32,7 @@ int main( int argc, char* argv[] )
 
   // Create objects
   typedef cpPlugins::Interface::ProcessObject TProcessObject;
+  typedef cpPlugins::Interface::DataObject    TDataObject;
   typedef cpPlugins::Interface::Parameters    TParameters;
   cpPlugins::Interface::ProcessObject::Pointer reader, writer;
   reader = plugins.CreateProcessObject( "cpPlugins::ImageReader" );
@@ -61,7 +62,7 @@ int main( int argc, char* argv[] )
   writer->SetParameters( writer_params );
 
   // Connect pipeline
-  writer->SetInput( 0, reader->GetOutput( 0 ) );
+  writer->SetInput( 0, reader->GetOutput< TDataObject >( 0 ) );
 
   // Execute pipeline
   std::string err = writer->Update( );
@@ -72,8 +73,6 @@ int main( int argc, char* argv[] )
 
   } // fi
 
-  dynamic_cast< cpPlugins::Interface::Image* >( reader->GetOutput( 0 ) )->GetVTKImageData( )->Print( std::cout );
-
   return( 0 );
 }
 
index 236fb43144f92da41dce1a664bb67e7578edd9d1..9dec0321ce99ff83cbd02a1a5756a9473326f27b 100644 (file)
@@ -315,6 +315,10 @@ OnMouseWheelForward( )
   int s = this->m_SliceActors->GetSliceNumber( ) + off;
   int maxs = this->m_SliceActors->GetSliceNumberMaxValue( );
   this->m_SliceActors->SetSliceNumber( ( s < maxs )? s: maxs );
+  this->m_MPRActors->SetSlice(
+    this->m_SliceActors->GetAxis( ),
+    this->m_SliceActors->GetSliceNumber( )
+    );
   this->Interactor->Render( );
   this->_RenderAssociateInteractors( );
 }
@@ -331,6 +335,10 @@ OnMouseWheelBackward( )
   int s = this->m_SliceActors->GetSliceNumber( ) - off;
   int mins = this->m_SliceActors->GetSliceNumberMinValue( );
   this->m_SliceActors->SetSliceNumber( ( mins < s )? s: mins );
+  this->m_MPRActors->SetSlice(
+    this->m_SliceActors->GetAxis( ),
+    this->m_SliceActors->GetSliceNumber( )
+    );
   this->Interactor->Render( );
   this->_RenderAssociateInteractors( );
 }
index 43600a36652f70118740881889814558f19e27ae..2f7ce682a97e80585589e6a01a14873b52b3636a 100644 (file)
@@ -22,7 +22,7 @@ ImageSliceActors* cpExtensions::Visualization::MPRActors::
 GetSliceActors( const int& i ) const
 {
   if( i < 3 )
-    return( this->Slices[ i ] );
+    return( this->Slices[ 0 ][ i ] );
   else
     return( NULL );
 }
@@ -47,28 +47,29 @@ SetInputData( vtkImageData* image )
 
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::MPRActors::
-PushDataInto( vtkRenderer* x, vtkRenderer* y, vtkRenderer* z, vtkRenderer* w )
+PushDataInto(
+  vtkRenderer* x, vtkRenderer* y, vtkRenderer* z, vtkRenderer* w
+  )
 {
   vtkRenderer* rends[] = { x, y, z };
   for( int i = 0; i < 3; ++i )
   {
     if( rends[ i ] != NULL )
     {
-      rends[ i ]->AddActor( this->Slices[ i ]->GetImageActor( ) );
-      rends[ i ]->AddActor( this->Slices[ i ]->GetTextActor( ) );
+      rends[ i ]->AddActor( this->Slices[ 0 ][ i ]->GetImageActor( ) );
+      rends[ i ]->AddActor( this->Slices[ 0 ][ i ]->GetTextActor( ) );
       for( int j = 0; j < 3; ++j )
-        rends[ i ]->AddActor( this->Slices[ j ]->GetPlaneActor( ) );
-      if( w != NULL )
-      {
-        w->AddActor( this->Slices[ i ]->GetImageActor( ) );
-        w->AddActor( this->Slices[ i ]->GetPlaneActor( ) );
+        rends[ i ]->AddActor( this->Slices[ 0 ][ j ]->GetPlaneActor( ) );
 
-      } // fi
+    } // fi
+    if( w != NULL )
+    {
+      w->AddActor( this->Slices[ 1 ][ i ]->GetImageActor( ) );
+      w->AddActor( this->Slices[ 1 ][ i ]->GetPlaneActor( ) );
 
     } // fi
 
   } // rof
-
   if( w != NULL )
     w->AddActor( this->ImageOutlineActor );
 }
@@ -82,14 +83,14 @@ PopDataFrom( vtkRenderer* x, vtkRenderer* y, vtkRenderer* z, vtkRenderer* w )
   {
     if( rends[ i ] != NULL )
     {
-      rends[ i ]->RemoveActor( this->Slices[ i ]->GetImageActor( ) );
-      rends[ i ]->RemoveActor( this->Slices[ i ]->GetTextActor( ) );
+      rends[ i ]->RemoveActor( this->Slices[ 0 ][ i ]->GetImageActor( ) );
+      rends[ i ]->RemoveActor( this->Slices[ 0 ][ i ]->GetTextActor( ) );
       for( int j = 0; j < 3; ++j )
-        rends[ i ]->RemoveActor( this->Slices[ j ]->GetPlaneActor( ) );
+        rends[ i ]->RemoveActor( this->Slices[ 0 ][ j ]->GetPlaneActor( ) );
       if( w != NULL )
       {
-        w->RemoveActor( this->Slices[ i ]->GetImageActor( ) );
-        w->RemoveActor( this->Slices[ i ]->GetPlaneActor( ) );
+        w->RemoveActor( this->Slices[ 1 ][ i ]->GetImageActor( ) );
+        w->RemoveActor( this->Slices[ 1 ][ i ]->GetPlaneActor( ) );
 
       } // fi
 
@@ -98,10 +99,7 @@ PopDataFrom( vtkRenderer* x, vtkRenderer* y, vtkRenderer* z, vtkRenderer* w )
   } // rof
 
   if( w != NULL )
-  {
     w->RemoveActor( this->ImageOutlineActor );
-
-  } // fi
 }
 
 // -------------------------------------------------------------------------
@@ -289,21 +287,21 @@ ResetWindowLevel( )
 int cpExtensions::Visualization::MPRActors::
 GetSliceNumberMinValue( const int& axis ) const
 {
-  return( this->Slices[ axis ]->GetSliceNumberMinValue( ) );
+  return( this->Slices[ 0 ][ axis ]->GetSliceNumberMinValue( ) );
 }
 
 // -------------------------------------------------------------------------
 int cpExtensions::Visualization::MPRActors::
 GetSliceNumberMaxValue( const int& axis ) const
 {
-  return( this->Slices[ axis ]->GetSliceNumberMaxValue( ) );
+  return( this->Slices[ 0 ][ axis ]->GetSliceNumberMaxValue( ) );
 }
 
 // -------------------------------------------------------------------------
 int cpExtensions::Visualization::MPRActors::
 GetSlice( const int& axis ) const
 {
-  return( this->Slices[ axis ]->GetSliceNumber( ) );
+  return( this->Slices[ 0 ][ axis ]->GetSliceNumber( ) );
 }
 
 // -------------------------------------------------------------------------
@@ -326,7 +324,8 @@ SetSlice( const int& axis, const int& slice )
     real = ext[ ( axis << 1 ) + 1 ];
 
   // Change slice
-  this->Slices[ axis ]->SetSliceNumber( real );
+  this->Slices[ 0 ][ axis ]->SetSliceNumber( real );
+  this->Slices[ 1 ][ axis ]->SetSliceNumber( real );
   this->Modified( );
 }
 
@@ -370,9 +369,12 @@ MPRActors( )
 {
   this->ImageMapToColors = vtkSmartPointer< vtkImageMapToColors >::New( );
   this->ImageOutlineActor = vtkSmartPointer< vtkActor >::New( );
-  this->Slices[ 0 ] = vtkSmartPointer< _TSlice >::New( );
-  this->Slices[ 1 ] = vtkSmartPointer< _TSlice >::New( );
-  this->Slices[ 2 ] = vtkSmartPointer< _TSlice >::New( );
+  this->Slices[ 0 ][ 0 ] = vtkSmartPointer< _TSlice >::New( );
+  this->Slices[ 0 ][ 1 ] = vtkSmartPointer< _TSlice >::New( );
+  this->Slices[ 0 ][ 2 ] = vtkSmartPointer< _TSlice >::New( );
+  this->Slices[ 1 ][ 0 ] = vtkSmartPointer< _TSlice >::New( );
+  this->Slices[ 1 ][ 1 ] = vtkSmartPointer< _TSlice >::New( );
+  this->Slices[ 1 ][ 2 ] = vtkSmartPointer< _TSlice >::New( );
 }
 
 // -------------------------------------------------------------------------
@@ -402,12 +404,16 @@ _UpdateSlices( )
     return;
   this->ImageMapToColors->Update( );
 
-  for( int i = 0; i < 3; ++i )
+  for( int j = 0; j < 2; ++j )
   {
-    this->Slices[ i ]->SetInputConnection(
-      this->ImageMapToColors->GetOutputPort( ), i
-      );
-    this->Slices[ i ]->UpdateText( );
+    for( int i = 0; i < 3; ++i )
+    {
+      this->Slices[ j ][ i ]->SetInputConnection(
+        this->ImageMapToColors->GetOutputPort( ), i
+        );
+      this->Slices[ j ][ i ]->UpdateText( );
+
+    } // rof
 
   } // rof
 
index 85c7b63f49dc96e2afbc6090b65dca98ff1fb196..c8718a31b231cb3f9505fb55f099ec504bdf7d3f 100644 (file)
@@ -101,7 +101,7 @@ namespace cpExtensions
       typedef
         cpExtensions::Visualization::ImageSliceActors
         _TSlice;
-      vtkSmartPointer< _TSlice > Slices[ 3 ];
+      vtkSmartPointer< _TSlice > Slices[ 2 ][ 3 ];
 
       unsigned int ImageOutlineActorIndex;
     };
similarity index 60%
rename from lib/cpExtensions/Visualization/MPRWithDifferentWindows.cxx
rename to lib/cpExtensions/Visualization/MPRObjects.cxx
index cf0a68c42150b8c72e40967282dbce2d427ad0e8..9c1432374264348fa495823a8f19103281bd1900 100644 (file)
@@ -1,22 +1,24 @@
-#include <cpExtensions/Visualization/MPRWithDifferentWindows.h>
-#include <vtkCamera.h>
+#include <cpExtensions/Visualization/MPRObjects.h>
 
 // -------------------------------------------------------------------------
-cpExtensions::Visualization::MPRWithDifferentWindows::
-MPRWithDifferentWindows(
-  vtkRenderWindow* xWin,
-  vtkRenderWindow* yWin,
-  vtkRenderWindow* zWin,
-  vtkRenderWindow* auxWin
-  )
+cpExtensions::Visualization::MPRObjects*
+cpExtensions::Visualization::MPRObjects::
+New( )
 {
-  this->m_Windows[ 0 ] = xWin;
-  this->m_Windows[ 1 ] = yWin;
-  this->m_Windows[ 2 ] = zWin;
-  this->m_Windows[ 3 ] = auxWin;
+  return( new Self( ) );
+}
 
-  // Prepare actors
-  this->m_MPRActors = vtkSmartPointer< TMPRActors >::New( );
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+SetRenderWindows(
+  vtkRenderWindow* wx, vtkRenderWindow* wy,
+  vtkRenderWindow* wz, vtkRenderWindow* w3D
+  )
+{
+  this->m_Windows[ 0 ] = wx;
+  this->m_Windows[ 1 ] = wy;
+  this->m_Windows[ 2 ] = wz;
+  this->m_Windows[ 3 ] = w3D;
 
   // Prepare renderers
   for( int i = 0; i < 4; ++i )
@@ -72,13 +74,7 @@ MPRWithDifferentWindows(
 }
 
 // -------------------------------------------------------------------------
-cpExtensions::Visualization::MPRWithDifferentWindows::
-~MPRWithDifferentWindows( )
-{
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::Visualization::MPRWithDifferentWindows::
+void cpExtensions::Visualization::MPRObjects::
 SetImage( vtkImageData* image )
 {
   this->m_MPRActors->SetInputData( image );
@@ -103,31 +99,7 @@ SetImage( vtkImageData* image )
 }
 
 // -------------------------------------------------------------------------
-void cpExtensions::Visualization::MPRWithDifferentWindows::
-SetModeToNavigation( )
-{
-  for( unsigned int i = 0; i < 3; ++i )
-  {
-    if( this->m_Styles[ i ].GetPointer( ) != NULL )
-      this->m_Styles[ i ]->SetModeToNavigation( );
-
-  } // rof
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::Visualization::MPRWithDifferentWindows::
-SetModeToDeformation( )
-{
-  for( unsigned int i = 0; i < 3; ++i )
-  {
-    if( this->m_Styles[ i ].GetPointer( ) != NULL )
-      this->m_Styles[ i ]->SetModeToDeformation( );
-
-  } // rof
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::Visualization::MPRWithDifferentWindows::
+void cpExtensions::Visualization::MPRObjects::
 ResetCamera( const int& id )
 {
   if( id < 4 )
@@ -136,7 +108,7 @@ ResetCamera( const int& id )
 }
 
 // -------------------------------------------------------------------------
-void cpExtensions::Visualization::MPRWithDifferentWindows::
+void cpExtensions::Visualization::MPRObjects::
 ResetCameras( )
 {
   for( int i = 0; i < 4; ++i )
@@ -145,7 +117,7 @@ ResetCameras( )
 }
 
 // -------------------------------------------------------------------------
-void cpExtensions::Visualization::MPRWithDifferentWindows::
+void cpExtensions::Visualization::MPRObjects::
 Render( const int& id )
 {
   if( id < 4 )
@@ -154,7 +126,7 @@ Render( const int& id )
 }
 
 // -------------------------------------------------------------------------
-void cpExtensions::Visualization::MPRWithDifferentWindows::
+void cpExtensions::Visualization::MPRObjects::
 RenderAll( )
 {
   for( int i = 0; i < 4; ++i )
@@ -163,26 +135,74 @@ RenderAll( )
 }
 
 // -------------------------------------------------------------------------
-vtkRenderer* cpExtensions::Visualization::MPRWithDifferentWindows::
-GetRenderer( const int& id ) const
+vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetXRenderer( )
 {
-  if( id < 4 )
-    return( this->m_Renderers[ id ] );
-  else
-    return( NULL );
+  return( this->m_Renderers[ 0 ] );
 }
 
 // -------------------------------------------------------------------------
-void cpExtensions::Visualization::MPRWithDifferentWindows::
-Add3DActor( vtkProp3D* prop )
+vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetYRenderer( )
 {
-  if( this->m_Renderers[ 3 ] != NULL )
-  {
-    this->m_Renderers[ 3 ]->AddActor( prop );
-    this->ResetCamera( 3 );
-    this->Render( 3 );
+  return( this->m_Renderers[ 1 ] );
+}
 
-  } // fi
+// -------------------------------------------------------------------------
+vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetZRenderer( )
+{
+  return( this->m_Renderers[ 2 ] );
+}
+
+// -------------------------------------------------------------------------
+vtkRenderer* cpExtensions::Visualization::MPRObjects::
+Get3DRenderer( )
+{
+  return( this->m_Renderers[ 3 ] );
+}
+
+// -------------------------------------------------------------------------
+const vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetXRenderer( ) const
+{
+  return( this->m_Renderers[ 0 ] );
+}
+
+// -------------------------------------------------------------------------
+const vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetYRenderer( ) const
+{
+  return( this->m_Renderers[ 1 ] );
+}
+
+// -------------------------------------------------------------------------
+const vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetZRenderer( ) const
+{
+  return( this->m_Renderers[ 2 ] );
+}
+
+// -------------------------------------------------------------------------
+const vtkRenderer* cpExtensions::Visualization::MPRObjects::
+Get3DRenderer( ) const
+{
+  return( this->m_Renderers[ 3 ] );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::MPRObjects::
+MPRObjects( )
+  : vtkObject( )
+{
+  // Prepare actors
+  this->m_MPRActors = vtkSmartPointer< TMPRActors >::New( );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::MPRObjects::
+~MPRObjects( )
+{
 }
 
 // eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/MPRObjects.h b/lib/cpExtensions/Visualization/MPRObjects.h
new file mode 100644 (file)
index 0000000..84db5d2
--- /dev/null
@@ -0,0 +1,77 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
+#define __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+#include <cpExtensions/Visualization/MPRActors.h>
+#include <cpExtensions/Visualization/ImageInteractorStyle.h>
+
+#include <vtkObject.h>
+#include <vtkRenderer.h>
+#include <vtkRenderWindow.h>
+
+namespace cpExtensions
+{
+  namespace Visualization
+  {
+    /**
+     */
+    class cpExtensions_EXPORT MPRObjects
+      : public vtkObject
+    {
+    public:
+      typedef MPRObjects Self;
+      typedef cpExtensions::Visualization::MPRActors            TMPRActors;
+      typedef cpExtensions::Visualization::ImageInteractorStyle TStyle;
+
+    public:
+      vtkTypeMacro( MPRObjects, vtkObject );
+
+    public:
+      // Creation
+      static MPRObjects* New( );
+
+      void SetRenderWindows(
+        vtkRenderWindow* wx, vtkRenderWindow* wy,
+        vtkRenderWindow* wz, vtkRenderWindow* w3D
+        );
+
+      void SetImage( vtkImageData* image );
+      void ResetCamera( const int& id );
+      void ResetCameras( );
+      void Render( const int& id );
+      void RenderAll( );
+      vtkRenderer* GetXRenderer( );
+      vtkRenderer* GetYRenderer( );
+      vtkRenderer* GetZRenderer( );
+      vtkRenderer* Get3DRenderer( );
+      const vtkRenderer* GetXRenderer( ) const;
+      const vtkRenderer* GetYRenderer( ) const;
+      const vtkRenderer* GetZRenderer( ) const;
+      const vtkRenderer* Get3DRenderer( ) const;
+
+    protected:
+      MPRObjects( );
+      virtual ~MPRObjects( );
+
+    private:
+      // Purposely not implemented
+      MPRObjects( const Self& );
+      Self& operator=( const Self& );
+
+    protected:
+      // Inputs
+      vtkSmartPointer< vtkRenderWindow > m_Windows[ 4 ];
+
+      // Internal pipelines
+      vtkSmartPointer< TMPRActors >  m_MPRActors;
+      vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
+      vtkSmartPointer< TStyle >      m_Styles[ 3 ];
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif //  __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/MPRWithDifferentWindows.h b/lib/cpExtensions/Visualization/MPRWithDifferentWindows.h
deleted file mode 100644 (file)
index 2b5a4e7..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef __CPEXTENSIONS__VISUALIZATION__MPRWITHDIFFERENTWINDOWS__H__
-#define __CPEXTENSIONS__VISUALIZATION__MPRWITHDIFFERENTWINDOWS__H__
-
-#include <cpExtensions/Visualization/MPRActors.h>
-#include <cpExtensions/Visualization/ImageInteractorStyle.h>
-#include <cpExtensions/cpExtensions_Export.h>
-
-#include <vtkImageData.h>
-#include <vtkRenderer.h>
-#include <vtkRenderWindow.h>
-#include <vtkSmartPointer.h>
-
-// -------------------------------------------------------------------------
-#define cpPlugins_MPRWithDifferentWindows_ObserverMacro( e )    \
-  inline void Add##e##Observer( vtkCommand* observer )          \
-  {                                                             \
-    for( int i = 0; i < 3; ++i )                                \
-      if( this->m_Styles[ i ].GetPointer( ) != NULL )           \
-        this->m_Styles[ i ]->Add##e##Observer( observer );      \
-  }                                                             \
-  inline void Remove##e##Observer( vtkCommand* observer )       \
-  {                                                             \
-    for( int i = 0; i < 3; ++i )                                \
-      if( this->m_Styles[ i ].GetPointer( ) != NULL )           \
-        this->m_Styles[ i ]->Remove##e##Observer( observer );   \
-  }                                                             \
-  inline void Remove##e##Observers( )                           \
-  {                                                             \
-    for( int i = 0; i < 3; ++i )                                \
-      if( this->m_Styles[ i ].GetPointer( ) != NULL )           \
-        this->m_Styles[ i ]->Remove##e##Observers( );           \
-  }
-
-namespace cpExtensions
-{
-  namespace Visualization
-  {
-    /**
-     */
-    class cpExtensions_EXPORT MPRWithDifferentWindows
-    {
-    public:
-      typedef cpExtensions::Visualization::
-        MPRActors TMPRActors;
-      typedef cpExtensions::Visualization::
-        ImageInteractorStyle TStyle;
-
-    public:
-      cpPlugins_MPRWithDifferentWindows_ObserverMacro( DoubleClick );
-      cpPlugins_MPRWithDifferentWindows_ObserverMacro( Cursor );
-      cpPlugins_MPRWithDifferentWindows_ObserverMacro( Radius );
-
-    public:
-      MPRWithDifferentWindows(
-        vtkRenderWindow* xWin = NULL,
-        vtkRenderWindow* yWin = NULL,
-        vtkRenderWindow* zWin = NULL,
-        vtkRenderWindow* auxWin = NULL
-        );
-      virtual ~MPRWithDifferentWindows( );
-
-      void SetImage( vtkImageData* image );
-      void SetModeToNavigation( );
-      void SetModeToDeformation( );
-
-      void ResetCamera( const int& id );
-      void ResetCameras( );
-      void Render( const int& id );
-      void RenderAll( );
-
-      vtkRenderer* GetRenderer( const int& id ) const;
-
-      void Add3DActor( vtkProp3D* prop );
-
-    protected:
-      // Inputs
-      vtkRenderWindow* m_Windows[ 4 ];
-
-      // Internal pipelines
-      vtkSmartPointer< TMPRActors >  m_MPRActors;
-      vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
-      vtkSmartPointer< TStyle >      m_Styles[ 3 ];
-    };
-
-  } // ecapseman
-
-} // ecapseman
-
-#endif // __CPEXTENSIONS__VISUALIZATION__MPRWITHDIFFERENTWINDOWS__H__
-
-
-// eof - $RCSfile$
index 0f7468199ef2770928b68ae8b202ec34a03a9002..8507a4b52a2e0f385b3b60c306a0d4428e1afc5a 100644 (file)
@@ -7,6 +7,13 @@ void cpPlugins::Interface::Mesh::
 SetVTKMesh( vtkPolyData* mesh )
 {
   this->m_VTKObject = mesh;
+
+  this->m_Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
+  this->m_Actor = vtkSmartPointer< vtkActor >::New( );
+
+  this->m_Mapper->SetInputData( mesh );
+  this->m_Actor->SetMapper( this->m_Mapper );
+
   this->Modified( );
 }
 
@@ -26,6 +33,20 @@ GetVTKMesh( ) const
     );
 }
 
+// -------------------------------------------------------------------------
+vtkActor* cpPlugins::Interface::Mesh::
+GetVTKActor( )
+{
+  return( this->m_Actor );
+}
+
+// -------------------------------------------------------------------------
+const vtkActor* cpPlugins::Interface::Mesh::
+GetVTKActor( ) const
+{
+  return( this->m_Actor );
+}
+
 // -------------------------------------------------------------------------
 cpPlugins::Interface::Mesh::
 Mesh( )
index c934f33b09f3322909252b48d05ef98927b8bfc5..75c5eb3683e766a6a546e3091330116d170a8b2e 100644 (file)
@@ -4,7 +4,10 @@
 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 #include <cpPlugins/Interface/DataObject.h>
 
-class vtkPolyData;
+#include <vtkSmartPointer.h>
+#include <vtkActor.h>
+#include <vtkPolyData.h>
+#include <vtkPolyDataMapper.h>
 
 namespace cpPlugins
 {
@@ -38,6 +41,8 @@ namespace cpPlugins
       virtual void SetVTKMesh( vtkPolyData* mesh );
       virtual vtkPolyData* GetVTKMesh( );
       virtual const vtkPolyData* GetVTKMesh( ) const;
+      virtual vtkActor* GetVTKActor( );
+      virtual const vtkActor* GetVTKActor( ) const;
 
     protected:
       Mesh( );
@@ -47,6 +52,10 @@ namespace cpPlugins
       // Purposely not implemented
       Mesh( const Self& );
       Self& operator=( const Self& );
+
+    protected:
+      vtkSmartPointer< vtkActor >          m_Actor;
+      vtkSmartPointer< vtkPolyDataMapper > m_Mapper;
     };
 
   } // ecapseman
index 819abd3ca49daf02f38f1d31eb99ce2930341cc0..1cc5820f30ee9561ba890cff5df75907133ea912 100644 (file)
@@ -10,6 +10,7 @@
 #include <QHBoxLayout>
 #include <QLabel>
 #include <QLineEdit>
+#include <QTableWidget>
 #include <QWidget>
 
 // -------------------------------------------------------------------------
@@ -47,7 +48,6 @@ ParametersQtDialog(
        BoolList,
        IntList,
        UintList,
-       RealList,
        IndexList,
        PointList,
        NoType
@@ -91,6 +91,26 @@ ParametersQtDialog(
       v_double->setMaximum(  std::numeric_limits< double >::max( ) );
       v_double->setValue( parameters.GetValueAsReal( *nIt ) );
       w_input = v_double;
+    }
+    else if( pt == Parameters::RealList )
+    {
+      QStringList header;
+      header << nIt->c_str( );
+
+      QTableWidget* l_double = new QTableWidget( dlg );
+      l_double->setColumnCount( 1 );
+      l_double->setRowCount( 1 );
+      l_double->setHorizontalHeaderLabels( header );
+      l_double->setShowGrid( true );
+      l_double->setSelectionBehavior( QAbstractItemView::SelectRows );
+      l_double->setSelectionMode( QAbstractItemView::SingleSelection );
+
+      QObject::connect(
+        l_double, SIGNAL( cellDoubleClicked( int, int ) ),
+        l_double, SLOT( insertRow( int ) )
+        );
+
+      w_input = l_double;
 
     } // fi
 
@@ -159,6 +179,24 @@ ParametersQtDialog(
         dlg->findChild< QDoubleSpinBox* >( nIt->c_str( ) );
       if( v_double != NULL )
         parameters.SetValueAsReal( *nIt, v_double->value( ) );
+    }
+    else if( pt == Parameters::RealList )
+    {
+      QTableWidget* l_double =
+        dlg->findChild< QTableWidget* >( nIt->c_str( ) );
+      if( l_double != NULL )
+      {
+        for( int r = 0; r < l_double->rowCount( ); ++r )
+        {
+          double v =
+            std::atof(
+              l_double->item( r, 0 )->text( ).toStdString( ).c_str( )
+              );
+          parameters.AddValueToRealList( *nIt, v );
+
+        } // rof
+
+      } // fi
 
     } // fi
 
index 0f8f2885bfb9b9aac979ade6093decb6006b4b1c..3630e491022a4813778201346aa45d65d2b3b0fd 100644 (file)
@@ -60,16 +60,6 @@ SetInput( unsigned int idx, cpPlugins::Interface::DataObject* dobj )
   } // fi
 }
 
-// -------------------------------------------------------------------------
-cpPlugins::Interface::DataObject* cpPlugins::Interface::ProcessObject::
-GetOutput( unsigned int idx )
-{
-  if( idx < this->m_Outputs.size( ) )
-    return( this->m_Outputs[ idx ] );
-  else
-    return( NULL );
-}
-
 // -------------------------------------------------------------------------
 std::string cpPlugins::Interface::ProcessObject::
 Update( )
index 3381fa818e77c4685f54286c31253c545865b7ff..d201a6c84c09ac57782062d14178420412d206e0 100644 (file)
@@ -37,29 +37,28 @@ namespace cpPlugins
       virtual void SetNumberOfOutputs( unsigned int n );
 
       virtual void SetInput( unsigned int idx, DataObject* dobj );
-      virtual DataObject* GetOutput( unsigned int idx );
 
       virtual std::string Update( );
       virtual void DisconnectOutputs( );
 
-    protected:
-      ProcessObject( );
-      virtual ~ProcessObject( );
-
-      template< class O >
-        inline void _MakeOutput( unsigned int idx );
-
       template< class T >
-        inline T* _Input( unsigned int idx );
+        inline T* GetInput( unsigned int idx );
 
       template< class T >
-        inline const T* _Input( unsigned int idx ) const;
+        inline const T* GetInput( unsigned int idx ) const;
 
       template< class T >
-        inline T* _Output( unsigned int idx );
+        inline T* GetOutput( unsigned int idx );
 
       template< class T >
-        inline const T* _Output( unsigned int idx ) const;
+        inline const T* GetOutput( unsigned int idx ) const;
+
+    protected:
+      ProcessObject( );
+      virtual ~ProcessObject( );
+
+      template< class O >
+        inline void _MakeOutput( unsigned int idx );
 
       virtual std::string _GenerateData( ) = 0;
 
index a4a417bde2fbe6f289fdf62e55491c4a1df0642e..f84d4a6301e202cf44bfbb95fb8b0e4b9b7a4bb2 100644 (file)
@@ -1,21 +1,10 @@
 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
 
-// -------------------------------------------------------------------------
-template< class O >
-void cpPlugins::Interface::ProcessObject::
-_MakeOutput( unsigned int idx )
-{
-  if( idx >= this->m_Outputs.size( ) )
-    return;
-  this->m_Outputs[ idx ] = O::New( );
-  this->m_Outputs[ idx ]->SetSource( this );
-}
-
 // -------------------------------------------------------------------------
 template< class T >
 T* cpPlugins::Interface::ProcessObject::
-_Input( unsigned int idx )
+GetInput( unsigned int idx )
 {
   if( idx < this->m_Inputs.size( ) )
     return( dynamic_cast< T* >( this->m_Inputs[ idx ].GetPointer( ) ) );
@@ -26,7 +15,7 @@ _Input( unsigned int idx )
 // -------------------------------------------------------------------------
 template< class T >
 const T* cpPlugins::Interface::ProcessObject::
-_Input( unsigned int idx ) const
+GetInput( unsigned int idx ) const
 {
   if( idx < this->m_Inputs.size( ) )
     return(
@@ -39,7 +28,7 @@ _Input( unsigned int idx ) const
 // -------------------------------------------------------------------------
 template< class T >
 T* cpPlugins::Interface::ProcessObject::
-_Output( unsigned int idx )
+GetOutput( unsigned int idx )
 {
   if( idx < this->m_Outputs.size( ) )
     return( dynamic_cast< T* >( this->m_Outputs[ idx ].GetPointer( ) ) );
@@ -50,7 +39,7 @@ _Output( unsigned int idx )
 // -------------------------------------------------------------------------
 template< class T >
 const T* cpPlugins::Interface::ProcessObject::
-_Output( unsigned int idx ) const
+GetOutput( unsigned int idx ) const
 {
   if( idx < this->m_Outputs.size( ) )
     return(
@@ -60,6 +49,17 @@ _Output( unsigned int idx ) const
     return( NULL );
 }
 
+// -------------------------------------------------------------------------
+template< class O >
+void cpPlugins::Interface::ProcessObject::
+_MakeOutput( unsigned int idx )
+{
+  if( idx >= this->m_Outputs.size( ) )
+    return;
+  this->m_Outputs[ idx ] = O::New( );
+  this->m_Outputs[ idx ]->SetSource( this );
+}
+
 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
 
 // eof - $RCSfile$
index fc752efaafe5d8227b2be6f91e70bebd6ae2c452..73611cb4a7130c7ac13d309d3afc6e4485f1df5d 100644 (file)
@@ -49,7 +49,7 @@ _GenerateData( )
     {
       io->SetFileName( names[ 0 ] );
       io->ReadImageInformation( );
-      if( names.size( ) == 1 )
+      if( names.size( ) >= 1 )
       {
         switch( io->GetNumberOfDimensions( ) )
         {
@@ -57,19 +57,7 @@ _GenerateData( )
         case 3: r = this->_GD0< 3 >( io, names ); break;
         case 4: r = this->_GD0< 4 >( io, names ); break;
         default:
-          r = "ImageReader: Single image dimension not supported.";
-          break;
-        } // hctiws
-      }
-      else if( names.size( ) > 1 )
-      {
-        switch( io->GetNumberOfDimensions( ) )
-        {
-        case 1: r = this->_GD0< 2 >( io, names ); break;
-        case 2: r = this->_GD0< 3 >( io, names ); break;
-        case 3: r = this->_GD0< 4 >( io, names ); break;
-        default:
-          r = "ImageReader: Multiple images dimension not supported.";
+          r = "ImageReader: Image dimension not supported.";
           break;
         } // hctiws
 
@@ -149,8 +137,26 @@ _GD0( itk::ImageIOBase* io, const TStringList& names )
       case itk::ImageIOBase::SHORT:
         r = this->_RealGD< itk::RGBPixel< short >, 2 >( names );
         break;
+      case itk::ImageIOBase::UINT:
+        r = this->_RealGD< itk::RGBPixel< unsigned int >, 2 >( names );
+        break;
+      case itk::ImageIOBase::INT:
+        r = this->_RealGD< itk::RGBPixel< int >, 2 >( names );
+        break;
+      case itk::ImageIOBase::ULONG:
+        r = this->_RealGD< itk::RGBPixel< unsigned long >, 2 >( names );
+        break;
+      case itk::ImageIOBase::LONG:
+        r = this->_RealGD< itk::RGBPixel< long >, 2 >( names );
+        break;
+      case itk::ImageIOBase::FLOAT:
+        r = this->_RealGD< itk::RGBPixel< float >, 2 >( names );
+        break;
+      case itk::ImageIOBase::DOUBLE:
+        r = this->_RealGD< itk::RGBPixel< double >, 2 >( names );
+        break;
       default:
-        r = "ImageReader: Scalar pixel type not supported.";
+        r = "ImageReader: RGB pixel type not supported.";
         break;
       } // hctiws
     }
@@ -170,8 +176,26 @@ _GD0( itk::ImageIOBase* io, const TStringList& names )
       case itk::ImageIOBase::SHORT:
         r = this->_RealGD< itk::RGBPixel< short >, 3 >( names );
         break;
+      case itk::ImageIOBase::UINT:
+        r = this->_RealGD< itk::RGBPixel< unsigned int >, 3 >( names );
+        break;
+      case itk::ImageIOBase::INT:
+        r = this->_RealGD< itk::RGBPixel< int >, 3 >( names );
+        break;
+      case itk::ImageIOBase::ULONG:
+        r = this->_RealGD< itk::RGBPixel< unsigned long >, 3 >( names );
+        break;
+      case itk::ImageIOBase::LONG:
+        r = this->_RealGD< itk::RGBPixel< long >, 3 >( names );
+        break;
+      case itk::ImageIOBase::FLOAT:
+        r = this->_RealGD< itk::RGBPixel< float >, 3 >( names );
+        break;
+      case itk::ImageIOBase::DOUBLE:
+        r = this->_RealGD< itk::RGBPixel< double >, 3 >( names );
+        break;
       default:
-        r = "ImageReader: Scalar pixel type not supported.";
+        r = "ImageReader: RGB pixel type not supported.";
         break;
       } // hctiws
     }
@@ -191,8 +215,26 @@ _GD0( itk::ImageIOBase* io, const TStringList& names )
       case itk::ImageIOBase::SHORT:
         r = this->_RealGD< itk::RGBPixel< short >, 4 >( names );
         break;
+      case itk::ImageIOBase::UINT:
+        r = this->_RealGD< itk::RGBPixel< unsigned int >, 4 >( names );
+        break;
+      case itk::ImageIOBase::INT:
+        r = this->_RealGD< itk::RGBPixel< int >, 4 >( names );
+        break;
+      case itk::ImageIOBase::ULONG:
+        r = this->_RealGD< itk::RGBPixel< unsigned long >, 4 >( names );
+        break;
+      case itk::ImageIOBase::LONG:
+        r = this->_RealGD< itk::RGBPixel< long >, 4 >( names );
+        break;
+      case itk::ImageIOBase::FLOAT:
+        r = this->_RealGD< itk::RGBPixel< float >, 4 >( names );
+        break;
+      case itk::ImageIOBase::DOUBLE:
+        r = this->_RealGD< itk::RGBPixel< double >, 4 >( names );
+        break;
       default:
-        r = "ImageReader: Scalar pixel type not supported.";
+        r = "ImageReader: RGB pixel type not supported.";
         break;
       } // hctiws
 
@@ -216,8 +258,26 @@ _GD0( itk::ImageIOBase* io, const TStringList& names )
       case itk::ImageIOBase::SHORT:
         r = this->_RealGD< itk::RGBAPixel< short >, 2 >( names );
         break;
+      case itk::ImageIOBase::UINT:
+        r = this->_RealGD< itk::RGBAPixel< unsigned int >, 2 >( names );
+        break;
+      case itk::ImageIOBase::INT:
+        r = this->_RealGD< itk::RGBAPixel< int >, 2 >( names );
+        break;
+      case itk::ImageIOBase::ULONG:
+        r = this->_RealGD< itk::RGBAPixel< unsigned long >, 2 >( names );
+        break;
+      case itk::ImageIOBase::LONG:
+        r = this->_RealGD< itk::RGBAPixel< long >, 2 >( names );
+        break;
+      case itk::ImageIOBase::FLOAT:
+        r = this->_RealGD< itk::RGBAPixel< float >, 2 >( names );
+        break;
+      case itk::ImageIOBase::DOUBLE:
+        r = this->_RealGD< itk::RGBAPixel< double >, 2 >( names );
+        break;
       default:
-        r = "ImageReader: Scalar pixel type not supported.";
+        r = "ImageReader: RGBA pixel type not supported.";
         break;
       } // hctiws
     }
@@ -237,8 +297,26 @@ _GD0( itk::ImageIOBase* io, const TStringList& names )
       case itk::ImageIOBase::SHORT:
         r = this->_RealGD< itk::RGBAPixel< short >, 3 >( names );
         break;
+      case itk::ImageIOBase::UINT:
+        r = this->_RealGD< itk::RGBAPixel< unsigned int >, 3 >( names );
+        break;
+      case itk::ImageIOBase::INT:
+        r = this->_RealGD< itk::RGBAPixel< int >, 3 >( names );
+        break;
+      case itk::ImageIOBase::ULONG:
+        r = this->_RealGD< itk::RGBAPixel< unsigned long >, 3 >( names );
+        break;
+      case itk::ImageIOBase::LONG:
+        r = this->_RealGD< itk::RGBAPixel< long >, 3 >( names );
+        break;
+      case itk::ImageIOBase::FLOAT:
+        r = this->_RealGD< itk::RGBAPixel< float >, 3 >( names );
+        break;
+      case itk::ImageIOBase::DOUBLE:
+        r = this->_RealGD< itk::RGBAPixel< double >, 3 >( names );
+        break;
       default:
-        r = "ImageReader: Scalar pixel type not supported.";
+        r = "ImageReader: RGBA pixel type not supported.";
         break;
       } // hctiws
     }
@@ -258,8 +336,26 @@ _GD0( itk::ImageIOBase* io, const TStringList& names )
       case itk::ImageIOBase::SHORT:
         r = this->_RealGD< itk::RGBAPixel< short >, 4 >( names );
         break;
+      case itk::ImageIOBase::UINT:
+        r = this->_RealGD< itk::RGBAPixel< unsigned int >, 4 >( names );
+        break;
+      case itk::ImageIOBase::INT:
+        r = this->_RealGD< itk::RGBAPixel< int >, 4 >( names );
+        break;
+      case itk::ImageIOBase::ULONG:
+        r = this->_RealGD< itk::RGBAPixel< unsigned long >, 4 >( names );
+        break;
+      case itk::ImageIOBase::LONG:
+        r = this->_RealGD< itk::RGBAPixel< long >, 4 >( names );
+        break;
+      case itk::ImageIOBase::FLOAT:
+        r = this->_RealGD< itk::RGBAPixel< float >, 4 >( names );
+        break;
+      case itk::ImageIOBase::DOUBLE:
+        r = this->_RealGD< itk::RGBAPixel< double >, 4 >( names );
+        break;
       default:
-        r = "ImageReader: Scalar pixel type not supported.";
+        r = "ImageReader: RGBA pixel type not supported.";
         break;
       } // hctiws
 
@@ -324,7 +420,7 @@ _GD0( itk::ImageIOBase* io, const TStringList& names )
       r = this->_RealGD< itk::CovariantVector< double, D >, D >( names );
       break;
     default:
-      r = "ImageReader: Vector type not supported.";
+      r = "ImageReader: CovariantVector type not supported.";
       break;
     } // hctiws
   }
@@ -416,6 +512,11 @@ _RealGD( const TStringList& names )
 {
   typedef itk::Image< P, D > _I;
 
+  cpPlugins::Interface::Image* out =
+    this->GetOutput< cpPlugins::Interface::Image >( 0 );
+  if( out == NULL )
+    return( "ImageReader: No output object properly created." );
+
   std::string r = "";
   if( names.size( ) == 1 )
   {
@@ -434,22 +535,12 @@ _RealGD( const TStringList& names )
     try
     {
       reader->Update( );
-      cpPlugins::Interface::Image* out =
-        this->_Output< cpPlugins::Interface::Image >( 0 );
-      if( out != NULL )
-        out->SetITKImage< _I >( reader->GetOutput( ) );
-      else
-        r = "ImageReader: output not correctly created.";
+      out->SetITKImage< _I >( reader->GetOutput( ) );
     }
     catch( itk::ExceptionObject& err )
     {
       r = "ImageReader: " + std::string( err.GetDescription( ) );
-      cpPlugins::Interface::Image* out =
-        this->_Output< cpPlugins::Interface::Image >( 0 );
-      if( out != NULL )
-        out->SetITKImage< _I >( NULL );
-      else
-        r = "ImageReader: output not correctly created.";
+      out->SetITKImage< _I >( NULL );
 
     } // yrt
   }
@@ -472,26 +563,18 @@ _RealGD( const TStringList& names )
     } // fi
     std::set< std::string >::const_iterator fnIt = ordered_names.begin( );
     for( ; fnIt != ordered_names.end( ); ++fnIt )
+    {
       reader->AddFileName( *fnIt );
+    }
     try
     {
       reader->Update( );
-      cpPlugins::Interface::Image* out =
-        this->_Output< cpPlugins::Interface::Image >( 0 );
-      if( out != NULL )
-        out->SetITKImage< _I >( reader->GetOutput( ) );
-      else
-        r = "ImageReader: output not correctly created.";
+      out->SetITKImage< _I >( reader->GetOutput( ) );
     }
     catch( itk::ExceptionObject& err )
     {
       r = "ImageReader: " + std::string( err.GetDescription( ) );
-      cpPlugins::Interface::Image* out =
-        this->_Output< cpPlugins::Interface::Image >( 0 );
-      if( out != NULL )
-        out->SetITKImage< _I >( NULL );
-      else
-        r = "ImageReader: output not correctly created.";
+      out->SetITKImage< _I >( NULL );
 
     } // yrt
   }
index 921df921cdb3149e90494139a07ff8b36573d371..59dbe83795e526d3f4f041e8a3d75725e20a216b 100644 (file)
@@ -28,7 +28,7 @@ std::string cpPlugins::Plugins::ImageWriter::
 _GenerateData( )
 {
   cpPlugins::Interface::Image* image =
-    this->_Input< cpPlugins::Interface::Image >( 0 );
+    this->GetInput< cpPlugins::Interface::Image >( 0 );
   if( image == NULL )
     return( "ImageWriter: No input image." );
 
index ca6e5bf5d7c0b1eb2ac963ff22bf84db56890ae0..94af090e1c2831d1cf09d5bb1818037d4e9b1078 100644 (file)
@@ -38,7 +38,7 @@ _GenerateData( )
 {
   // Get input
   cpPlugins::Interface::Image* image =
-    this->_Input< cpPlugins::Interface::Image >( 0 );
+    this->GetInput< cpPlugins::Interface::Image >( 0 );
   if( image == NULL )
     return( "MarchingCubes: Input data is not a valid image." );
   vtkImageData* vtk_image = image->GetVTKImageData( );
@@ -72,7 +72,7 @@ _GenerateData( )
   // Execute filter
   this->m_Algorithm->Update( );
   cpPlugins::Interface::Mesh* out =
-    this->_Output< cpPlugins::Interface::Mesh >( 0 );
+    this->GetOutput< cpPlugins::Interface::Mesh >( 0 );
   out->SetVTKMesh( this->m_Algorithm->GetOutput( ) );
   return( "" );
 }
index 0528e6cd4b15d35507e630751f5d0350a77be0c3..199325954b24e817bc063e99784bbec405cb5b7c 100644 (file)
@@ -79,7 +79,7 @@ _GD1( )
   pdr->Update( );
 
   cpPlugins::Interface::Mesh* out =
-    this->_Output< cpPlugins::Interface::Mesh >( 0 );
+    this->GetOutput< cpPlugins::Interface::Mesh >( 0 );
   if( out != NULL )
     out->SetVTKMesh( pdr->GetOutput( ) );
   else
index 5b06347249e98fb9ed81904fc660502cddc17232..6cc7841982c87ce2fcb98d405783076dd9090bdb 100644 (file)
@@ -33,7 +33,7 @@ std::string cpPlugins::Plugins::MeshWriter::
 _GenerateData( )
 {
   cpPlugins::Interface::Mesh* mesh =
-    this->_Input< cpPlugins::Interface::Mesh >( 0 );
+    this->GetInput< cpPlugins::Interface::Mesh >( 0 );
   if( mesh == NULL )
     return( "MeshWriter: No input mesh." );
   vtkPolyData* i = mesh->GetVTKMesh( );
index efc7d6ace500028a371393bf6264314ecb833a3e..dc6fd942f2c70a0f378352e94b435d4cb49e9dae 100644 (file)
@@ -37,7 +37,7 @@ std::string cpPlugins::Plugins::OtsuThresholdImageFilter::
 _GenerateData( )
 {
   cpPlugins::Interface::Image* image =
-    this->_Input< cpPlugins::Interface::Image >( 0 );
+    this->GetInput< cpPlugins::Interface::Image >( 0 );
   if( image == NULL )
     return( "OtsuThresholdImageFilter: No input image." );
 
@@ -98,7 +98,7 @@ _RealGD( itk::DataObject* image )
 
   // Connect output
   cpPlugins::Interface::Image* out =
-    this->_Output< cpPlugins::Interface::Image >( 0 );
+    this->GetOutput< cpPlugins::Interface::Image >( 0 );
   if( out != NULL )
   {
     out->SetITKImage< O >( filter->GetOutput( ) );
index 1a882010c9816a4f10604b8ab7d8252f9a058f13..6cc0d1ca96a45eba1b813aeb3f00fd2464912d44 100644 (file)
@@ -53,7 +53,7 @@ std::string cpPlugins::Plugins::RGBImageToOtherChannelsFilter::
 _GenerateData( )
 {
   cpPlugins::Interface::Image* image =
-    this->_Input< cpPlugins::Interface::Image >( 0 );
+    this->GetInput< cpPlugins::Interface::Image >( 0 );
   if( image == NULL )
     return( "RGBImageToOtherChannelsFilter: No input image." );
 
@@ -119,7 +119,7 @@ _RealGD( itk::DataObject* image )
 
   // Connect output
   cpPlugins::Interface::Image* out =
-    this->_Output< cpPlugins::Interface::Image >( 0 );
+    this->GetOutput< cpPlugins::Interface::Image >( 0 );
   if( out != NULL )
   {
     out->SetITKImage< _O >( filter->GetOutput( ) );
index 47261cc49a7d1be5fdc1c1de10b670238bb061b7..62a5907d172a2c6fa9fc4b3b85b1895be3e82df8 100644 (file)
@@ -36,7 +36,7 @@ _GenerateData( )
 {
   // Get input
   cpPlugins::Interface::Image* image =
-    this->_Input< cpPlugins::Interface::Image >( 0 );
+    this->GetInput< cpPlugins::Interface::Image >( 0 );
   if( image == NULL )
     return( "SecondRankDiffusionTensorToPolyData: Input data is not a valid image." );
 
@@ -69,7 +69,7 @@ _RealGD( itk::DataObject* image )
 
   // Connect output
   cpPlugins::Interface::Mesh* out =
-    this->_Output< cpPlugins::Interface::Mesh >( 0 );
+    this->GetOutput< cpPlugins::Interface::Mesh >( 0 );
   if( out != NULL )
   {
     out->SetVTKMesh( this->m_Algorithm->GetOutput( ) );