Skip to content

Commit

Permalink
ENH: WIP: Issue Slicer#7179 Curved Planar Reformation
Browse files Browse the repository at this point in the history
From qSlicerApplicationHelper,
register qSlicerCLIScalarVectorDWIVolumeResampler.

Co-authored-by: Jean-Christophe Fillion-Robin <[email protected]>
  • Loading branch information
Leengit and jcfr committed Jan 13, 2025
1 parent 27789a3 commit c64d32d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Base/QTApp/qSlicerApplicationHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <vtkSystemInformation.h>

// CTK includes
Expand Down Expand Up @@ -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<qSlicerCLIScalarVectorDWIVolumeResampler>().GetPointer());
#else
Q_UNUSED(app);
#endif
}

//----------------------------------------------------------------------------
void qSlicerApplicationHelper::showMRMLEventLoggerWidget()
{
Expand Down
2 changes: 2 additions & 0 deletions Base/QTApp/qSlicerApplicationHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions Base/QTApp/qSlicerApplicationHelper.txx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ int qSlicerApplicationHelper::postInitializeApplication(
qDebug() << "Number of loaded modules:" << moduleManager->modulesNames().count();
}

qSlicerApplicationHelper::registerVolumeResamplers(app);

splashMessage(splashScreen, QString());

if (window)
Expand Down
3 changes: 3 additions & 0 deletions Base/QTCLI/qSlicerCLIScalarVectorDWIVolumeResampler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
#include <itkConstantBoundaryCondition.h>
#include <itkTransformFactory.h>

//----------------------------------------------------------------------------
vtkStandardNewMacro(qSlicerCLIScalarVectorDWIVolumeResampler);

//----------------------------------------------------------------------------
void qSlicerCLIScalarVectorDWIVolumeResampler::PrintSelf(ostream& os, vtkIndent indent)
{
Expand Down
1 change: 1 addition & 0 deletions Base/QTCLI/qSlicerCLIScalarVectorDWIVolumeResampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c64d32d

Please sign in to comment.