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
ad4b8f70
Commit
ad4b8f70
authored
Mar 24, 2016
by
saubatn
Browse files
TEST Fixing bug 19
parent
8c4dcbdf
Changes
3
Hide whitespace changes
Inline
Side-by-side
sdk/libraries/core/component/Slice.cpp
View file @
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
();
}
...
...
sdk/libraries/core/component/image/ImageComponent.cpp
View file @
ad4b8f70
...
...
@@ -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/RendererWidget.cpp
View file @
ad4b8f70
...
...
@@ -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