From c64d32d2b43a3a19a4304a0b1ca3c064a512fce5 Mon Sep 17 00:00:00 2001 From: Lee Newberg Date: Mon, 13 Jan 2025 09:42:46 -0500 Subject: [PATCH] ENH: WIP: Issue #7179 Curved Planar Reformation From qSlicerApplicationHelper, register qSlicerCLIScalarVectorDWIVolumeResampler. Co-authored-by: Jean-Christophe Fillion-Robin --- Base/QTApp/qSlicerApplicationHelper.cxx | 15 +++++++++++++++ Base/QTApp/qSlicerApplicationHelper.h | 2 ++ Base/QTApp/qSlicerApplicationHelper.txx | 2 ++ .../qSlicerCLIScalarVectorDWIVolumeResampler.cxx | 3 +++ .../qSlicerCLIScalarVectorDWIVolumeResampler.h | 1 + 5 files changed, 23 insertions(+) diff --git a/Base/QTApp/qSlicerApplicationHelper.cxx b/Base/QTApp/qSlicerApplicationHelper.cxx index fc3b87e7a62..18633b0af21 100644 --- a/Base/QTApp/qSlicerApplicationHelper.cxx +++ b/Base/QTApp/qSlicerApplicationHelper.cxx @@ -40,12 +40,17 @@ #include "qSlicerLoadableModuleFactory.h" #include "qSlicerModuleFactoryManager.h" #include "qSlicerModuleManager.h" +#include "vtkSlicerApplicationLogic.h" #include "vtkSlicerVersionConfigure.h" // For Slicer_MAIN_PROJECT_VERSION_FULL #ifdef Slicer_USE_PYTHONQT # include "qSlicerScriptedLoadableModuleFactory.h" #endif +#ifdef Slicer_BUILD_CLI_SUPPORT +# include "qSlicerCLIScalarVectorDWIVolumeResampler.h" +#endif + #include // CTK includes @@ -219,6 +224,16 @@ void qSlicerApplicationHelper::setupModuleFactoryManager(qSlicerModuleFactoryMan moduleFactoryManager->setVerboseModuleDiscovery(app->commandOptions()->verboseModuleDiscovery()); } +//---------------------------------------------------------------------------- +void qSlicerApplicationHelper::registerVolumeResamplers(qSlicerApplication& app) +{ +#ifdef Slicer_BUILD_CLI_SUPPORT + app.applicationLogic()->RegisterVolumeResampler("ScalarVectorDWIVolumeResample", vtkNew().GetPointer()); +#else + Q_UNUSED(app); +#endif +} + //---------------------------------------------------------------------------- void qSlicerApplicationHelper::showMRMLEventLoggerWidget() { diff --git a/Base/QTApp/qSlicerApplicationHelper.h b/Base/QTApp/qSlicerApplicationHelper.h index 249eb777d8e..1a6db56b0ce 100644 --- a/Base/QTApp/qSlicerApplicationHelper.h +++ b/Base/QTApp/qSlicerApplicationHelper.h @@ -57,6 +57,8 @@ class Q_SLICER_BASE_QTAPP_EXPORT qSlicerApplicationHelper : public QObject static void setupModuleFactoryManager(qSlicerModuleFactoryManager * moduleFactoryManager); + static void registerVolumeResamplers(qSlicerApplication& app); + static void showMRMLEventLoggerWidget(); /// Display a warning popup if rendering capabilities do not meet requirements. diff --git a/Base/QTApp/qSlicerApplicationHelper.txx b/Base/QTApp/qSlicerApplicationHelper.txx index a0be7626a7f..ebb3018752a 100644 --- a/Base/QTApp/qSlicerApplicationHelper.txx +++ b/Base/QTApp/qSlicerApplicationHelper.txx @@ -307,6 +307,8 @@ int qSlicerApplicationHelper::postInitializeApplication( qDebug() << "Number of loaded modules:" << moduleManager->modulesNames().count(); } + qSlicerApplicationHelper::registerVolumeResamplers(app); + splashMessage(splashScreen, QString()); if (window) diff --git a/Base/QTCLI/qSlicerCLIScalarVectorDWIVolumeResampler.cxx b/Base/QTCLI/qSlicerCLIScalarVectorDWIVolumeResampler.cxx index 6631d92dd6f..e4ba01a0621 100644 --- a/Base/QTCLI/qSlicerCLIScalarVectorDWIVolumeResampler.cxx +++ b/Base/QTCLI/qSlicerCLIScalarVectorDWIVolumeResampler.cxx @@ -44,6 +44,9 @@ #include #include +//---------------------------------------------------------------------------- +vtkStandardNewMacro(qSlicerCLIScalarVectorDWIVolumeResampler); + //---------------------------------------------------------------------------- void qSlicerCLIScalarVectorDWIVolumeResampler::PrintSelf(ostream& os, vtkIndent indent) { diff --git a/Base/QTCLI/qSlicerCLIScalarVectorDWIVolumeResampler.h b/Base/QTCLI/qSlicerCLIScalarVectorDWIVolumeResampler.h index 7c81fedbf55..49b7fde13b8 100644 --- a/Base/QTCLI/qSlicerCLIScalarVectorDWIVolumeResampler.h +++ b/Base/QTCLI/qSlicerCLIScalarVectorDWIVolumeResampler.h @@ -25,6 +25,7 @@ class Q_SLICER_BASE_QTCLI_EXPORT qSlicerCLIScalarVectorDWIVolumeResampler : public vtkMRMLAbstractVolumeResampler { public: + static qSlicerCLIScalarVectorDWIVolumeResampler *New(); vtkTypeMacro(qSlicerCLIScalarVectorDWIVolumeResampler, vtkMRMLAbstractVolumeResampler); void PrintSelf(ostream& os, vtkIndent indent) override;