J
jfalter
I am using ImageJ to display DICOM files in part of a JPanel using an
ImageCanvas. I want to be able to scroll through the frames of the
file using a scroll bar or a field to jump to the proper frame. I have
been unable to get the ImageCanvas to refresh though. The only way
that I have been able to get it to work is by removing the old
ImageCanvas, and inserting a new one with the new image, which produces
a predictably horrid amount of flickering. I have read through the
implementation of ImageWindow, but have not been able to determine what
they are doing differently. Any help with this would be appreciated.
Here is the relevant parts of the code:
private ij.IJ myImageJ;
private ij.ImagePlus myImagePlus;
private ij.gui.ImageCanvas myImageCanvas;
private JPanel pnlControls;
myImageJ = new ij.IJ();
myImageJ.open("uc.dcm");
myImagePlus = myImageJ.getImage();
myImageCanvas = new ij.gui.ImageCanvas(myImagePlus);
pnlControls = new JPanel();
pnlControls.add(myImageCanvas);
Then which ever listener catches an event calls a method, which gets
the new Frame index. So the problem is then getting that new frame
into the ImageCanvas and displaying it.
Anyone have experience with this?
ImageCanvas. I want to be able to scroll through the frames of the
file using a scroll bar or a field to jump to the proper frame. I have
been unable to get the ImageCanvas to refresh though. The only way
that I have been able to get it to work is by removing the old
ImageCanvas, and inserting a new one with the new image, which produces
a predictably horrid amount of flickering. I have read through the
implementation of ImageWindow, but have not been able to determine what
they are doing differently. Any help with this would be appreciated.
Here is the relevant parts of the code:
private ij.IJ myImageJ;
private ij.ImagePlus myImagePlus;
private ij.gui.ImageCanvas myImageCanvas;
private JPanel pnlControls;
myImageJ = new ij.IJ();
myImageJ.open("uc.dcm");
myImagePlus = myImageJ.getImage();
myImageCanvas = new ij.gui.ImageCanvas(myImagePlus);
pnlControls = new JPanel();
pnlControls.add(myImageCanvas);
Then which ever listener catches an event calls a method, which gets
the new Frame index. So the problem is then getting that new frame
into the ImageCanvas and displaying it.
Anyone have experience with this?