Using ImFusion SDK to achieve the 2D 3D Image Registration and Fusion

Hello, Everyone
I am trying to build a standalone application for 2D-3D Image Registration and Fusion.
I go through the ImFusion SDK Document.
Install the ImFusion Suite and activate through key, and now I am trying to use this to make a standalone application for that I am trying to activate the licence through key and use the ImFusionlib, Plugins etc
using :

  1. ImFusion::LicenseManagerSDK Namespace Reference
  2. ImFusion::Framework
    but it showing error and not working.
    Please share your point of view what should be the best way to do so that I am able to use the ImFusion SDK for my further work.
    Please share your code snippet and notes

Thank your for anticipation

One of the example that I have tried is -
#include <ImFusion/Base/LicenseManagerSDK.h> // Licence Manager SDK
#include <ImFusion/Base/Config.h>
#include <ImFusion/Base/Algorithm.h>
#include <ImFusion/Base/Framework.h>
#include <ImFusion/Base/AlgorithmControllerFactory.h>
#include <ImFusion/Base/AlgorithmFactory.h>
#include <ImFusion/Core/Log.h>
#include <ImFusion/Core/Platform.h>
#include <ImFusion/Base/CustomImage.h> // Further test it
#include <ImFusion/Base/DataLink.h> //
#include <ImFusion/Base/DatasetLicenseComponent.h> //
#include <ImFusion/Base/ErrorFunction.h>
#include <ImFusion/Base/ImFusionFile.h>
#include <ImFusion/Base/ImFusionFilePlugin.h>
#include <ImFusion/Base/ImFusionPlugin.h>
#include <ImFusion/Base/Settings.h>
#include <ImFusion/Core/Configurable.h>
#include <ImFusion/CT/CTPlugin.h>
#include <ImFusion/CT/EventHandler/EventHandler.h>
#include <ImFusion/CT/EventHandler/EventHandler.h>
#include <ImFusion/Dicom/DicomPlugin.h>
#include <ImFusion/Dicom/DicomPluginSettings.h>
#include <ImFusion/Dicom/GUI/DicomGuiPlugin.h>
#include <ImFusion/Dicom/GUI/DicomGuiConfig.h>
#include <ImFusion/GUI/LicenseManagerDialog.h>
#include <ImFusion/GUI/Settings.h>
#include <ImFusion/GUI/LicenseManagerDialog.h>
#include <ImFusion/GUI/SettingsDialog.h>
#include <ImFusion/ImageMath/ImageMathPlugin.h>
#include <ImFusion/ImageMath/ImageMathConfig.h>
//#include <ImFusion/ImFusionLibVersionInfo.h> // Library Version Information
//#include <ImFusion/LiveUS/LiveUSPlugin.h> // Not need in our case
#include <ImFusion/ML/MLPlugin.h>
#include <ImFusion/Reg/RegPlugin.h>
#include <ImFusion/Seg/SegPlugin.h>
#include <ImFusion/Stream/StreamPlugin.h>

#include <ImFusion/Base/ImFusionPlugin.h>
#include <ImFusion/GUI/ApplicationController.h>

// Note: I am writing this in constructor

if(ImFusion::LicenceManagerSDK::isActivated)
{
std::cout<<“Licence activated prior”<<std::endl;
ImFusion::Framework::deinit();
}
else
{
std::cout<<“Licence not Activated”<<std::endl;
}

std::string activationKey = “xxxxx-xxxxx-xxxxx-xxxxx-xxxxx”;
ImFusion::Framework::InitConfig initconfig;

if(!ImFusion::LicenceManagerSDK::isActivated())
{
try
{
ImFusion::LicenseManagerSDK::setKeyAndCode(activationKey);
}
catch (const std::exception& error)
{
std::cout<<“Error”<<&error<<std::endl;
}

}
else
{
std::cout<<“ImFusion Licence Allredy activated”<<endl;
}

ImFusion::Framework::loadedPlugins();
initconfig.loadedPlugins = true;
ImFusion::Framework::init(std::move(initconfig));

But it’s not working, showing run time error

Hi Ravi,

the code looks correct. Could you please additionally post the runtime output? Also ImFusion::LicenseManagerSDK::setKeyAndCode doesn’t throw but returns an error code for the license status. That might also give an indication for what is going wrong.

Hi Mueller,
Thank you so much for your time
Here I am attaching the details of run time error, as well as the output window


Hi Ravi,

sorry for the late response. I tried your code but could not reproduce the crash. However, it’s weird that the exception is inside Qt5Core.dll. Can you check whether the Qt version contained in the ImFusion install directory is the same version you are using here (i.e. 5.12.11)? You can check the version by right-clicking the Qt5Core.dll in the ImFusion install directory and selecting “Properties” → “Details”.

As we know, its need to initialize the ImFusion SDK first before to use this SDK functions or modules, for that I am trying to initialize the ImFusion SDK in the constructor of the main class.
As you approve that the core is correct. Now as per the QT has concern I am using QT5.12.11 where as from ImFusion suite (Properties → Details) I found that it’s showing QT 5.15.2.
So, is it need to use qt 5.15.2 in place of qt 5.12.11 with the same code?
If I want to use qt 5.12.11 then how should I proceed?

Thank You

[Note: This post was moved to this thread by moderator @schultezb, reason: the author opened two separate threads with the same question]

To initialize a library I am write the below code into the constructor of the Mainwindow
Note 1: I all ready install the ImFusion Suite as well, in this case I have one more doubt is that
If I all ready installed the application and provided the “KEY” then during initialization I should not use the key
Note 2: ImFusion Suite (version 3.1.14), in this ImFusion while checking form “Properties → Details” I found that it using QT 5.15.2
where as I am using qt 5.12.11.
Is it would be only the reason or any thing else also i need to consider.

I posted my first doubt regarding the initialization of the ImFusion SDK On 09 August 2023
since that I don’t get any proper resolution and I don’t seen any information in detail to resolve it in Imfusion Documents as well.
Please Send me a pdf if possible that include every details to initiate the SDK and use for the purpose I want to use it, so that I need not to ask again.
first time i am facing this issue with any library till now.

Note: In my computer I install Imfusion Suite
#include <ImFusion/Base/LicenseManagerSDK.h> // Licence Manager SDK
#include <ImFusion/Base/Config.h>
#include <ImFusion/Base/Algorithm.h>
#include <ImFusion/Base/Framework.h>
#include <ImFusion/Base/AlgorithmControllerFactory.h>
#include <ImFusion/Base/AlgorithmFactory.h>
#include <ImFusion/Core/Log.h>
#include <ImFusion/Core/Platform.h>
#include <ImFusion/Base/CustomImage.h> // Further test it
#include <ImFusion/Base/DataLink.h> //
#include <ImFusion/Base/DatasetLicenseComponent.h> //
#include <ImFusion/Base/ErrorFunction.h>
#include <ImFusion/Base/ImFusionFile.h>
#include <ImFusion/Base/ImFusionFilePlugin.h>
#include <ImFusion/Base/ImFusionPlugin.h>
#include <ImFusion/Base/Settings.h>
#include <ImFusion/Core/Configurable.h>
#include <ImFusion/CT/CTPlugin.h>
#include <ImFusion/CT/EventHandler/EventHandler.h>
#include <ImFusion/CT/EventHandler/EventHandler.h>
#include <ImFusion/Dicom/DicomPlugin.h>
#include <ImFusion/Dicom/DicomPluginSettings.h>
#include <ImFusion/Dicom/GUI/DicomGuiPlugin.h>
#include <ImFusion/Dicom/GUI/DicomGuiConfig.h>
#include <ImFusion/GUI/LicenseManagerDialog.h>
#include <ImFusion/GUI/Settings.h>
#include <ImFusion/GUI/LicenseManagerDialog.h>
#include <ImFusion/GUI/SettingsDialog.h>
#include <ImFusion/ImageMath/ImageMathPlugin.h>
#include <ImFusion/ImageMath/ImageMathConfig.h>
//#include <ImFusion/ImFusionLibVersionInfo.h> // Library Version Information
//#include <ImFusion/LiveUS/LiveUSPlugin.h> // Not need in our case
#include <ImFusion/ML/MLPlugin.h>
#include <ImFusion/Reg/RegPlugin.h>
#include <ImFusion/Seg/SegPlugin.h>
#include <ImFusion/Stream/StreamPlugin.h>

#include <ImFusion/Base/ImFusionPlugin.h>
#include <ImFusion/GUI/ApplicationController.h>

// Note: I am writing this in constructor

if(ImFusion::LicenceManagerSDK::isActivated)
{
std::cout<<“Licence activated prior”<<std::endl;
ImFusion::Framework::deinit();
}
else
{
std::cout<<“Licence not Activated”<<std::endl;
}

std::string activationKey = “xxxxx-xxxxx-xxxxx-xxxxx-xxxxx”;
ImFusion::Framework::InitConfig initconfig;

if(!ImFusion::LicenceManagerSDK::isActivated())
{
try
{
ImFusion::LicenseManagerSDK::setKeyAndCode(activationKey);
}
catch (const std::exception& error)
{
std::cout<<“Error”<<&error<<std::endl;
}

}
else
{
std::cout<<“ImFusion Licence Allredy activated”<<endl;
}

ImFusion::Framework::loadedPlugins();
initconfig.loadedPlugins = true;
ImFusion::Framework::init(std::move(initconfig));

Hi Ravi,

The Qt library is only forward-compatible regarding ABI stability. This means that at runtime you can use a newer Qt version that it was compiled against but never an older version.

Since our SDK was built against Qt 5.15 you must also use that version or a newer one at runtime. It might be fine to compile your application against 5.12 (that you’re using yourself) but then use the 5.15 DLLs from our installer when launching the application.

You can find several examples how to initialize the SDK on our public GitHub here: GitHub - ImFusionGmbH/public-demos: Example projects showcasing usage and integration of the ImFusion SDK

Finally, I see that your company has a development contract with us. If you still need a version of our SDK compiled against an older Qt version, please reach out to your ImFusion contact for your project via e-mail and they should be able to help you out.

Cheers,
Christian

A post was split to a new topic: How to set projection matrices in XRay2D3DRegistrationAlgorithm