# How to get an oblique 2d image from a 3d ct-images using vtk via python

Hello.
I want to get an oblique 2d image from a 3d ct-images using vtk via python. I want to extract a plane from my angle in coronal plane, that passes from spesific points, and access a specific oblique plane. I want that plane exactly pass from points. I used from vtkImageReslice and vtkMatrix4x4. Sorry for my English.

Grateful for any help.

For example,
data = (512, 512, 173)
In coronal plane, points >>> p1 = [127, 234, 149], p2 = [145, 234, 128], p3 = [145, 236, 128]

I computed a-angle and created vtkMatrix4x4.
I used from vtkImageReslice and vtkMatrix4x4, but I have some problems.

What does center of this matrix mean?
How can I get the page I want?

This is my code:

import vtk

path = ‘F:/…/’

reslice = vtk.vtkImageReslice()
reslice.SetAutoCropOutput(True)
reslice.SetOutputDimensionality(2)
reslice.SetInterpolationModeToCubic()
reslice.SetSlabNumberOfSlices(1)
reslice.SetOutputSpacing(1.0,1.0,1.0)

center = [127, 234, 149]

axialElement = [
0.76, 0, 0.65, center[0],
0, 1, 0, center[1],
-0.65, 0, 0.76, center[2],
0, 0, 0, 1]

resliceAxes = vtk.vtkMatrix4x4()
resliceAxes.DeepCopy(axialElement)
reslice.SetResliceAxes(resliceAxes)
reslice.Update()

reslicedImg = reslice.GetOutput()

imageActor = vtk.vtkImageActor()
windowLevel = vtk.vtkImageMapToWindowLevelColors()
imageActor.GetMapper().SetInputConnection(windowLevel.GetOutputPort())
windowLevel.SetInputData(reslicedImg)
windowLevel.Update()

ren = vtk.vtkRenderer()