Initialise EzPlug GUI through another class

6 views
Skip to first unread message

Masoud Ramuz

unread,
Apr 6, 2018, 7:48:09 AM4/6/18
to Icy imaging
Hello Forum,

My plugin starts with a small window to prompt for files containing data needed to adjust the open image/sequence before use.
After the files have been loaded and the images are readied for use, I'd like to start up the Analyser class which works on EzPlug.

However, the following code does not create the EzPlug GUI

        Analyser SU1 = new Analyser(seqList);
        SU1
.initialize();
       

A system.out.println confirmed that initialize has been called and there are no errors in the console. Yet the GUI does not show.
I thought the Initialize() method created the GUI, is there something I'm missing?

Stephane

unread,
Apr 6, 2018, 9:26:13 AM4/6/18
to Icy imaging
Hello,

Instead of initialize(), try to call createUI() then showUI() :

Analyser SU1 = new Analyser(seqList);

SU1
.createUI();
SU1.showUI();

that should make the trick :)

Best,

- Stephane

Masoud Ramuz

unread,
Apr 9, 2018, 8:54:59 AM4/9/18
to Icy imaging
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);            
           
}
       
}
   
}
Reply all
Reply to author
Forward
0 new messages