stat = imf.execute_algorithm('CT.loadProjectionMatrices',[matrix[0],matrix[1]])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: Unable to cast Python instance of type <class ‘numpy.ndarray’> to C++ type ‘?’ (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)
how can i load two projection matrix to a cone beam data
It looks like CT.loadProjectionMatrices doesn’t correspond to any existing CT algorithm, and the matrix loading function is not exposed to the Python SDK yet.
But we have 2 alternative algorithms: CT.ProjectionMatrixIoAlgorithm and CT.CT.Load_projection_matrix_file, they should be available through the CT algorithm factory.
The later one should be more suited to load your matrices.
Please use the helper imfusion.available_algorithms() to check if an algorithm is supported.
TypeError: sequence item 0: Unable to cast Python instance of type <class ‘numpy.ndarray’> to C++ type ‘?’ (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)
Hi,
I don’t think you’re using our Python SDK correctly:
You’re passing two numpy arrays as the parameters for the algorithm execution, that is not correct. The parameters in this function call is supposed to be the parameter(s) of the corresponding C++ algorithm’s constructor. In this case, it is a SharedImageSet instance.
The other missing parameter is an algorithm property object, which specifies the algorithm’s parameters. For this specific CT.CT.Load_projection_matrix_file algorithm, you need to configure the matrixFile and flipCameraDirection
Putting these together, we have an example below to load your matrices from a matrix file:
# cbData is a SharedImageSet instance holding the cone beam data you want to setup the geometry algP = imfusion.algorithm_properties('CT.CT.Load_projection_matrix_file', [cbData])
on a more general note: You can always get a template for how to invoke an algorithm in Python from the Workspace Editor (found in the “View” menu).
When you execute an algorithm in the Suite an entry for it with the matching configuration will be created in the Workspace Editor’s list of algorithms (left side of the window).
Regarding your question about points. Could you please elaborate what you are trying to do and what API you are using? In most cases Annotations like points are located in world space.
To set the ROI for the Xray 2D3D registration what function can i use? I am able to perform it in the suite by cannot find the equivalent functions to perform in python.
file:///C:/Program%20Files/ImFusion/ImFusion%20Suite/doc/SDK/class_im_fusion_1_1_c_t_1_1_x_ray2_d3_d_registration_algorithm.html#
How can i get access to the maskEditor in the python SDK for 2D images. Looking forward to your response.
i get the error
[CT.XRay2D3DRegistration.Algorithm] Unable to store masks in history
[CT.XRay2D3DRegistration.Algorithm] Unable to store masks in history
[CT.XRay2D3DRegistration.Algorithm] Unable to store masks in history
[CT.XRay2D3DRegistration.Algorithm] Unable to store masks in history