Skip to content

Commit 1913d09

Browse files
ferdymercurycpinter
authored andcommitted
ENH: Add detached vtkIECTransformLogic library to SlicerRT superbuild
This commit was authored by TrosnyogoSzakoca. I just rebased it to current tip of master branch. -Change existing code to use new library instead of vtkSlicerIECTransformLogic -Delete old vtkSlicerIECTransformLogic -Add new external cmake to superbuild folder -Update CMakeLists -Main problem: dll not found errors during SlicerRT startup FIX: remove debug comment FIX: try to mimick exactly the Plastimatch cmake structure FIX: require package in every submodule, as done with plastimatch FIX: make package was missing the external library vtkIEC Commit by cpinter. Inspired from IGSIO library.
1 parent 169518a commit 1913d09

17 files changed

+295
-785
lines changed

Beams/Logic/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
project(vtkSlicer${MODULE_NAME}ModuleLogic)
22

3+
find_package(vtkIECTransformLogic REQUIRED)
4+
35
set(KIT ${PROJECT_NAME})
46

57
set(${KIT}_EXPORT_DIRECTIVE "VTK_SLICER_${MODULE_NAME_UPPER}_LOGIC_EXPORT")
@@ -8,18 +10,17 @@ set(${KIT}_INCLUDE_DIRECTORIES
810
${SlicerRtCommon_INCLUDE_DIRS}
911
${vtkSlicerBeamsModuleMRML_INCLUDE_DIRS}
1012
${vtkSlicerSubjectHierarchyModuleLogic_INCLUDE_DIRS}
13+
${vtkIECTransformLogic_INCLUDE_DIRS}
1114
)
1215

1316
set(${KIT}_SRCS
1417
vtkSlicer${MODULE_NAME}ModuleLogic.cxx
1518
vtkSlicer${MODULE_NAME}ModuleLogic.h
16-
vtkSlicerIECTransformLogic.cxx
17-
vtkSlicerIECTransformLogic.h
1819
vtkSlicerMLCPositionLogic.cxx
1920
vtkSlicerMLCPositionLogic.h
2021
)
2122

22-
SET (${KIT}_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${vtkSlicerBeamsModuleMRML_INCLUDE_DIRS} CACHE INTERNAL "" FORCE)
23+
SET (${KIT}_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${vtkSlicerBeamsModuleMRML_INCLUDE_DIRS} ${vtkIECTransformLogic_INCLUDE_DIRS} CACHE INTERNAL "" FORCE)
2324

2425
set(${KIT}_TARGET_LIBRARIES
2526
vtkSlicer${MODULE_NAME}ModuleMRML
@@ -28,6 +29,7 @@ set(${KIT}_TARGET_LIBRARIES
2829
vtkSlicerSubjectHierarchyModuleLogic
2930
${ITK_LIBRARIES}
3031
${VTK_LIBRARIES}
32+
vtkIECTransformLogic
3133
)
3234

3335
#-----------------------------------------------------------------------------
@@ -38,4 +40,4 @@ SlicerMacroBuildModuleLogic(
3840
SRCS ${${KIT}_SRCS}
3941
TARGET_LIBRARIES ${${KIT}_TARGET_LIBRARIES}
4042
)
41-
43+

Beams/Logic/vtkSlicerBeamsModuleLogic.cxx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// Beams includes
2222
#include "vtkSlicerBeamsModuleLogic.h"
23-
#include "vtkSlicerIECTransformLogic.h"
2423
#include "vtkSlicerMLCPositionLogic.h"
2524

2625
// SlicerRT includes
@@ -46,7 +45,7 @@ vtkStandardNewMacro(vtkSlicerBeamsModuleLogic);
4645
//----------------------------------------------------------------------------
4746
vtkSlicerBeamsModuleLogic::vtkSlicerBeamsModuleLogic()
4847
: MLCPositionLogic(vtkSlicerMLCPositionLogic::New())
49-
, IECLogic(vtkSlicerIECTransformLogic::New())
48+
, IECLogic(vtkIECTransformLogic::New())
5049
{
5150
}
5251

@@ -172,7 +171,7 @@ void vtkSlicerBeamsModuleLogic::OnMRMLSceneEndImport()
172171
}
173172

174173
//---------------------------------------------------------------------------
175-
void vtkSlicerBeamsModuleLogic::SetIECLogic(vtkSlicerIECTransformLogic* iecLogic)
174+
void vtkSlicerBeamsModuleLogic::SetIECLogic(vtkIECTransformLogic* iecLogic)
176175
{
177176
if (iecLogic == nullptr)
178177
{
@@ -183,7 +182,7 @@ void vtkSlicerBeamsModuleLogic::SetIECLogic(vtkSlicerIECTransformLogic* iecLogic
183182
this->IECLogic->Delete();
184183
this->IECLogic = nullptr;
185184

186-
vtkSetObjectBodyMacro(IECLogic, vtkSlicerIECTransformLogic, iecLogic);
185+
vtkSetObjectBodyMacro(IECLogic, vtkIECTransformLogic, iecLogic);
187186
}
188187

189188
//----------------------------------------------------------------------------
@@ -361,7 +360,7 @@ void vtkSlicerBeamsModuleLogic::UpdateBeamTransform(vtkMRMLRTBeamNode* beamNode,
361360
this->UpdateIECTransformsFromBeam(beamNode, isocenter);
362361

363362
vtkNew<vtkGeneralTransform> beamGeneralTransform;
364-
this->IECLogic->GetTransformBetween(vtkSlicerIECTransformLogic::Collimator, vtkSlicerIECTransformLogic::RAS, beamGeneralTransform, true);
363+
this->IECLogic->GetTransformBetween(vtkIECTransformLogic::Collimator, vtkIECTransformLogic::RAS, beamGeneralTransform, true);
365364

366365
// Convert general transform to linear
367366
// This call also makes hard copy of the transform so that it doesn't change when other beam transforms change
@@ -408,7 +407,7 @@ void vtkSlicerBeamsModuleLogic::UpdateIECTransformsFromBeam(vtkMRMLRTBeamNode* b
408407

409408
//-----------------------------------------------------------------------------
410409
void vtkSlicerBeamsModuleLogic::UpdateRASRelatedTransforms(
411-
vtkSlicerIECTransformLogic* iecLogic/*=nullptr*/, vtkMRMLRTPlanNode* planNode/*=nullptr*/, double* isocenter/*=nullptr*/, bool transformForBeam/*=false*/)
410+
vtkIECTransformLogic* iecLogic/*=nullptr*/, vtkMRMLRTPlanNode* planNode/*=nullptr*/, double* isocenter/*=nullptr*/, bool transformForBeam/*=false*/)
412411
{
413412
if (!this->GetMRMLScene())
414413
{
@@ -424,7 +423,7 @@ void vtkSlicerBeamsModuleLogic::UpdateRASRelatedTransforms(
424423
// Do the same for the RAS to Patient transform as well.
425424
vtkNew<vtkTransform> fixedReferenceToRASTransformBeamComponent;
426425
vtkTransform* rasToPatientReferenceTransform = iecLogic->GetElementaryTransformBetween(
427-
vtkSlicerIECTransformLogic::RAS, vtkSlicerIECTransformLogic::Patient);
426+
vtkIECTransformLogic::RAS, vtkIECTransformLogic::Patient);
428427
if (rasToPatientReferenceTransform == nullptr)
429428
{
430429
vtkErrorMacro("UpdateRASRelatedTransforms: Failed to find RAS related transforms in the IEC logic");
@@ -479,7 +478,7 @@ void vtkSlicerBeamsModuleLogic::UpdateRASRelatedTransforms(
479478
// Set up concatenation for final fixed reference to RAS transform
480479
vtkNew<vtkGeneralTransform> tableTopToTableTopEccentricRotationGeneralTransform;
481480
iecLogic->GetTransformBetween(
482-
vtkSlicerIECTransformLogic::TableTop, vtkSlicerIECTransformLogic::TableTopEccentricRotation, tableTopToTableTopEccentricRotationGeneralTransform, transformForBeam);
481+
vtkIECTransformLogic::TableTop, vtkIECTransformLogic::TableTopEccentricRotation, tableTopToTableTopEccentricRotationGeneralTransform, transformForBeam);
483482
vtkNew<vtkTransform> tableTopToTableTopEccentricRotationLinearTransform;
484483
if (!vtkMRMLTransformNode::IsGeneralTransformLinear(tableTopToTableTopEccentricRotationGeneralTransform, tableTopToTableTopEccentricRotationLinearTransform))
485484
{
@@ -489,7 +488,7 @@ void vtkSlicerBeamsModuleLogic::UpdateRASRelatedTransforms(
489488

490489
vtkNew<vtkGeneralTransform> patientSupportRotationToFixedReferenceGeneralTransform;
491490
iecLogic->GetTransformBetween(
492-
vtkSlicerIECTransformLogic::PatientSupportRotation, vtkSlicerIECTransformLogic::FixedReference, patientSupportRotationToFixedReferenceGeneralTransform, transformForBeam);
491+
vtkIECTransformLogic::PatientSupportRotation, vtkIECTransformLogic::FixedReference, patientSupportRotationToFixedReferenceGeneralTransform, transformForBeam);
493492
vtkNew<vtkTransform> patientSupportRotationToFixedReferenceLinearTransform;
494493
if (!vtkMRMLTransformNode::IsGeneralTransformLinear(patientSupportRotationToFixedReferenceGeneralTransform, patientSupportRotationToFixedReferenceLinearTransform))
495494
{
@@ -506,6 +505,6 @@ void vtkSlicerBeamsModuleLogic::UpdateRASRelatedTransforms(
506505

507506
// Update fixed reference to RAS transform in IEC logic
508507
vtkTransform* fixedReferenceToRASTransform = iecLogic->GetElementaryTransformBetween(
509-
vtkSlicerIECTransformLogic::FixedReference, vtkSlicerIECTransformLogic::RAS);
508+
vtkIECTransformLogic::FixedReference, vtkIECTransformLogic::RAS);
510509
fixedReferenceToRASTransform->DeepCopy(fixedReferenceToRASTransformNew);
511510
}

Beams/Logic/vtkSlicerBeamsModuleLogic.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@
3030
// Slicer includes
3131
#include "vtkSlicerModuleLogic.h"
3232

33+
// IEC Logic include
34+
#include <vtkIECTransformLogic.h>
35+
3336
// Beams includes
3437
#include "vtkSlicerBeamsModuleLogicExport.h"
3538
#include "vtkMRMLRTBeamNode.h"
36-
#include "vtkSlicerIECTransformLogic.h"
3739

3840
// VTK includes
3941
#include <vtkNew.h>
@@ -77,14 +79,14 @@ class VTK_SLICER_BEAMS_LOGIC_EXPORT vtkSlicerBeamsModuleLogic : public vtkSlicer
7779
/// \param planNode: Plan node to get the isocenter position from
7880
/// \param isocenter: Option to set any isocenter for dynamic beams
7981
/// \param transformForBeam: calculate dynamic transformation for beam model or other models. False by default.
80-
void UpdateRASRelatedTransforms(vtkSlicerIECTransformLogic* iecLogic=nullptr, vtkMRMLRTPlanNode* planNode=nullptr, double* isocenter=nullptr, bool transformForBeam=false);
82+
void UpdateRASRelatedTransforms(vtkIECTransformLogic* iecLogic=nullptr, vtkMRMLRTPlanNode* planNode=nullptr, double* isocenter=nullptr, bool transformForBeam=false);
8183

8284
public:
8385
vtkGetObjectMacro(MLCPositionLogic, vtkSlicerMLCPositionLogic);
84-
vtkGetObjectMacro(IECLogic, vtkSlicerIECTransformLogic);
86+
vtkGetObjectMacro(IECLogic, vtkIECTransformLogic);
8587

8688
/// Possibility to use an external IEC logic. This is useful for testing.
87-
void SetIECLogic(vtkSlicerIECTransformLogic* iecLogic);
89+
void SetIECLogic(vtkIECTransformLogic* iecLogic);
8890

8991
protected:
9092
vtkSlicerBeamsModuleLogic();
@@ -108,7 +110,7 @@ class VTK_SLICER_BEAMS_LOGIC_EXPORT vtkSlicerBeamsModuleLogic : public vtkSlicer
108110
vtkSlicerMLCPositionLogic* MLCPositionLogic;
109111

110112
private:
111-
vtkSlicerIECTransformLogic* IECLogic;
113+
vtkIECTransformLogic* IECLogic;
112114
};
113115

114116
#endif

0 commit comments

Comments
 (0)