Medical Imaging Interaction Toolkit  2023.12.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
mitk::ThreadedToFRawDataReconstruction::m_ThreadData
ThreadDataStruct * m_ThreadData
Definition: mitkThreadedToFRawDataReconstruction.h:110
mitk::ThreadedToFRawDataReconstruction::m_ThreadedCISDist
float * m_ThreadedCISDist
Definition: mitkThreadedToFRawDataReconstruction.h:105
mitk::ThreadDataStruct::m_InputData
std::vector< std::vector< short > > m_InputData
Definition: mitkThreadedToFRawDataReconstruction.h:30
mitk::ThreadDataStruct::m_ThreadDataMutex
itk::FastMutexLock::Pointer m_ThreadDataMutex
mutex to control access to images
Definition: mitkThreadedToFRawDataReconstruction.h:38
mitk::ThreadedToFRawDataReconstruction::m_SourceData
vtkShortArray * m_SourceData
Definition: mitkThreadedToFRawDataReconstruction.h:99
mitk::ThreadDataStruct
Definition: mitkThreadedToFRawDataReconstruction.h:28
mitk::ThreadDataStruct::m_ImageDataMutex
itk::FastMutexLock::Pointer m_ImageDataMutex
mutex for coordinated access to image data
Definition: mitkThreadedToFRawDataReconstruction.h:37
mitk::ThreadedToFRawDataReconstruction
Definition: mitkThreadedToFRawDataReconstruction.h:41
mitk::ThreadedToFRawDataReconstruction::m_Threader
itk::MultiThreader::Pointer m_Threader
Definition: mitkThreadedToFRawDataReconstruction.h:109
mitk::ThreadDataStruct::m_FrameHeight
unsigned int m_FrameHeight
Definition: mitkThreadedToFRawDataReconstruction.h:34
mitk::ThreadedToFRawDataReconstruction::m_CISInten
float * m_CISInten
holds the intensity information from for one intensity image slice
Definition: mitkThreadedToFRawDataReconstruction.h:104
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk::ThreadedToFRawDataReconstruction::m_SourceDataSize
int m_SourceDataSize
Definition: mitkThreadedToFRawDataReconstruction.h:98
mitk::ThreadedToFRawDataReconstruction::m_Width
int m_Width
Definition: mitkThreadedToFRawDataReconstruction.h:95
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ThreadDataStruct::m_OutputData
std::vector< float * > m_OutputData
Definition: mitkThreadedToFRawDataReconstruction.h:31
mitk::ThreadedToFRawDataReconstruction::m_CISAmpl
float * m_CISAmpl
holds the amplitude information from for one amplitude image slice
Definition: mitkThreadedToFRawDataReconstruction.h:103
mitk::ThreadedToFRawDataReconstruction::m_StackSize
int m_StackSize
Definition: mitkThreadedToFRawDataReconstruction.h:94
mitk::ThreadedToFRawDataReconstruction::m_Height
int m_Height
Definition: mitkThreadedToFRawDataReconstruction.h:96
mitk::ThreadDataStruct::m_ModulationFrequency
unsigned int m_ModulationFrequency
Definition: mitkThreadedToFRawDataReconstruction.h:35
mitk::ThreadedToFRawDataReconstruction::m_ThreadedCISAmpl
float * m_ThreadedCISAmpl
Definition: mitkThreadedToFRawDataReconstruction.h:106
mitk::ThreadDataStruct::m_Barrier
itk::Barrier::Pointer m_Barrier
barrier to synchronize ends of threads
Definition: mitkThreadedToFRawDataReconstruction.h:36
mitk::ThreadedToFRawDataReconstruction::m_Init
bool m_Init
Definition: mitkThreadedToFRawDataReconstruction.h:100
mitk::ThreadedToFRawDataReconstruction::m_CISDist
float * m_CISDist
holds the distance information from for one distance image slice
Definition: mitkThreadedToFRawDataReconstruction.h:102
mitk::ThreadDataStruct::m_DataSize
unsigned int m_DataSize
Definition: mitkThreadedToFRawDataReconstruction.h:32
mitk::ThreadDataStruct::m_LineWidth
unsigned int m_LineWidth
Definition: mitkThreadedToFRawDataReconstruction.h:33
mitk::ThreadedToFRawDataReconstruction::m_ThreadedCISInten
float * m_ThreadedCISInten
Definition: mitkThreadedToFRawDataReconstruction.h:107
mitk::ThreadedToFRawDataReconstruction::m_ImageSize
int m_ImageSize
Definition: mitkThreadedToFRawDataReconstruction.h:97
mitkImageSource.h