2013-09-26 31 views
0

我正在循環顯示圖像對,並在斐濟的TurboReg插件中註冊它們。我在Python中有一些背景,所以我使用Jython。斐濟和Jython:關閉或禁止插件對話框

問題是當TurboReg完成一個對話框出現,詢問您是否要保存結果 - 我不 - 我想繼續循環。如何關閉或禁止對話框而無需手動執行?

我試圖用簡潔的重建問題,但我是新來的Jython和斐濟所以下面是我的腳本片段減去

from ij import IJ 
w = WindowManager 

# dictionary of variables 
d = {"t":target.path_to_image, "tCropRight":target.width-1, "tCropBottom":target.height-1, "s":source.path_to_image, "sCropRight":source.width-1, "sCropBottom":source.height-1} 

# run TurboReg dialog 
IJ.run("TurboReg ", "-align \ 
       -file %(s)s 0 0 %(sCropRight)s %(sCropBottom)s \ 
       -file %(t)s 0 0 %(tCropRight)s %(tCropBottom)s \ 
       -bilinear \ 
       1131 847 \ 
       1595 1198 \ 
       1131 4636 \ 
       1595 6561 \ 
       6188 847 \ 
       8732 1198 \ 
       6188 4636 \ 
       8732 6561 \ 
       -hideOutput" % d) 

w.setCurrentWindow(w.getWindow("Output")) # select output window 
IJ.run("Stack to Images") # stack to images 
w.setCurrentWindow(w.getWindow("Data")) # select data window 
IJ.run("16-bit") # convert to 16 bit 
IJ.saveAs("Tiff", temp_nir) # save image 
### CLOSE DIALOG BOXES! ### 

回答

1

我想通了一些功能調用圖像等我自己問題!該對話框稱爲「結果」,因此:

from ij import IJ 
w = WindowManager 

win = w.getWindow("Results") 
win.removeNotify() 

這會關閉對話框而不詢問是否需要保存。