Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 739e99b5 authored by saubatn's avatar saubatn
Browse files

Merge branch 'bug-19' into develop

parents d655c9be ad4b8f70
......@@ -40,6 +40,7 @@
#include <vtkTextActor.h>
#include <vtkProperty2D.h>
#include <vtkImageFlip.h>
#include <vtkImageMapper3D.h>
using namespace std;
......@@ -179,14 +180,22 @@ void Slice::initActors() {
} else
imgToMapFilter->SetLookupTable(lut);
/// NICO + MAHNU
/* 3D Actor case: directly pluged to the output of imgToMapFilter */
image3DActor->SetInputData(imgToMapFilter->GetOutput());
// image3DActor->SetInputData(imgToMapFilter->GetOutput());
image3DActor->GetMapper()->SetInputConnection(imgToMapFilter->GetOutputPort());
image3DActor->InterpolateOn();
/// NICO + MAHNU
// 2D actors
image2DActor->SetInputData(imgToMapFilter->GetOutput());
// image2DActor->SetInputData(imgToMapFilter->GetOutput());
image2DActor->GetMapper()->SetInputConnection(imgToMapFilter->GetOutputPort());
image2DActor->InterpolateOn();
/// NICO
// image2DActor->SetOpacity(0.5);
// Pick plane
updatePickPlane();
......@@ -214,6 +223,9 @@ void Slice::initActors() {
pickPlaneActor->GetProperty()->SetOpacity(1.0);
pickPlaneActor->GetProperty()->SetLineWidth(2.0);
/// NICO
// imgToMapFilter->Update();
// Orientation 2D Axes
init2DAxesActor();
update2DAxesActorPosition();
......@@ -440,7 +452,7 @@ void Slice::updatePixelActorPosition(double x, double y, double z) {
switch (sliceOrientation) {
case AXIAL:
planeZCoord = z - (originalSpacing[2] / 2);
planeZCoord = z - (originalSpacing[2] / 2.0);
// 0 -> Anterior Point
pixelPoints->InsertPoint(0, x, 0.0 , planeZCoord);
// 1 -> Posterior Point
......@@ -452,7 +464,7 @@ void Slice::updatePixelActorPosition(double x, double y, double z) {
break;
case CORONAL:
planeYCoord = y - (originalSpacing[1] / 2);
planeYCoord = y - (originalSpacing[1] / 2.0);
// 0 -> Superior Point
pixelPoints->InsertPoint(0, x , planeYCoord, originalSize[2]);
// 1 -> Inferior Point
......@@ -464,7 +476,7 @@ void Slice::updatePixelActorPosition(double x, double y, double z) {
break;
case SAGITTAL:
planeXCoord = x + (originalSpacing[0]/2);
planeXCoord = x + (originalSpacing[0] / 2.0);
// 0 -> Superior Point
pixelPoints->InsertPoint(0, planeXCoord, y, originalSize[2]);
// 1 -> Inferior Point
......@@ -503,6 +515,9 @@ void Slice::updatePixelActorPosition(double x, double y, double z) {
vtkSmartPointer<vtkDataSetMapper> aPixelMapper = vtkSmartPointer<vtkDataSetMapper>::New();
aPixelMapper->SetInputData(aPixelGrid);
/// NICO
// aPixelMapper->Update();
pixelActor->SetMapper(aPixelMapper);
pixelActor->GetProperty()->SetAmbient(1.0);
pixelActor->GetProperty()->SetDiffuse(1.0);
......@@ -525,7 +540,7 @@ void Slice::updatePixelActorPosition(double x, double y, double z) {
}
pixelActor->GetProperty()->SetLineWidth( 1.0 );
pixelActor->SetPosition( 0.0, 0.0, 0.0 );
// pixelActor->SetPosition( 0.0, 0.0, 0.0 );
//-- pixelActor can not be picked
pixelActor->PickableOff();
}
......
......@@ -198,7 +198,6 @@ void ImageComponent::updateImageProperties() {
imageSize += ")";
setProperty("Image Size", QVariant(imageSize));
setProperty("Voxel Data Type", QVariant(getDataType()));
setProperty("Display Image in 3D Viewer", QVariant(true));
......@@ -297,8 +296,10 @@ void ImageComponent::setImageData(vtkSmartPointer<vtkImageData> anImageData,
imageResliceFilter->SetOutputDimensionality(3);
imageResliceFilter->SetResliceAxes(initialImageDataTransform->GetMatrix());
imageResliceFilter->Update();
originalImageData = imageResliceFilter->GetOutput();
imageResliceFilter->Update();
originalImageData = imageResliceFilter->GetOutput();
// /// NICO
// originalImageData =vtkSmartPointer<vtkImageData>::New();
// originalImageData->DeepCopy(anImageData);
// 7. Store initialFrameTransform as the current frame
// note: we need to get another matrix instance for the transformation (else it is deleted)
......
......@@ -798,7 +798,7 @@ void InteractiveViewer::initActions() {
// -- display mode
QActionGroup *displayGrp = new QActionGroup ( this );
connect ( displayGrp, SIGNAL ( selected ( QAction* ) ), this, SLOT ( highlightModeChanged ( QAction* ) ) );
connect ( displayGrp, SIGNAL ( triggered ( QAction* ) ), this, SLOT ( highlightModeChanged ( QAction* ) ) );
highlightSelectionAction = new QAction ( tr ( "&Selection" ), displayGrp );
highlightSelectionAction->setCheckable ( true );
......@@ -818,7 +818,7 @@ void InteractiveViewer::initActions() {
//-- camera mode
QActionGroup *cameraModeGrp = new QActionGroup ( this );
connect ( cameraModeGrp, SIGNAL ( selected ( QAction* ) ), this, SLOT ( viewControlModeChanged ( QAction* ) ) );
connect ( cameraModeGrp, SIGNAL ( triggered ( QAction* ) ), this, SLOT ( viewControlModeChanged ( QAction* ) ) );
controlModeTrackballAction = new QAction ( tr ( "&Trackball" ), cameraModeGrp );
controlModeTrackballAction->setCheckable ( true );
......@@ -834,7 +834,7 @@ void InteractiveViewer::initActions() {
//-- camera orientation mode
QActionGroup *cameraOrientationGrp = new QActionGroup ( this );
connect ( cameraOrientationGrp, SIGNAL ( selected ( QAction* ) ), this, SLOT ( cameraOrientationChanged ( QAction* ) ) );
connect ( cameraOrientationGrp, SIGNAL ( triggered ( QAction* ) ), this, SLOT ( cameraOrientationChanged ( QAction* ) ) );
cameraOrientationRightDownAction = new QAction ( tr ( "x-right y-down z-back" ), cameraOrientationGrp );
cameraOrientationRightDownAction->setCheckable ( true );
......@@ -901,7 +901,7 @@ void InteractiveViewer::initActions() {
//--- actions of the picking menu
QActionGroup *pickingGrp = new QActionGroup ( this );
connect ( pickingGrp, SIGNAL ( selected ( QAction* ) ), this, SLOT ( pickingModeChanged ( QAction* ) ) );
connect ( pickingGrp, SIGNAL ( triggered ( QAction* ) ), this, SLOT ( pickingModeChanged ( QAction* ) ) );
pickCellAction = new QAction ( QPixmap ( ":/pick_cell" ), tr ( "Pick &cell" ), pickingGrp );
pickCellAction->setCheckable ( true );
......
......@@ -389,12 +389,14 @@ RendererWidget::RendererWidget(QWidget* parent, ControlMode mode) : QVTKWidget(p
pointSize = 4.0;
//-- render window
vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
/// NICO + MAHNU
vtkSmartPointer<vtkRenderWindow> renderWindow = GetRenderWindow();
// vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
//-- renderer
renderer = vtkSmartPointer<vtkRenderer>::New();
renderWindow->AddRenderer( renderer );
SetRenderWindow( renderWindow );
// SetRenderWindow( renderWindow ); /// NICO + MAHNU
//-- interactor
interactor = vtkSmartPointer<QVTKInteractor>::New();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment