Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CamiTK
CamiTK Community Edition
Commits
739e99b5
Commit
739e99b5
authored
Mar 24, 2016
by
saubatn
Browse files
Merge branch 'bug-19' into develop
parents
d655c9be
ad4b8f70
Changes
4
Hide whitespace changes
Inline
Side-by-side
sdk/libraries/core/component/Slice.cpp
View file @
739e99b5
...
...
@@ -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
();
}
...
...
sdk/libraries/core/component/image/ImageComponent.cpp
View file @
739e99b5
...
...
@@ -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)
...
...
sdk/libraries/core/viewer/InteractiveViewer.cpp
View file @
739e99b5
...
...
@@ -798,7 +798,7 @@ void InteractiveViewer::initActions() {
// -- display mode
QActionGroup
*
displayGrp
=
new
QActionGroup
(
this
);
connect
(
displayGrp
,
SIGNAL
(
select
ed
(
QAction
*
)
),
this
,
SLOT
(
highlightModeChanged
(
QAction
*
)
)
);
connect
(
displayGrp
,
SIGNAL
(
trigger
ed
(
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
(
select
ed
(
QAction
*
)
),
this
,
SLOT
(
viewControlModeChanged
(
QAction
*
)
)
);
connect
(
cameraModeGrp
,
SIGNAL
(
trigger
ed
(
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
(
select
ed
(
QAction
*
)
),
this
,
SLOT
(
cameraOrientationChanged
(
QAction
*
)
)
);
connect
(
cameraOrientationGrp
,
SIGNAL
(
trigger
ed
(
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
(
select
ed
(
QAction
*
)
),
this
,
SLOT
(
pickingModeChanged
(
QAction
*
)
)
);
connect
(
pickingGrp
,
SIGNAL
(
trigger
ed
(
QAction
*
)
),
this
,
SLOT
(
pickingModeChanged
(
QAction
*
)
)
);
pickCellAction
=
new
QAction
(
QPixmap
(
":/pick_cell"
),
tr
(
"Pick &cell"
),
pickingGrp
);
pickCellAction
->
setCheckable
(
true
);
...
...
sdk/libraries/core/viewer/RendererWidget.cpp
View file @
739e99b5
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment