Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. I want to apply the cine of series image inside my project?
Forum Updated to NodeBB v4.3 + New Features

I want to apply the cine of series image inside my project?

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 2 Posters 1.8k 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
    amarism
    wrote on last edited by amarism
    #1

    I have a series of image loaded inside the viewport. Now, I want to take a button and when i click the button all the slices of series changing to FPS(frame per second). I dont have enough idea abot how to do this.
    I will used this code for move slider infinite time:-

    connect is used for tranfering the signal when button is pressed.

    connect(this->ui->m_cine, SIGNAL(pressed()), this, SLOT(AnimatedSlider()));
    

    this Function is the working function infinite loop:-

    void QtVTKRenderWindows::AnimatedSlider()
    {
    QPropertyAnimation *animation = new QPropertyAnimation(slider, "sliderPosition");
    animation->setDuration(1000);
    animation->setStartValue(slider->minimum());
    animation->setEndValue(slider->maximum());
    animation->setEasingCurve(QEasingCurve::OutCubic);
    animation->setLoopCount(-1);
    animation->start();
    }
    

    But i am getting problem like when i set the loop count to -1. It will goes to finite time

    Any help is considerable
    Thank you

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      Hi,

      One thing that is not good is that you are creating a new animation each time you call AnimatedSlider. You should likely create it once and only update its parameter and start it in AnimatedSlider.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 2 Replies Last reply
      1
      • SGaistS SGaist

        Hi,

        One thing that is not good is that you are creating a new animation each time you call AnimatedSlider. You should likely create it once and only update its parameter and start it in AnimatedSlider.

        A Offline
        A Offline
        amarism
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          One thing that is not good is that you are creating a new animation each time you call AnimatedSlider. You should likely create it once and only update its parameter and start it in AnimatedSlider.

          A Offline
          A Offline
          amarism
          wrote on last edited by
          #4

          @SGaist Slider is moving but the problem is coming is once the slider reached to maximum point. then it will be stop .But i want to set the slider like that once it will reached to maximum point then again slider comes to the initial point.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            So you should use something like:

            animation->setKeyValueAt(0, slider->minimum());
            animation->setKeyValueAt(0.5, slider->maximum());
            animation->setKeyValueAt(1, slider->minimum());
            

            and remove the setStartValue and setEndValue calls.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            A 1 Reply Last reply
            0
            • SGaistS SGaist

              So you should use something like:

              animation->setKeyValueAt(0, slider->minimum());
              animation->setKeyValueAt(0.5, slider->maximum());
              animation->setKeyValueAt(1, slider->minimum());
              

              and remove the setStartValue and setEndValue calls.

              A Offline
              A Offline
              amarism
              wrote on last edited by amarism
              #6

              @SGaist i am getting the slider movement.. open more problem comes is .. when i will moving the cine in loop by increasing the slider one by oen but it will be move not one by one. How to fix this

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                I don't understand that statement. Can you rephrase it or show an example of what is happening ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                A 1 Reply Last reply
                0
                • SGaistS SGaist

                  I don't understand that statement. Can you rephrase it or show an example of what is happening ?

                  A Offline
                  A Offline
                  amarism
                  wrote on last edited by
                  #8

                  @SGaist On button click slider move like cine play . but every slice of image not show .Like it will skip slice of image .
                  I am taking the trigger signal when the move

                  connect(sliter, SIGNAL(valueChanged(int)), SLOT(slider_Event(int)));
                  

                  And i am invoking the signal here.when the slider is move from one slice to another slice.

                   void QtVTKRenderWindows::slider_Event(int index)
                  {
                  int pos =slider->sliderPosition();
                  RadSpaViewer->m_VtkImageSlicing(pos, 2);
                  }
                  

                  this function is work for displaying the next slice

                   m_VtkImageSlicing(sliderposition,sliderNumber)
                  
                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Is the slider max value accurate ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    A 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Is the slider max value accurate ?

                      A Offline
                      A Offline
                      amarism
                      wrote on last edited by
                      #10

                      @SGaist yes we are taking the series minimum and maximum value and fixed it here

                      animation->setStartValue(minimumSliderValue);
                      animation->setEndValue(maximumSliderValue);
                      
                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        What are these values ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        A 1 Reply Last reply
                        0
                        • SGaistS SGaist

                          What are these values ?

                          A Offline
                          A Offline
                          amarism
                          wrote on last edited by
                          #12

                          @SGaist Series minimum value is (minimumSliderValue) and maximum value is (maximumSliderValue) . Like total how many slice are there inside the series. For example series has 52 slices then minimumSliderValue = 0, and maximumSliderValue = 52.

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Did you set the singleStep to 1 ?

                            Also, did you check the value you receiving in that slot ?

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            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