#ifdef cpExtensions_QT4
#include <cpExtensions/Visualization/ImageOutlineActor.h>
-#include <cpExtensions/Visualization/MPR3DActors.h>
-#include <cpExtensions/Visualization/LUTImageActor.h>
#include <cpExtensions/Visualization/WindowLevelImageActor.h>
-#include <vtkActor.h>
#include <vtkImageData.h>
-#include <vtkPolyData.h>
+#include <vtkPlane.h>
+
+/* TODO
+ #include <cpExtensions/Visualization/MPR3DActors.h>
+ #include <cpExtensions/Visualization/LUTImageActor.h>
+
+ #include <vtkActor.h>
+ #include <vtkPolyData.h>
+*/
// -------------------------------------------------------------------------
cpExtensions::QT::MPR3DWidget::
: Superclass( parent, f ),
m_ImageName( "" )
{
- this->m_Actors =
- vtkSmartPointer< cpExtensions::Visualization::MPR3DActors >::New( );
+ /* TODO
+ this->m_Actors =
+ vtkSmartPointer< cpExtensions::Visualization::MPR3DActors >::New( );
+ */
}
// -------------------------------------------------------------------------
{
}
+// -------------------------------------------------------------------------
+void cpExtensions::QT::MPR3DWidget::
+Clear( )
+{
+ this->RemoveViewProps( );
+ this->m_ImageName = "";
+}
+
// -------------------------------------------------------------------------
void cpExtensions::QT::MPR3DWidget::
SetImage( vtkImageData* image, const std::string& name )
+{
+ if( name == "" )
+ return;
+ if( this->m_ImageName != "" )
+ this->Clear( );
+ this->m_ImageName = name;
+
+ for( unsigned int o = 0; o < 3; ++o )
+ {
+ this->m_WLActors[ o ] = vtkSmartPointer< TWLActor >::New( );
+ this->m_WLActors[ o ]->SetImage( image );
+ this->m_WLActors[ o ]->SetOrientation( o );
+
+ this->m_OLActors[ o ] = vtkSmartPointer< TOLActor >::New( );
+ this->m_OLActors[ o ]->SetBounds(
+ o, image->GetBounds( )[ o << 1 ], image->GetBounds( )
+ );
+
+ this->AddViewProp( this->m_WLActors[ o ], this->m_ImageName );
+ this->AddAuxViewProp( this->m_OLActors[ o ], this->m_ImageName );
+ this->ResetCamera( );
+
+ } // rof
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::QT::MPR3DWidget::
+TWLActor* cpExtensions::QT::MPR3DWidget::
+GetImageActor( int o )
+{
+ return( this->m_WLActors[ o % 3 ] );
+}
+
+// -------------------------------------------------------------------------
+const cpExtensions::QT::MPR3DWidget::
+TWLActor* cpExtensions::QT::MPR3DWidget::
+GetImageActor( int o ) const
+{
+ return( this->m_WLActors[ o % 3 ] );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::MPR3DWidget::
+SetSliceNumber( int orientation, int slice )
+{
+ int o = orientation % 3;
+ this->m_WLActors[ o ]->SetSliceNumber( slice );
+ this->m_OLActors[ o ]->SetBounds(
+ o,
+ this->m_WLActors[ o ]->GetSlicePlane( )->GetOrigin( )[ o ],
+ this->m_WLActors[ o ]->GetImage( )->GetBounds( )
+ );
+ this->Render( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::MPR3DWidget::
+SetSlicesNumbers( int x, int y, int z )
+{
+ int s[] = { x, y, z };
+ for( int o = 0; o < 3; ++o )
+ {
+ this->m_WLActors[ o ]->SetSliceNumber( s[ o ] );
+ this->m_OLActors[ o ]->SetBounds(
+ o,
+ this->m_WLActors[ o ]->GetSlicePlane( )->GetOrigin( )[ o ],
+ this->m_WLActors[ o ]->GetImage( )->GetBounds( )
+ );
+
+ } // rof
+ this->Render( );
+}
+
+// -------------------------------------------------------------------------
+/*
+void cpExtensions::QT::MPR3DWidget::
+SetImage( vtkImageData* image, const std::string& name )
{
if( this->m_ImageName != "" )
{
} // fi
- /* TODO
return;
auto image = dynamic_cast< vtkImageData* >( data );
{
} // fi
- */
}
// -------------------------------------------------------------------------
this->m_Actors->SetImageInterpolation( i );
this->Render( );
}
+ */
#endif // cpExtensions_QT4