Login  Register

Plugin for Image Fullscreening

Posted by Suarez, Ivan * on Feb 08, 2011; 3:44pm
URL: http://imagej.273.s1.nabble.com/Plugin-for-Image-Fullscreening-tp3685711.html

Dear All:

        My name is Ivan Suarez. I am an employee of the U.S. Food and Drug Administration (FDA), and my colleagues and I want to display DICOM Images in ImageJ in fullscreen mode in a pair of high resolution monitors. Essentially what we want is to not only to display them on the monitors but also be able to change image parameters (i.e. window/level), and do measurements using the ImageJ tools while the images are displayed in the high resolution monitors. The  following are some specifications of the monitors we are using:
-2 Monitors Barco Coronis 5MP Mammography LCD displays (2560 x 2048) graysacle 21" high bright flat panel display.

        I found a MATLAB function for fullscreening written in Java, that I was hoping could be converted into an ImageJ plugin with the specifications I mentioned above:

function fullscreen(image,device_number)
%FULLSCREEN Display fullscreen true colour images
%   FULLSCREEN(C,N) displays matlab image matrix C on
%   display number N (which ranges from 1 to number of screens). Image
%   matrix C must be the exact resolution of the output screen since no
%   scaling in implemented. If fullscreen is activated on the same display
%   as the MATLAB window, use ALT-TAB to switch back.
%
%   If FULLSCREEN(C,N) is called the second time, the screen will update
%   with the new image.
%
%   Use CLOSESCREEN() to exit fullscreen.
%
%   Requires Matlab 7.x (uses Java Virtual Machine), and has been tested on
%   Linux and Windows platforms.
%
%   Written by Pithawat Vachiramon 18/5/2006


ge = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
gds = ge.getScreenDevices();
height = gds(device_number).getDisplayMode().getHeight();
width = gds(device_number).getDisplayMode().getWidth();

global frame_java;
global icon_java;
global device_number_java;

if ~isequal(device_number_java, device_number)
    try frame_java.dispose(); end
    frame_java = [];
    device_number_java = device_number;
end

if ~isequal(class(frame_java), 'javax.swing.JFrame')
    frame_java = javax.swing.JFrame(gds(device_number).getDefaultConfiguration());
    frame_java.setUndecorated(true);
    icon_java = javax.swing.ImageIcon(im2java(image));
    label = javax.swing.JLabel(icon_java);
    frame_java.getContentPane.add(label);
    gds(device_number).setFullScreenWindow(frame_java);
else
    icon_java.setImage(im2java(image));
end
frame_java.pack
frame_java.repaint
frame_java.show

We also don't wanna have limittations on the size of the image and whether it's 8bit or 16bit. Does anyone have a plugin that does something similar. Or could someone help me turn this code into a plugin?

Thank you,

Ivan Suarez
Graduate Research Assistant
U.S. Food and Drug Administration