-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a parameter set selector and append the result in a table.
StenosisMeasurement3D - create an MRML parameter node class - do not create a default parameter node in the selector - enforce selection of a parameter set - use the parameter node in logic - append the results in an MRML table - improve existing code.
- Loading branch information
Showing
12 changed files
with
1,055 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
317 changes: 278 additions & 39 deletions
317
StenosisMeasurement3D/Logic/vtkSlicerStenosisMeasurement3DLogic.cxx
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
project(vtkSlicer${MODULE_NAME}ModuleMRML) | ||
|
||
set(KIT ${PROJECT_NAME}) | ||
|
||
set(${KIT}_EXPORT_DIRECTIVE "VTK_SLICER_${MODULE_NAME_UPPER}_MODULE_MRML_EXPORT") | ||
|
||
set(${KIT}_INCLUDE_DIRECTORIES | ||
${ExtraMarkups_ModuleMRML_INCLUDE_DIRS} | ||
) | ||
|
||
set(${KIT}_SRCS | ||
vtkMRML${MODULE_NAME}ParameterNode.cxx | ||
vtkMRML${MODULE_NAME}ParameterNode.h | ||
) | ||
|
||
set(${KIT}_TARGET_LIBRARIES | ||
${MRML_LIBRARIES} | ||
) | ||
|
||
#----------------------------------------------------------------------------- | ||
SlicerMacroBuildModuleMRML( | ||
NAME ${KIT} | ||
EXPORT_DIRECTIVE ${${KIT}_EXPORT_DIRECTIVE} | ||
INCLUDE_DIRECTORIES ${${KIT}_INCLUDE_DIRECTORIES} | ||
SRCS ${${KIT}_SRCS} | ||
TARGET_LIBRARIES ${${KIT}_TARGET_LIBRARIES} | ||
) |
203 changes: 203 additions & 0 deletions
203
StenosisMeasurement3D/MRML/vtkMRMLStenosisMeasurement3DParameterNode.cxx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
#include "vtkMRMLStenosisMeasurement3DParameterNode.h" | ||
|
||
// VTK includes | ||
#include <vtkNew.h> | ||
#include <vtkObjectFactory.h> | ||
|
||
// MRML includes | ||
#include <vtkMRMLMarkupsShapeNode.h> | ||
#include <vtkMRMLMarkupsFiducialNode.h> | ||
#include <vtkMRMLSegmentationNode.h> | ||
#include <vtkMRMLModelNode.h> | ||
#include <vtkMRMLTableNode.h> | ||
|
||
static const char* InputShapeNodeReferenceRole = "inputShape"; | ||
static const char* InputFiducialNodeReferenceRole = "inputFiducial"; | ||
static const char* InputSegmentationNodeReferenceRole = "inputSegmentation"; | ||
static const char* OutputWallModelNodeReferenceRole = "outputWallModel"; | ||
static const char* OutputLumenModelNodeReferenceRole = "outputLumenModel"; | ||
static const char* OutputTableNodeReferenceRole = "outputTable"; | ||
|
||
//---------------------------------------------------------------------------- | ||
vtkMRMLNodeNewMacro(vtkMRMLStenosisMeasurement3DParameterNode); | ||
|
||
//---------------------------------------------------------------------------- | ||
vtkMRMLStenosisMeasurement3DParameterNode::vtkMRMLStenosisMeasurement3DParameterNode() | ||
{ | ||
this->HideFromEditors = 1; | ||
this->AddToSceneOn(); | ||
|
||
this->AddNodeReferenceRole(InputShapeNodeReferenceRole); | ||
this->AddNodeReferenceRole(InputFiducialNodeReferenceRole); | ||
this->AddNodeReferenceRole(InputSegmentationNodeReferenceRole); | ||
this->AddNodeReferenceRole(OutputWallModelNodeReferenceRole); | ||
this->AddNodeReferenceRole(OutputLumenModelNodeReferenceRole); | ||
this->AddNodeReferenceRole(OutputTableNodeReferenceRole); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
vtkMRMLStenosisMeasurement3DParameterNode::~vtkMRMLStenosisMeasurement3DParameterNode() = default; | ||
|
||
//---------------------------------------------------------------------------- | ||
void vtkMRMLStenosisMeasurement3DParameterNode::SetScene(vtkMRMLScene* scene) | ||
{ | ||
Superclass::SetScene(scene); | ||
if (scene && !this->GetName()) | ||
{ | ||
const std::string name = scene->GenerateUniqueName(this->GetNodeTagName()); | ||
this->SetName(name.c_str()); | ||
} | ||
} | ||
|
||
|
||
//---------------------------------------------------------------------------- | ||
void vtkMRMLStenosisMeasurement3DParameterNode::PrintSelf(ostream& os, vtkIndent indent) | ||
{ | ||
Superclass::PrintSelf(os,indent); | ||
vtkMRMLPrintBeginMacro(os, indent); | ||
vtkMRMLPrintStdStringMacro(InputSegmentID); | ||
vtkMRMLPrintEndMacro(); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
void vtkMRMLStenosisMeasurement3DParameterNode::ReadXMLAttributes(const char** atts) | ||
{ | ||
// Read all MRML node attributes from two arrays of names and values | ||
int disabledModify = this->StartModify(); | ||
|
||
Superclass::ReadXMLAttributes(atts); | ||
|
||
vtkMRMLReadXMLBeginMacro(atts); | ||
vtkMRMLReadXMLStringMacro(segmentID, InputSegmentID); | ||
vtkMRMLReadXMLEndMacro(); | ||
|
||
this->EndModify(disabledModify); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
void vtkMRMLStenosisMeasurement3DParameterNode::WriteXML(ostream& of, int nIndent) | ||
{ | ||
Superclass::WriteXML(of, nIndent); | ||
vtkMRMLWriteXMLBeginMacro(of); | ||
vtkMRMLWriteXMLStringMacro(segmentID, InputSegmentID); | ||
vtkMRMLWriteXMLEndMacro(); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
void vtkMRMLStenosisMeasurement3DParameterNode::CopyContent(vtkMRMLNode* anode, bool deepCopy/*=true*/) | ||
{ | ||
MRMLNodeModifyBlocker blocker(this); | ||
Superclass::CopyContent(anode, deepCopy); | ||
|
||
vtkMRMLCopyBeginMacro(anode); | ||
vtkMRMLCopyStringMacro(InputSegmentID); | ||
vtkMRMLCopyEndMacro(); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
void vtkMRMLStenosisMeasurement3DParameterNode::SetInputShapeNodeID(const char *nodeID) | ||
{ | ||
this->SetNodeReferenceID(InputShapeNodeReferenceRole, nodeID); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
const char * vtkMRMLStenosisMeasurement3DParameterNode::GetInputShapeNodeID() | ||
{ | ||
return this->GetNodeReferenceID(InputShapeNodeReferenceRole); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
vtkMRMLMarkupsShapeNode* vtkMRMLStenosisMeasurement3DParameterNode::GetInputShapeNode() | ||
{ | ||
return vtkMRMLMarkupsShapeNode::SafeDownCast(this->GetNodeReference(InputShapeNodeReferenceRole)); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
void vtkMRMLStenosisMeasurement3DParameterNode::SetInputFiducialNodeID(const char *nodeID) | ||
{ | ||
this->SetNodeReferenceID(InputFiducialNodeReferenceRole, nodeID); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
const char * vtkMRMLStenosisMeasurement3DParameterNode::GetInputFiducialNodeID() | ||
{ | ||
return this->GetNodeReferenceID(InputFiducialNodeReferenceRole); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
vtkMRMLMarkupsFiducialNode* vtkMRMLStenosisMeasurement3DParameterNode::GetInputFiducialNode() | ||
{ | ||
return vtkMRMLMarkupsFiducialNode::SafeDownCast(this->GetNodeReference(InputFiducialNodeReferenceRole)); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
void vtkMRMLStenosisMeasurement3DParameterNode::SetInputSegmentationNodeID(const char *nodeID) | ||
{ | ||
this->SetNodeReferenceID(InputSegmentationNodeReferenceRole, nodeID); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
const char * vtkMRMLStenosisMeasurement3DParameterNode::GetInputSegmentationNodeID() | ||
{ | ||
return this->GetNodeReferenceID(InputSegmentationNodeReferenceRole); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
vtkMRMLSegmentationNode* vtkMRMLStenosisMeasurement3DParameterNode::GetInputSegmentationNode() | ||
{ | ||
return vtkMRMLSegmentationNode::SafeDownCast(this->GetNodeReference(InputSegmentationNodeReferenceRole)); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
void vtkMRMLStenosisMeasurement3DParameterNode::SetOutputWallModelNodeID(const char *nodeID) | ||
{ | ||
this->SetNodeReferenceID(OutputWallModelNodeReferenceRole, nodeID); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
const char * vtkMRMLStenosisMeasurement3DParameterNode::GetOutputWallModelNodeID() | ||
{ | ||
return this->GetNodeReferenceID(OutputWallModelNodeReferenceRole); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
vtkMRMLModelNode* vtkMRMLStenosisMeasurement3DParameterNode::GetOutputWallModelNode() | ||
{ | ||
return vtkMRMLModelNode::SafeDownCast(this->GetNodeReference(OutputWallModelNodeReferenceRole)); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
void vtkMRMLStenosisMeasurement3DParameterNode::SetOutputLumenModelNodeID(const char *nodeID) | ||
{ | ||
this->SetNodeReferenceID(OutputLumenModelNodeReferenceRole, nodeID); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
const char * vtkMRMLStenosisMeasurement3DParameterNode::GetOutputLumenModelNodeID() | ||
{ | ||
return this->GetNodeReferenceID(OutputLumenModelNodeReferenceRole); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
vtkMRMLModelNode* vtkMRMLStenosisMeasurement3DParameterNode::GetOutputLumenModelNode() | ||
{ | ||
return vtkMRMLModelNode::SafeDownCast(this->GetNodeReference(OutputLumenModelNodeReferenceRole)); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
void vtkMRMLStenosisMeasurement3DParameterNode::SetOutputTableNodeID(const char *nodeID) | ||
{ | ||
this->SetNodeReferenceID(OutputTableNodeReferenceRole, nodeID); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
const char * vtkMRMLStenosisMeasurement3DParameterNode::GetOutputTableNodeID() | ||
{ | ||
return this->GetNodeReferenceID(OutputTableNodeReferenceRole); | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
vtkMRMLTableNode* vtkMRMLStenosisMeasurement3DParameterNode::GetOutputTableNode() | ||
{ | ||
return vtkMRMLTableNode::SafeDownCast(this->GetNodeReference(OutputTableNodeReferenceRole)); | ||
} |
88 changes: 88 additions & 0 deletions
88
StenosisMeasurement3D/MRML/vtkMRMLStenosisMeasurement3DParameterNode.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#ifndef __vtkmrmlstenosismeasurement3dparameternode_h_ | ||
#define __vtkmrmlstenosismeasurement3dparameternode_h_ | ||
|
||
#include "vtkMRML.h" | ||
#include "vtkMRMLScene.h" | ||
#include "vtkMRMLNode.h" | ||
#include "vtkSlicerStenosisMeasurement3DModuleMRMLExport.h" | ||
#include <vtkPolyData.h> | ||
|
||
class vtkMRMLMarkupsShapeNode; | ||
class vtkMRMLMarkupsFiducialNode; | ||
class vtkMRMLSegmentationNode; | ||
class vtkMRMLModelNode; | ||
class vtkMRMLTableNode; | ||
|
||
class VTK_SLICER_STENOSISMEASUREMENT3D_MODULE_MRML_EXPORT vtkMRMLStenosisMeasurement3DParameterNode :public vtkMRMLNode | ||
{ | ||
public: | ||
static vtkMRMLStenosisMeasurement3DParameterNode *New(); | ||
vtkTypeMacro(vtkMRMLStenosisMeasurement3DParameterNode, vtkMRMLNode); | ||
void PrintSelf(ostream& os, vtkIndent indent) override; | ||
|
||
vtkMRMLNode* CreateNodeInstance() override; | ||
void SetScene(vtkMRMLScene * scene) override; | ||
|
||
/// Set node attributes from XML attributes | ||
void ReadXMLAttributes( const char** atts) override; | ||
|
||
/// Write this node's information to a MRML file in XML format. | ||
void WriteXML(ostream& of, int indent) override; | ||
|
||
vtkMRMLCopyContentMacro(vtkMRMLStenosisMeasurement3DParameterNode); | ||
const char* GetNodeTagName() override {return "StenosisMeasurement3DParameterSet";} | ||
|
||
void SetInputShapeNodeID(const char *nodeID); | ||
const char *GetInputShapeNodeID(); | ||
vtkMRMLMarkupsShapeNode* GetInputShapeNode(); | ||
|
||
void SetInputFiducialNodeID(const char *nodeID); | ||
const char *GetInputFiducialNodeID(); | ||
vtkMRMLMarkupsFiducialNode* GetInputFiducialNode(); | ||
|
||
void SetInputSegmentationNodeID(const char *nodeID); | ||
const char *GetInputSegmentationNodeID(); | ||
vtkMRMLSegmentationNode* GetInputSegmentationNode(); | ||
|
||
vtkSetStdStringFromCharMacro(InputSegmentID); | ||
vtkGetCharFromStdStringMacro(InputSegmentID); | ||
|
||
void SetOutputWallModelNodeID(const char *nodeID); | ||
const char *GetOutputWallModelNodeID(); | ||
vtkMRMLModelNode* GetOutputWallModelNode(); | ||
|
||
void SetOutputLumenModelNodeID(const char *nodeID); | ||
const char *GetOutputLumenModelNodeID(); | ||
vtkMRMLModelNode* GetOutputLumenModelNode(); | ||
|
||
void SetOutputTableNodeID(const char *nodeID); | ||
const char *GetOutputTableNodeID(); | ||
vtkMRMLTableNode* GetOutputTableNode(); | ||
|
||
vtkSetObjectMacro(OutputWallOpenPolyData, vtkPolyData); | ||
vtkGetObjectMacro(OutputWallOpenPolyData, vtkPolyData) | ||
|
||
vtkSetObjectMacro(OutputLumenOpenPolyData, vtkPolyData); | ||
vtkGetObjectMacro(OutputLumenOpenPolyData, vtkPolyData); | ||
|
||
vtkSetObjectMacro(OutputWallClosedPolyData, vtkPolyData); | ||
vtkGetObjectMacro(OutputWallClosedPolyData, vtkPolyData); | ||
|
||
vtkSetObjectMacro(OutputLumenClosedPolyData, vtkPolyData); | ||
vtkGetObjectMacro(OutputLumenClosedPolyData, vtkPolyData); | ||
|
||
protected: | ||
vtkMRMLStenosisMeasurement3DParameterNode(); | ||
~vtkMRMLStenosisMeasurement3DParameterNode() override; | ||
|
||
vtkMRMLStenosisMeasurement3DParameterNode(const vtkMRMLStenosisMeasurement3DParameterNode&); | ||
void operator=(const vtkMRMLStenosisMeasurement3DParameterNode&); | ||
|
||
std::string InputSegmentID; | ||
vtkSmartPointer<vtkPolyData> OutputWallOpenPolyData; | ||
vtkSmartPointer<vtkPolyData> OutputLumenOpenPolyData; | ||
vtkSmartPointer<vtkPolyData> OutputWallClosedPolyData; | ||
vtkSmartPointer<vtkPolyData> OutputLumenClosedPolyData; | ||
}; | ||
|
||
#endif // __vtkmrmlstenosismeasurement3dparameternode_h_ |
Oops, something went wrong.