I want to do this work in The Reconstruction Toolkit, and I know how to use a .mha file to reconstruction. But i do not know how to store .raw image sequence into a .mha file(or multiple if possible) with correct origin and direction.
In RTK 3D circular projection geometry (http://www.openrtk.org/Doxygen/DocGeo3D.html), the v-axis of the physical coordinate system is opposite to the v-axis of the image.
The size of X-ray image is 1408×1408, the pixelsize is 0.308. I want to set the origin of the physical coordinates at the center of the image.

How to set origin,direction? OR to recommend a tool that is better than RTK.

In RTK, the stack of projection images is read as a 3D image (itk::Image<float, 3>). If you want to set the origin of the coordinate system at the center of the projection image, you need to set itk::Image<float, 3>::m_Origin (with itk::Image<float, 3>::SetOrigin) to -0.5*(number of pixels -1)* spacing, i.e. -0.5 * 1407 * 0.308=-216.678 for the first and second coordinates. The third coordinate is not used by RTK. The direction can be set to identity.

I don’t see why you think that “the v-axis of the physical coordinate system is opposite to the v-axis of the image”? This is not what the documentation drawing indicate at least.

I can try to help if you share your projection matrices and a set of data.

Thanks for your answer.
In the RTK WIKI, RTK: RTK 3D circular projection geometry. 9 geometric parameters can determine a camera. In 2D image, u→,v↓ . But in this 3D circular geometry, u→, v↑. why?
I can get projection matrice by using DLT and optimization. But in pinhole model, u→, v↓. can i input this kinds of projection matrice?

Thanks for your answer.
In the RTK WIKI, RTK: RTK 3D circular projection geometry. 9 geometric parameters can determine a camera. In 2D image, u→,v↓ . But in this 3D circular geometry, u→, v↑. why?
I can get projection matrice by using DLT and optimization. But in pinhole model, u→, v↓. can i input this kinds of projection matrice?

I believe you can describe any projection geometry, possibly with negative SourceToDetectorDistance and SourceToIsocenterDistance. If the only problem is the orientation of v, you can use a 180° OutOfPlaneAngle.

The world coordinate system of pinhole model is different from 3DCIRCULARPROJECTIONGEOMETRY but this difference doesnt matter in this problem because I pre-process 3D points.

I got a Master’s degree in Pure Mathematics so that donot worry about my knowledge about 3D geometry. I can transform these parameter from two models (pinhole and RTK) and verified through simulation experiments.

According to my understanding, there are two methods using rtkfdk.exe:

input projection matrice from DLT, do not set --newdirection. (In this case, I always get a negative SID in XML.)

get projection matrice by DLT, transform DLT results to get 9 geometric parameters or M_p in RTK: RTK 3D circular projection geometry, input 9 parameters or M_p, set - newdirection 1 0 0, 0 -1 0, 0 0 1.

(tips: If the Y-axis of the world coordinates coincides with the rotation axis of CBCT system, the i-th gantry angle can be set 360°/imagenum*(i-1), the other 8 parameters are the same for all images.)

I think the projection matrice of M_p is different from the projection matrice obtained by DLT because the direction of v in these 2 models are different.

The world coordinate system of pinhole model is different from 3DCIRCULARPROJECTIONGEOMETRY but this difference doesnt matter in this problem because I pre-process 3D points.

I got a Master’s degree in Pure Mathematics so that donot worry about my knowledge about 3D geometry. I can transform these parameter from two models (pinhole and RTK) and verified through simulation experiments.

According to my understanding, there are two methods using rtkfdk.exe:

input projection matrice from DLT, do not set --newdirection. (In this case, I always get a negative SID in XML.)

get projection matrice by DLT, transform DLT results to get 9 geometric parameters or M_p in RTK: RTK 3D circular projection geometry, input 9 parameters or M_p, set - newdirection 1 0 0, 0 -1 0, 0 0 1.

(tips: If the Y-axis of the world coordinates coincides with the rotation axis of CBCT system, the i-th gantry angle can be set 360°/imagenum*(i-1), the other 8 parameters are the same for all images.)

I think the projection matrice of M_p is different from the projection matrice obtained by DLT because the direction of v in these 2 models are different.
[/quote]

You simply have to write a .mhd header file. There are several solutions to do this, one is in Python, read in the raw file with numpy and convert it with the itk.image_from_array function.