SlicerCAT breaks down when `vtkMRMLMarkupsFiducialNode::EndModify()` is called

Hi,

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 fiducialNode->EndModify(wasModified);

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

The output:

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.

To ensure your question can be answer, could you indicate which version of Slicer is associated with custom application ?

1 Like

Yes, the one under c72d890515ccca70e4173dfcedd370e197c44ae9 git tag

I just found the bug in my custom code.
So this is not a Slicer issue.