#ifdef cpExtensions_QT4
-#include <cpExtensions/Visualization/ImageViewerActors.h>
-#include <cpExtensions/Visualization/LUTImageActor.h>
-#include <cpExtensions/Visualization/WindowLevelImageActor.h>
#include <cpExtensions/Interaction/ImageSliceStyle.h>
-#include <vtkCamera.h>
-#include <vtkImageData.h>
-#include <vtkImageProperty.h>
+#include <cpExtensions/Visualization/ImageOutlineActor.h>
+#include <cpExtensions/Visualization/WindowLevelImageActor.h>
+
#include <vtkRenderer.h>
+/* TODO
+ #include <cpExtensions/Visualization/ImageViewerActors.h>
+ #include <cpExtensions/Visualization/LUTImageActor.h>
+ #include <vtkCamera.h>
+ #include <vtkImageData.h>
+ #include <vtkImageProperty.h>
+*/
+
// -------------------------------------------------------------------------
cpExtensions::QT::ImageWidget::
ImageWidget( QWidget* parent, Qt::WindowFlags f )
: Superclass( parent, f ),
m_ImageName( "" )
{
- this->m_ImageSliceStyle =
- vtkSmartPointer< cpExtensions::Interaction::ImageSliceStyle >::New( );
- this->m_ImageSliceStyle->SetCurrentRenderer( this->m_Renderer );
- this->SetStyle( this->m_ImageSliceStyle );
+ this->m_Style = vtkSmartPointer< TStyle >::New( );
+ this->m_Style->SetCurrentRenderer( this->m_Renderer );
+ this->SetStyle( this->m_Style );
}
// -------------------------------------------------------------------------
{
}
+// -------------------------------------------------------------------------
+void cpExtensions::QT::ImageWidget::
+Clear( )
+{
+ this->RemoveViewProps( );
+ this->m_ImageName = "";
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::ImageWidget::
+SetImage( vtkImageData* image, int orientation, const std::string& name )
+{
+ if( name == "" )
+ return;
+ if( this->m_ImageName != "" )
+ this->Clear( );
+ this->m_ImageName = name;
+
+ this->m_WLActor = vtkSmartPointer< TWLActor >::New( );
+ this->m_WLActor->SetImage( image );
+ this->m_WLActor->SetOrientation( orientation );
+
+ this->m_OLActor = vtkSmartPointer< TOLActor >::New( );
+ this->m_OLActor->SetBounds(
+ orientation,
+ this->m_WLActor->GetBounds( )[ orientation ],
+ this->m_WLActor->GetBounds( )
+ );
+
+ this->AddViewProp( this->m_WLActor, this->m_ImageName );
+ this->AddAuxViewProp( this->m_OLActor, this->m_ImageName );
+ this->ResetCamera( );
+}
+
+
+/* TODO
// -------------------------------------------------------------------------
vtkInteractorStyle* cpExtensions::QT::ImageWidget::
GetInteractorStyle( )
if( image == NULL )
{
- /* TODO
if( this->m_ImageName == "" )
this->SetImage( data, name );
{
} // fi
- */
return;
} // fi
} // fi
}
+// -------------------------------------------------------------------------
+vtkProp* cpExtensions::QT::ImageWidget::
+GetImageActor( )
+{
+ return( this->m_ImageViewerActors->GetWindowLevelImageActor( ) );
+}
+
+// -------------------------------------------------------------------------
+const vtkProp* cpExtensions::QT::ImageWidget::
+GetImageActor( ) const
+{
+ return( this->m_ImageViewerActors->GetWindowLevelImageActor( ) );
+}
+*/
+
#endif // cpExtensions_QT4
// eof - $RCSfile$