Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkMovieGenerator.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkMovieGenerator_h
14 #define mitkMovieGenerator_h
15 
17 #include <mitkBaseRenderer.h>
18 #include <mitkCommon.h>
19 #include <mitkStepper.h>
20 
21 namespace mitk
22 {
39  class MITKALGORITHMSEXT_EXPORT MovieGenerator : public itk::LightObject
40  {
41  public:
43 
48  static Pointer New(void);
49 
54  virtual void SetStepper(Stepper *stepper) { m_stepper = stepper; }
55 
60  virtual void SetRenderer(BaseRenderer *renderer) { m_renderer = renderer; }
61 
66  virtual void SetFileName(const char *fileName) { strcpy(m_fileName, fileName); }
67 
77  virtual bool WriteMovie();
78 
87  virtual bool WriteCurrentFrameToMovie();
88 
92  virtual void ReleaseMovieWriter();
93 
98  virtual void SetFrameRate(unsigned int rate);
99 
104  unsigned int GetFrameRate();
105 
106  protected:
109 
111  virtual bool InitGenerator() = 0;
112 
114  virtual bool AddFrame(void *data) = 0;
115 
117  virtual bool TerminateGenerator() = 0;
118 
120  char m_fileName[1024];
121 
124 
127 
129  int m_width, m_height;
130 
132 
133  unsigned int m_FrameRate;
134  };
135 
136 } // namespace mitk
137 
138 #endif
#define MITKALGORITHMSEXT_EXPORT
Organizes the rendering process.
Abstract base class for recording movies from OpenGL render windows.
static Pointer New(void)
Factory method returning a platform-specific MovieGenerator.
virtual bool InitGenerator()=0
called directly before the first frame is added, determines movie size from renderer
MovieGenerator()
default constructor
mitkClassMacroItkParent(MovieGenerator, itk::LightObject)
virtual bool WriteCurrentFrameToMovie()
Capture a single frame and add it to the movie.
virtual bool AddFrame(void *data)=0
used to add a frame
Stepper * m_stepper
stores the used stepper
virtual bool TerminateGenerator()=0
called after the last frame is added
virtual bool WriteMovie()
Generate a movie by iterating through all stepper steps.
virtual void SetRenderer(BaseRenderer *renderer)
Set the renderer whose render window will be captured.
unsigned int GetFrameRate()
Get the frame rate of the output movie.
virtual void SetFileName(const char *fileName)
Set the output filename for the movie.
virtual void ReleaseMovieWriter()
Release the movie writer resources after using WriteCurrentFrameToMovie().
BaseRenderer * m_renderer
stores the uses renderer
virtual void SetStepper(Stepper *stepper)
Set the stepper used to control movie generation.
virtual void SetFrameRate(unsigned int rate)
Set the frame rate of the output movie.
Helper class to step through a list.
Definition: mitkStepper.h:48
Find image slices visible on a given plane.