How can I update my image in a loop?

I want to use "paint( )" automaticlly to display my 3D image slice by slice. I can't understand why it only display my final slice. Below is my coeds:
// press butten to display my 3D image slice by slice
if(e.getActionCommand() == "Play")
     for(int i = 0; i < finalSlice; i++)
          if(presentSlice == finalSlice)
               presentSlice = 0;
          presentSlice = presentSlice + 1;
          // read a new slice from a 3D data. Return
          // matrix is a new 2D image data
          pixel = mccd.readSlice(presentSlice, mapModel);
          //Gererate a new slice image
          img = createImage(new MemoryImageSource(width, height, pixel, 0, width));
          //input the image onto my image panel;
          imgPanel.imageUpdate(img);
          } // Here can not work. Only can               // work in the last time of loop.
public class ImagePanel extends JPanel
     public void imageUpdate(Image image)
          this.image = image;
          repaint();
     public void paintComponent(Graphics g)
          super.paintComponent(g); //paint background
          //Draw image at its natural size first.
          g.drawImage(image, 0, 0, this);
Thanks a lot for any help. Could you email me on
[email protected] Thanks again

You can try the following:
Create a new object that extends runnable. Have a variable that keeps track of the current slice. In its paint() method, paint the current slice.
Now, in its run() method start from the first slice and get into a loop that calls Thread.sleep(1000) and then makes the current slice = to the next slice. you can replace 1000 with whatever duration you want.
My recommendation is that this object should extend a container. After that, you just add the component into a window and display it.
Hope this helps,
Calin
PS: I did this and it worked for me. If you need it I will try to give you some code you can start from.

Similar Messages

  • How can I update Canon iMage Gateway Mycamera plugin for Firefox?

    I received a message from Firefox saying NPCIG.dll CANON iMAGE GATEWAY Mycamera Plugin was unknown. 
    How can I update this plugin?  I have Windows 8.
    Any help would be appreciated.

    Canon Support: Canon Software Download. Step 1. Enter the "Canon model number" in the search box and click the "submit". Step 2. Select the OS of the computer: Vista, xp, windows 7, windows 8. Press the next button. Step 3. The software and drivers are compatible with Canon MP250 will show on the screen. Step 4. Select the software you need and click "download". Step 5. Save the file (exe.) and double-click the driver file to install it. Step 6. Reboot the computer after the installation.

  • How can I update Camera raw for Photoshop CS5 to access images from Canon Rebel T4i?

    How can I update Camera Raw for Photoshop CS5 to access images from Canon Rebel T4i? The updated version of Camera Raw 7 says it only works with CS6. Outside of buying a new Photoshop, is there anything I can do?

    Buy Lightroom (much cheaper alternative to Photoshop) - does all your 'Photo-related' tasks. Full version of LightRoom 4 is $149/- - http://www.adobe.com/products/photoshop-lightroom.html
    LightRoom 4 supports ACR (Adobe Camera Raw) 7. Once processed with Lightroom, if you still need, you could take the photo in JPG or TIFF format into Photoshop CS5 for further processing.
    Another option is to use Canon Raw Codec that would've come with your camera's box to process the RAW images and then take them into Photoshop.

  • I've moved my Aperture library to another computer, and masters are referencing an old path name.  How can I update these references?  Reloctating masters does not work in this case :(

    I've moved my Aperture library from one computer to another using Finder.
    I merged the library with one which was already on the computer.
    Now, the photos I imported have reference to the old path name on my old computer.
    How can I update these references as "Relocate Masters" does not work in this case?

    Just one suggestion to be able to reconnect all at once:
    Create a smart album containing the images with missing masters:
    File -> New ->  Smart Album,     and add a rule: File Status is "Missing"     (or File Status is "offline")
    Then select the images in this album and go to the File menu:
    and select:   File -> Locate referenced File
    If you are lucky, Aperture will reconnect all at once, if you point the first image version to its counterpart.

  • How can I save the images to the iPhone anywhere

    Hello  I own Time capsule 3 tb. How can I save the images to the iPhone anywhere in Time capsule
    note i used fileexplorer when Outside the home isee Outside Message " error connection failed with the error operation time out "
    Thanks

    Most Simple Back Up:
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex: Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
    Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store
    If you want to back up the Photos only:
    Export them using the File -> Export command.
    This User Tip
    https://discussions.apple.com/docs/DOC-4921
    has details of the options in the Export dialogue.

  • When I try to same an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!

    When I try to save an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!
    == This happened ==
    Every time Firefox opened
    == I updated to one of the firefox versions (Not sure which one it was)

    Thanks Alex, but sadly I already tried that. Neither .docx or .xlsx files show up in the content list. They both show as a Chrome HTML document so changing how Firefox addresses those doesn't help since it thinks its the same type of file. I don't think I can manually add files into the "Content Type" left side nav.

  • How can I transafer my images please from PC to iphone 4s

    how can I transafer my  images ,please, from PC to iphone 4s.I dont understand how can  I do it. Where is the options to add photos..I just remember that I must synchronize something..I've tried to find in internet but I see another interface of itunes on all kind of videos? I have anotherinterface in itunes.Ive allready update my itunes and iphone and have a latest version of IOS ..What is f...g  that?please help me..

    Also, the reason your iTunes interface may look different may be covered by the following in iTunes: Syncing photos
    Click the Device button in the upper right corner. (If viewing the iTunes Store, click the Library button in the upper-right corner first.) If you don't see your device, choose Hide Sidebar from the View menu.

  • Import qeustion.  How to to update the image description

    We have imported 200k images using image manager, but there was not a way to specify the image description
    I thought I may be able to do it in the import manager from a source file which had fields for image name and image description, but can not find a way to do this in image manager or in the import manager as the image table is not the main table.
    How can we update the description field on images?
    Thanks

    Hi Lee,
    We had same issue..We cannot see the image description in datamanager..we have created  a qualiifed look up and reordered qualified table in such away, so that the qualified table is just below Image ..
    Now you can import the image description via import manager and put the corresponding  image in image table..
    I know its digy but cant help ..waiting for 7.1 ..
    Lets see what it offers...
    Cheers!!
    Vikrant M Kelkar..

  • How can I use an image as a folder background on icon

    vista updated firefox - how can I use an image as a folder background for an icon of that folder (for desktop)

    This is not a Firefox related issue or Firefox setting etc. This is a windows or OS setting, I provided the link below on how to change this in Windows Vista.
    See:
    '''[http://answers.microsoft.com/en-us/windows/forum/windows_vista-desktop/how-do-i-change-the-folder-icon-in-vista-to-one/01261170-4e02-4c4b-8c02-141d1524ad3e?auth=1]'''

  • How can I read the image from database into form

    hi everyone
    if I have table like this
    create table test
    (id number(10),
    pic long raw);
    in this table record
    in form If I have block non database
    how can i read the image into non database item
    I try with this code but no good
    select pic into :photo from test where id=5;
    photo its non database item kind image
    how can i invoke image into item
    thanks alooooooot

    Hello,
    You can't select image with select query. You need to create another database block from test table which has item binds with database pic column. Now in where condition in test block's property you have to write id=5. Change test block's properties UPDATE ALLOWED, INSERT ALLOWED, DELETE ALLOWED to NO. Only Query allowed property set to YES.
    Now in your particular trigger write the code
    GO_BLOCK('test');
    Execute_Query;
    please mark if it help you or correct
    Regards,
    Danish

  • How can I save the images and movies on a  external Disk from iphoto program, to protect the images when problems occur in the laptop,

    How can I save the images and movies on a  external Disk from iphoto program, to protect the images when problems occur in the laptop,

    Most Simple Back Up:
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex: Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
    Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store
    If you want to back up the Photos only:
    Export them using the File -> Export command.
    This User Tip
    https://discussions.apple.com/docs/DOC-4921
    has details of the options in the Export dialogue.

  • How can I update Fotoshop 12 to 13 ß

    How can I update Fotoshop 12 to 13

    Hi,
    You can buy either the upgrade version or the full version - there is no real difference except that the upgrade version asks you for your previous serial number. The upgrade version is not always the cheapest so you need to shop around.
    Once you have bought it, if you are installing on the same system as your previous version, it should pick up and convert your catalog to the new format.
    Remember, your images are not "in" Photoshop Elements - the catalog only keeps a pointer to where you have stored the images on the disk.
    Brian

  • How can I update my app store account ?

    Hi, I have a new Iphone and I wanted to add some applications from apple store.
    Unfortunately, I had a message saying that I was using app store on a new device (true) and they needed to check some security thing from my visa card. Unfortunately, I had a new  card and do not have the previous one anylonger (the previous one expires in 1 year but had to be cancelled).
    Therefore I am blocked and cannot get into my account.
    How can I update my bank account and get into the apple store again ?
    Thanks
    Nadiege

    Great, it worked. i could update the account from the laptop (but not from the phone).
    Many thanks for such a swift feedback !!

  • I upgraded from 3gs and want to use my old 3gs as an ipod. how can i update my new apple ID on the 3gs as it still shows a previous one that I had?

    I recently upgraded from 3Gs to Iphone4 and want to use my old 3Gs as an ipod. how can i update
    the user ID on the 3gs to a new one that I have as it is still showing a previous user ID?

    Settings>Store...tap the ID shown...sign out...sign back in with the ID you want to use.

  • How can i update data in JTable at run time ?

    i am trying to build a client/server architecture for conducting quizzes & online tests.. My client will return a object to the server after the test is over, which contains details about the participant, his score and other details. i am putting the incoming object to an Vector. I'll create a new thread each time for the incoming connection and insert the object to the Vector.. Now, please tell me tat, how can i update my table automatically at run time so tat, my table is updated whenever a new object is entered into vector..
    here is my code for the table..
    public class MyTableModel extends AbstractTableModel {
        String columNames[] = { "ID", "NAME", "COLLEGE", "SCORE", "CELL" };
        /** Creates a new instance of MyTableModel */
        public MyTableModel() {
            Main.List = new Vector();
            SetDefaultData();
        public int getRowCount() {
            return Main.List == null ? 0 : Main.List.size();
        public int getColumnCount() {
            return columNames.length;
        public String getColumnName(int column) {
            return columNames[column];
        public boolean isCellEditable(int row,int col) {
            return false;
        public Object getValueAt(int rowindex, int columnindex) {
            if(rowindex < 0 || rowindex >= getRowCount())
                return "";
            Student row = (Student)Main.List.elementAt(rowindex);
            switch (columnindex)
                case 0 : return row.id;
                case 1 : return row.name;
                case 2 : return row.college;
                case 3 : return row.score;
                case 4 : return row.cell;
            return "";
        public String getTitle() {
            return "Student Table";
        private void SetDefaultData() {
            Main.List.removeAllElements();
            Main.List.addElement(new Student("CS041","Keerthivasan M","MNM",95,"9884326321"));
            Main.List.addElement(new Student("CS012","Arun M","MNM",90,"9884825780"));
            Main.List.addElement(new Student("CS019","Balaji S","MNM",79,"9841742068"));
            Main.List.addElement(new Student("CS005","Anand R","MNM",89,"9884130727"));
            Main.List.addElement(new Student("CS045","Manish J","MNM",55,"9841624625"));
            Main.List.addElement(new Student("CS013","Mangal S","MNM",5,"9841961742"));
    }

    In the future Swing related questions should be posted in the Swing forum.
    how can i update my table automatically at run time so tat, my table is
    updated whenever a new object is entered into vector..You don't update the Vector directly. You should be creating a method in your TableModel, called "addRow(...)". This method will do two things:
    a) add the Student object to the Vector
    b) invoke the fireTableRowsInserted(..) method of AbstractTableModel. This will cause the table to be repainted.

Maybe you are looking for

  • Question: How to call a BPEL process from a PL/SQL procedure

    Hi All, Greetings to all BPEL people. I have a question on how can we call a BPEL process from a PLSQL procedure. It might be a stupid question but i wanted to know whether this fetaure is available in BPEL as our scenario requires us to explore if t

  • Specifying a circle with 2 mouse presses

    Hi, I'm trying to create an applet that allows the user to specify a circle with 2 mouse presses. I'd like the 1st point to represent the circle's centre and the 2nd to be any point on the periphery. Creating a mouse press event handler is a given ob

  • Client API generation from WSDL.

    Hi, Could any one guide as how to generate the client from WSDL? I am using RAD7/Eclipse. When i try to generate it gives below error. Errors occurred during wsimport.   warning: src-resolve.4.2: Error resolving component 'ns1:pagedata'. It was detec

  • Date function activation

    Hi, the date function does not work, how can i change this situation for example , if i do this sql request SELECT cli_num from CLIENT, FACTURE where client.cli_num= facture.fac_cli and YEAR(fac_date)='2000'; I receive a message error saying "YEAR":n

  • IDOC Error in SM58 and Management Console

    Hi Guys, Good day! I am currently having issues on sending IDOCs to BODS. There are instances that an IDOC gets stuck or ends up with an error in transaction code SM58. In transaction WE02, the IDOC is successfully processed with status 03. In a set