Thank you, that works but now I'm trying to figure out how to make the UI update on the drawing of a ROI.
Seems that the sequenceChanged event is called on every iteration of the drawing process (dragging out the ROI to its size), and then addEzComponent gives errors for multiple ROIs of the same name existing.
I could path a way around this error using lists of existing ROIs and so on, but is there perhaps a SequenceEvent type that triggers only on a complete ROI having been formed?
Additionally, this.getUI().updateUI(); doesn't do anything in this context, how should I use this?
My goal is to have the UI automatically update with the ROIs to allow selection and pairing of ROIs for intensity comparisons.
@Override
public void sequenceChanged(SequenceEvent event)
{
// Change type event ?
if (event.getType() == SequenceEventType.CHANGED)
{
// ROI change ?
if (event.getSourceType() == SequenceEventSourceType.SEQUENCE_ROI)
{
ROI2D roi = (ROI2D) event.getSource();
// test roi properties here
System.out.println("Roi made in " + roi.getFirstSequence());
//Generate Roi integer components
EzVarBoolean RoiBool = new EzVarBoolean("Numerator", false);
EzVarIntRoi RoiNum = new EzVarIntRoi(roi.getName(), 0, 0, 99, 1,roi, RoiBool);
EzGroup groupSequence = new EzGroup(RoiNum.name,RoiNum, RoiNum.EVIBool);
//Add to UI
addEzComponent(groupSequence);
//Update UI
System.out.println("Updating UI for: " + this.getName());
this.getUI().updateUI();
RoiNums.add(RoiNum);
}
}
}