Medical Imaging Interaction Toolkit  2021.10.00
Medical Imaging Interaction Toolkit
mitkThreadedToFRawDataReconstruction.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 #ifndef __mitkThreadedToFRawDataReconstruction_h
13 #define __mitkThreadedToFRawDataReconstruction_h
14 
15 // mitk includes
16 #include "mitkImageSource.h"
17 #include <MitkPMDExports.h>
18 
19 // itk includes
20 #include <itkBarrier.h>
21 #include <itkFastMutexLock.h>
22 
23 // vtk includes
24 #include "vtkShortArray.h"
25 
26 namespace mitk
27 {
29  {
30  std::vector<std::vector<short> > m_InputData;
31  std::vector<float*> m_OutputData;
32  unsigned int m_DataSize;
33  unsigned int m_LineWidth;
34  unsigned int m_FrameHeight;
35  unsigned int m_ModulationFrequency;
36  itk::Barrier::Pointer m_Barrier;
37  itk::FastMutexLock::Pointer m_ImageDataMutex;
38  itk::FastMutexLock::Pointer m_ThreadDataMutex;
39  };
40 
41  class MITKPMD_EXPORT ThreadedToFRawDataReconstruction : public itk::ProcessObject
42  {
43  public:
44 
46  itkFactorylessNewMacro(Self);
47  itkCloneMacro(Self);
48  itkGetMacro(Init, bool);
49 
50  void SetChannelData(vtkShortArray* sourceData);
51 
52  void Initialize(int width, int height, int modulationFrequency, int sourceDataSize );
53 
54  void GetDistances(float* dist);
55  void GetAmplitudes(float* ampl);
56  void GetIntensities(float* inten);
57  void GetAllData(float* dist, float* ampl, float* inten);
58 
59  void Update();
60 
61  protected:
70 
75  virtual void GenerateData();
76 
81  virtual void BeforeThreadedGenerateData();
82 
86  static ITK_THREAD_RETURN_TYPE ThreadedGenerateDataCallbackFunction(void* data);
91  void ResizeOutputImage(float* in, float* out);
92 
93  // member variables
95  int m_Width;
96  int m_Height;
99  vtkShortArray* m_SourceData;
100  bool m_Init;
101 
102  float* m_CISDist;
103  float* m_CISAmpl;
104  float* m_CISInten;
108 
109  itk::MultiThreader::Pointer m_Threader;
111 
112  };
113 } //end mitk namespace
114 
115 #endif // __mitkThreadedToFRawDataReconstruction_h
itk::FastMutexLock::Pointer m_ImageDataMutex
mutex for coordinated access to image data
float * m_CISDist
holds the distance information from for one distance image slice
DataCollection - Class to facilitate loading/accessing structured data.
float * m_CISAmpl
holds the amplitude information from for one amplitude image slice
itk::Barrier::Pointer m_Barrier
barrier to synchronize ends of threads
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
std::vector< std::vector< short > > m_InputData
float * m_CISInten
holds the intensity information from for one intensity image slice
itk::FastMutexLock::Pointer m_ThreadDataMutex
mutex to control access to images