Via GUI interface I add control points to
vtkMRMLMarkupsFiducialNode one by one.
I’m able to add the first control point but when I’m trying to add second control point SlicerCAT falls down on the line
The code that I use is below and the output to console that I get will be a little bit lower:
// fiducialNode has type `vtkMRMLMarkupsFiducialNode` int wasModified = fiducialNode->StartModify(); std::cout << "START MODIFY: " << wasModified << std::endl; int id = fiducialNode->AddFiducial(1,2,3,"my name"); std::cout << "fiducial id: " << id << std::endl; fiducialNode->SetNthControlPointDescription( id, "my description"); std::cout << "description is set" << std::endl; fiducialNode->EndModify(wasModified); std::cout << "END MODIFY" << std::endl; // when I add the second point to the `fiducialNode` this line is not shown and SlicerCAT breaks down
START MODIFY: 0 fiducial id: 0 description is set END MODIFY START MODIFY: 0 fiducial id: 1 description is set
I noticed that the the app falls because of line code
int wasModified = Superclass::EndModify(previousDisableModifiedEventState); within
vtkMRMLMarkupsNode::EndModify(int previousDisableModifiedEventState) function.
I don’t know yet how
StartModify()/EndModify() works so I’m not sure whether the error is caused by my own code or native Slicer core. But if somebody have some ideas I would appreciate.