0

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.

BmyGuest
  • 6,331
  • 1
  • 21
  • 35
R_eF
  • 21
  • 5
  • This is not a coding question, but a DM functional question. Anyway: "dashed" ROIs are "volatile" that is, they are removed when another ROI is added [I]unless[/I] you use the tool while keeping the SHIFT key pressed. – BmyGuest May 14 '15 at 15:37

1 Answers1

0

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()  
BmyGuest
  • 6,331
  • 1
  • 21
  • 35