Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Problem with updating itk image in Qt user interface
Forum Updated to NodeBB v4.3 + New Features

Problem with updating itk image in Qt user interface

Scheduled Pinned Locked Moved C++ Gurus
4 Posts 3 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Angobar
    wrote on last edited by
    #1

    I have a problem that I would like to tell you because is about some days that I don’t have new ideas. Thanks in advanced 

    I have an image pointed with a double* pointer, and I want to translate it into itk::smartpointer for updating the user graphic interface, for this purpose I made this method :

    @void prueba_r01::double2itk( double *im_proc, ImageType::Pointer salida, int alto, int ancho)
    // This method translate the double
    image into itk:smartpointer image
    ImageType::IndexType pixelIndex; // pixelIndex[0]= index x-axis; pixelIndex[1] = index y-axisy
    ImageType::PixelType pixelValue;
    ImageType::PixelType aux; //auxiliar variable for checking the behaviour of the programm

    // Doing a sweep of all the image (is in double *im_proc) translating the values into itk pointer format
    for (int x=0; x<ancho; x++){ // ancho: widht of the image
    pixelIndex[0]=x;//x position
    for (int y=0; y<alto; y++){ // alto: height of the image
    pixelIndex[1]=y;//y position
    pixelValue= (im_proc+x+anchoy);
    (*salida)->SetPixel(pixelIndex,pixelValue);
    aux = (*salida)->GetPixel(pixelIndex); // checking that the image has been correctly transtaled from im_proc to salida-- > CHECKED
    }

    }
    }@

    And then is called here:
    @ //Translation of the double* image into itk:smartpointer image
    double2itk(out_inv, &(ui.imageframe->imagereader), alto, ancho); @

    And after that, the user interface is updated:
    @ // Update of the image shonw in the user interface
    ui.imageframe->update();@
    The problem is that it seems that everything is working correctly, but the image in the interface is not updated. Another option also valid for my project could be to stored the image in a ‘.bmp’ or ‘.jpeg’ file. Could someone help me? Any ideas of what is not working properly? Is there any function for creating this image files?

    Thanks so much!!

    Cheers

    Antonio

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Note: I have no clue what itk is.

      What is imageframe->imagereader exactly?

      Please note that QImages and QPixmaps are implicitly shared classes. That means that if you start changing one that you get from a widget, it will change a copy of the original one. To make the widget update, you have to explicitly set the image or the pixmap on the widget again.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Angobar
        wrote on last edited by
        #3

        First of all, thanks for replying, ITK is a cross-platform, open-source application development framework widely used for the development of image segmentation and image registration programs.

        ui is the user interface, with that sentence I am calling the image which is displayed(is being readed) in the frame of the Qt graphic interface.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Massinissa
          wrote on last edited by
          #4

          Hi everyone
          Actually I'm working with ITK and I want to know how you did to integrate C++ with QT. I just want to know how it works because I'm new on it. I'm working on image co-registration using ITK and I want to display the result on a GUI with QT but I don't know how to proceed! any help??

          Massinissa

          Massinissa Bandou Ing.jr

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved