For example, I want to be able to save to my file by pressing a specific key after selecting the cutting plane.
Is it technically possible to save the cutting plane as a 2D image(.raw) in my file?

Yes, it is possible to extract a 2D slice with vtkImageReslice. But vtkImageReslice needs you to set the ResliceAxes that correspond to the cutting plane. This requires some mathematics.

So the question is this: what is the 4x4 matrix that corresponds to the cutting plane?

For the rest of this explanation, you must have a good understanding of how a 4x4 matrix is used in computer graphics. So if you are not sure, then read about it in a good computer graphics textbook.

Here is what we know about the 4x4 matrix that we need:

This 4x4 matrix defines a rotation an a translation. The rotation gives the angulation of the plane, the translation gives the position of the plane.

The 3rd column of the matrix (the column that corresponds to ‘z’) is equal to the normal of the cutting plane.

The 1st, 2nd, and 3rd columns of the matrix are perpendicular to each other (because they define a rotation).

The 4th column of the matrix (the translation) must be such that it translates the origin (0,0,0) to a point on the plane. In other words, the x,y,z parts of the 4th column must be equal to the x,y,z of a point on the plane.

That’s all that I have to say for now, because I’m heading to bed. But it should be enough for you to start thinking about possible solutions. There is no class in VTK that will compute the 4x4 matrix that is needed, so don’t try looking for one.