cr1315
cr1315

Reputation: 21

Why can't I just add two ROIs in the image?

I need to add two ROIs in one image using the "Rectangle ROI" button in the toolbar.
But I find that when I try to add the second ROI, the first one loses.

What's the problem?
Can I simply use the button to add two ROIs in one image? How?
Or, must I use the script to add two ROIs and then resize them with mouse?

P.S.
After I added two ROIs, I counted how many ROIs the image has by script:

image myImage := GetFrontImage()  
ImageDisplay imageDisp = myImage.ImageGetImageDisplay( 0 )  
number count = imageDisp.ImageDisplayCountROIS()  

It shows the image really has only 1 ROI, I'm really curious about this.

Upvotes: 0

Views: 102

Answers (1)

BmyGuest
BmyGuest

Reputation: 2949

ROIs added by the tool are volatile, i.e. they are automatically replaced when a new ROI is added. If you want to add non-volatile ROIs you can do that via a script. (Or you can change the volatile-state of a ROI by script.)

image myImage := RealImage( "Test", 4, 200, 200 )
myImage.ShowImage()
ImageDisplay imageDisp = myImage.ImageGetImageDisplay( 0 )  

ROI mR1 = NewROI()
mR1.ROISetVolatile(0)
mR1.ROISetRectangle(10,10,40,40)
imageDisp.ImageDisplayAddROI(mR1)

ROI mR2 = NewROI()
mR2.ROISetVolatile(0)
mR2.ROISetRectangle(50,10,90,40)
imageDisp.ImageDisplayAddROI(mR2)

number count = imageDisp.ImageDisplayCountROIS()  

Upvotes: 0

Related Questions