17 #ifndef MITKPLANECLIPPING_H_HEADER_INCLUDED
18 #define MITKPLANECLIPPING_H_HEADER_INCLUDED
22 #include <vtkPoints.h>
23 #include <vtkTransform.h>
27 namespace PlaneClipping
34 points->GetPoint(p1, point1);
35 points->GetPoint(p2, point2);
37 if ((point1[2] * point2[2] <= 0.0) && (point1[2] != point2[2]))
40 x = (point1[0] * point2[2] - point1[2] * point2[0]) / (point2[2] - point1[2]);
41 y = (point1[1] * point2[2] - point1[2] * point2[1]) / (point2[2] - point1[2]);
59 bounds[4] = bounds[5] = 0.0;
85 points->InsertPoint(0, bbMin[0] - 0.5, bbMin[1] - 0.5, bbMin[2] - 0.5);
86 points->InsertPoint(1, bbMin[0] - 0.5, bbMin[1] - 0.5, bbMax[2] - 0.5);
87 points->InsertPoint(2, bbMin[0] - 0.5, bbMax[1] - 0.5, bbMax[2] - 0.5);
88 points->InsertPoint(3, bbMin[0] - 0.5, bbMax[1] - 0.5, bbMin[2] - 0.5);
89 points->InsertPoint(4, bbMax[0] - 0.5, bbMin[1] - 0.5, bbMin[2] - 0.5);
90 points->InsertPoint(5, bbMax[0] - 0.5, bbMin[1] - 0.5, bbMax[2] - 0.5);
91 points->InsertPoint(6, bbMax[0] - 0.5, bbMax[1] - 0.5, bbMax[2] - 0.5);
92 points->InsertPoint(7, bbMax[0] - 0.5, bbMax[1] - 0.5, bbMin[2] - 0.5);
96 points->InsertPoint(0, bbMin[0], bbMin[1], bbMin[2]);
97 points->InsertPoint(1, bbMin[0], bbMin[1], bbMax[2]);
98 points->InsertPoint(2, bbMin[0], bbMax[1], bbMax[2]);
99 points->InsertPoint(3, bbMin[0], bbMax[1], bbMin[2]);
100 points->InsertPoint(4, bbMax[0], bbMin[1], bbMin[2]);
101 points->InsertPoint(5, bbMax[0], bbMin[1], bbMax[2]);
102 points->InsertPoint(6, bbMax[0], bbMax[1], bbMax[2]);
103 points->InsertPoint(7, bbMax[0], bbMax[1], bbMin[2]);
109 transform->Identity();
110 transform->Concatenate(planeGeometry->
GetVtkTransform()->GetLinearInverse());
114 transform->TransformPoints(points, newPoints);
116 bounds[0] = bounds[2] = 10000000.0;
117 bounds[1] = bounds[3] = -10000000.0;
118 bounds[4] = bounds[5] = 0.0;
133 if ((bounds[0] > 9999999.0) || (bounds[2] > 9999999.0) || (bounds[1] < -9999999.0) || (bounds[3] < -9999999.0))
142 bounds[0] *= planeSpacing[0];
143 bounds[1] *= planeSpacing[0];
144 bounds[2] *= planeSpacing[1];
145 bounds[3] *= planeSpacing[1];
146 bounds[4] *= planeSpacing[2];
147 bounds[5] *= planeSpacing[2];
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBox
Standard 3D-BoundingBox typedef.
static bool CalculateClippedPlaneBounds(const BaseGeometry *boundingGeometry, const PlaneGeometry *planeGeometry, double *bounds)
Calculate the bounding box of the resliced image. This is necessary for arbitrarily rotated planes in...
DataCollection - Class to facilitate loading/accessing structured data.
const mitk::Vector3D GetSpacing() const
Get the spacing (size of a pixel).
static bool LineIntersectZero(vtkPoints *points, int p1, int p2, double *bounds)
Internal helper method for intersection testing used only in CalculateClippedPlaneBounds() ...
Describes a two-dimensional, rectangular plane.
vtkLinearTransform * GetVtkTransform() const
Get the m_IndexToWorldTransform as a vtkLinearTransform.
virtual bool GetImageGeometry() const
Is this an ImageGeometry?
BaseGeometry Describes the geometry of a data object.
virtual const BoundingBoxType * GetBoundingBox()
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.