read the OpenCV Style projection matrix from text file
and
Get the ‘Shots With Geometry’ means after the read of Projection matrix and Image data we need to
combine the Image Shots (AP & LAT) with Projection matrix
so the use into
ImFusion::CT::XRay2D3DRegistrationAlgorithm* xrayRegistAlg = new ImFusion::CT::XRay2D3DRegistrationAlgorithm(shotsWithGeom, volume);
Actually I read AP & LAT image data, Volume and load the projection matrix (in text file format)
but didn’t get how to set the projection matrix to AP and LAT Image data so that able to use into ImFusion::CT::XRay2D3DRegistrationAlgorithm after initialization
so I request you please provide your code snippet so that I will able to verify and proceed
Hi Ravi,
Since you wanted to develop a registration application using Cpp at your side, I assume you also have access to our SDK documentation.
If you don’t have it, please get back to us directly via email so we can find a solution for the issue.
Now, if you have SDK documentation, then you can find the answers for your questions as below:
To read the projection matrix (openCV style), you can use loadMatrices function in the ConeBeamGeometry class.
In general you can find detail of how we define the geometry, what are the meaning of different matrices, and code snippet to load matrices in our SDK documentation under: Plugins >> ImFusionCT Module >> Cone Beam Geometry (for general information), and ConeBeamGeoemtry for the API.
Please see Xray2D3DRegistrationAlgorithm section in our SDK for more detail of the usage.
In general, you would need:
shots, stored as a SharedImageSet, and having ConeBeamGeometry as data component. You can also use CT::Utils namespace as helpers to create a SharedImageSet`` container for your data with a ConeBeamGeometry``` component.
volume, also stored as a SharedImageSet
We have ConvertToConeBeamData algorithm to do so.
Here are the protype code as an example. But please do refer to our SDK documentation for full functionalities.
/// including necessary headers
// creating a sis container preparing for preprocessing
// ap and lat are 2 SharedImageSet storing your original AP/LAT data
auto sis = std::make_unique<SharedImageSet>();
sis->setModality(Data::Xray);
sis->add(ap->getShared());
sis->add(lat->getShared());
// preprocess the data, convert sis to ConeBeamData using ConvertToConeBeamData algorithm
// please do add some sanity check if the ```alg``` is instantiated properly and ```out``` is valid
auto alg = std::make_unique<ConvertToConeBeamData>(*sis);
alg->compute();
auto out = alg->takeOutput().extractFirstImage();
// get geometry and load the matrices
ConeBeamGeometry& geom = CT::Utils::getConeBeamMetadata(*out).geometry();
geom.loadMatrices("path_to_matrice_file", width, height); // width, height are pixels size of your images
geom.useMatrices = true;