Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
CamiTK Community Edition
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CamiTK
CamiTK Community Edition
Commits
42343ce0
Commit
42343ce0
authored
Jan 03, 2020
by
Emmanuel Promayon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIXED improved Slice API doc
parent
0af24b27
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
19 deletions
+30
-19
sdk/libraries/core/component/Slice.cpp
sdk/libraries/core/component/Slice.cpp
+1
-14
sdk/libraries/core/component/Slice.h
sdk/libraries/core/component/Slice.h
+29
-5
No files found.
sdk/libraries/core/component/Slice.cpp
View file @
42343ce0
...
@@ -133,7 +133,6 @@ void Slice::volumeToReslicedCoords(const double* xyz, double* ijk) {
...
@@ -133,7 +133,6 @@ void Slice::volumeToReslicedCoords(const double* xyz, double* ijk) {
// -------------------- getNumberOfSlices --------------------
// -------------------- getNumberOfSlices --------------------
int
Slice
::
getNumberOfSlices
()
const
{
int
Slice
::
getNumberOfSlices
()
const
{
// Array containing first and last indices of the image in each direction
// Array containing first and last indices of the image in each direction
// 0 & 1 -> x; 2 and 3 -> y; 4 & 5 -> z
// 0 & 1 -> x; 2 and 3 -> y; 4 & 5 -> z
int
extent
[
6
];
int
extent
[
6
];
...
@@ -249,7 +248,6 @@ void Slice::setPixelRealPosition(double x, double y, double z) {
...
@@ -249,7 +248,6 @@ void Slice::setPixelRealPosition(double x, double y, double z) {
updatePixelActor
(
x
,
y
,
z
);
updatePixelActor
(
x
,
y
,
z
);
}
}
// -------------------- get2DImageActor --------------------
// -------------------- get2DImageActor --------------------
vtkSmartPointer
<
vtkImageActor
>
Slice
::
get2DImageActor
()
const
{
vtkSmartPointer
<
vtkImageActor
>
Slice
::
get2DImageActor
()
const
{
return
image2DActor
;
return
image2DActor
;
...
@@ -299,12 +297,7 @@ void Slice::initActors() {
...
@@ -299,12 +297,7 @@ void Slice::initActors() {
// -------------------- initPickPlaneActor --------------------
// -------------------- initPickPlaneActor --------------------
void
Slice
::
initPickPlaneActor
()
{
void
Slice
::
initPickPlaneActor
()
{
// create the pixel actor 3D geometry
// create the picked plane actor 3D geometry
// Create the 8 points that describes the plane.
// The points are set at the coordinates of the (red / blue / green) border of the current image plane.
// To make sure that the borders are visible in any specific orientation,
// for quads are build. Each quad goes out of the image plane on both side
// (hit "t" on the slice viewer and move the camera around to see the quad geometries)
vtkSmartPointer
<
vtkPoints
>
planePoints
=
vtkSmartPointer
<
vtkPoints
>::
New
();
vtkSmartPointer
<
vtkPoints
>
planePoints
=
vtkSmartPointer
<
vtkPoints
>::
New
();
planePoints
->
SetNumberOfPoints
(
8
);
planePoints
->
SetNumberOfPoints
(
8
);
...
@@ -388,11 +381,6 @@ void Slice::initPickPlaneActor() {
...
@@ -388,11 +381,6 @@ void Slice::initPickPlaneActor() {
// -------------------- initPixelActor --------------------
// -------------------- initPixelActor --------------------
void
Slice
::
initPixelActor
()
{
void
Slice
::
initPixelActor
()
{
// create the pixel actor 3D geometry
// create the pixel actor 3D geometry
// Create the 8 points that describes the cross centered on the currently picked pixel
// The points are set at the coordinates of the (red / blue / green) cross around the picked pixel
// to make sure that the cross is visible in any specific orientation,
// two quads are build. Each quad goes out of the image plane on both side
// (hit "t" on the slice viewer and move the camera around to see the quad geometries)
vtkSmartPointer
<
vtkPoints
>
pixelPoints
=
vtkSmartPointer
<
vtkPoints
>::
New
();
vtkSmartPointer
<
vtkPoints
>
pixelPoints
=
vtkSmartPointer
<
vtkPoints
>::
New
();
pixelPoints
->
SetNumberOfPoints
(
8
);
pixelPoints
->
SetNumberOfPoints
(
8
);
...
@@ -595,7 +583,6 @@ bool Slice::addProp(const QString& name, vtkSmartPointer< vtkProp > prop) {
...
@@ -595,7 +583,6 @@ bool Slice::addProp(const QString& name, vtkSmartPointer< vtkProp > prop) {
//------------------------------- getProp ----------------------------------------
//------------------------------- getProp ----------------------------------------
vtkSmartPointer
<
vtkProp
>
Slice
::
getProp
(
const
QString
&
name
)
{
vtkSmartPointer
<
vtkProp
>
Slice
::
getProp
(
const
QString
&
name
)
{
if
(
extraProp
.
contains
(
name
))
{
if
(
extraProp
.
contains
(
name
))
{
return
extraProp
.
value
(
name
);
return
extraProp
.
value
(
name
);
}
}
...
...
sdk/libraries/core/component/Slice.h
View file @
42343ce0
...
@@ -43,14 +43,38 @@ namespace camitk {
...
@@ -43,14 +43,38 @@ namespace camitk {
* @ingroup group_sdk_libraries_core_component
* @ingroup group_sdk_libraries_core_component
*
*
* @brief
* @brief
* Display a slice (i.e. an image or BitMap) of an @ref camitk::ImageComponent "ImageComponent"
* Display a slice (i.e. an image or BitMap) of an @ref camitk::ImageComponent "ImageComponent". Helper class.
*
*
* Uses vtkImageActor::SetDisplayExtent for 3D and 2D Axial, Coronal and Sagittal representaiton.
* This class manages the visual representation of one slice of a volume image.
* Re-position the camera for the 2D views.
* The slice depends on the orientation and the currently selected slice index.
*
* A slice is represented in 2D and 3D thanks to:
* - image2DActor that provides a 2D representation (the slice in the world reference frame)
* - image3DActor that provides a 3D representation (the slice at this actual 3D position)
* Both are updated thanks to vtkImageActor::SetDisplayExtent.
*
* \note the setImageWorldTransform(...) methods is used to set the user transform of the image 3D actor.
*
*
* Slice also manages two other actors to visualize user picking inside the image:
* Slice also manages two other actors to visualize user picking inside the image:
* -
* - the picked plane actor (a wireframe box made of 4 quads around the picked plane) that shows the image border
* - the picked pixel actor (two wireframe quads centered on the currently picked pixel) that shows the position
* of the currently picked pixel.
* These two actors are build using unstructured grids.
*
* The picked plane actor is defined by 8 points surrounding the current image plane.
* The points are set at the coordinates of the (red / blue / green) border of the current image plane.
* To make sure that the borders are visible in any specific orientation, four quads are build from this points.
* Each quad goes out of the image plane on both side (back and front).
*
* The picked pixel actor is also made of 8 points that describes the cross centered on the currently picked pixel.
* The points are set at the coordinates of the (red / blue / green) cross around the picked pixel.
* To make sure that the cross is visible in any specific orientation, two quads are build from this 8 points
* Each quad goes out of the image plane on both side
*
* \note (easter egg) hit "t" on any slice viewer and move the camera around to see the quad geometries and
* how these extra actors are build.
*
*
*
* \verbatim
* \verbatim
* 3D Volume 2D Slice
* 3D Volume 2D Slice
* ________ /|\
* ________ /|\
...
...
Write
Preview
Markdown
is supported
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