MCPcopy Create free account
hub / github.com/astra-toolbox/astra-toolbox / initialize

Method initialize

src/CudaForwardProjectionAlgorithm.cpp:82–122  ·  view source on GitHub ↗

--------------------------------------------------------------------------------------- Initialize - Config

Source from the content-addressed store, hash-verified

80//---------------------------------------------------------------------------------------
81// Initialize - Config
82bool CCudaForwardProjectionAlgorithm::initialize(const Config& _cfg)
83{
84 ConfigReader<CAlgorithm> CR("CudaForwardProjectionAlgorithm", this, _cfg);
85
86 bool ok = true;
87 int id = -1;
88
89 m_pProjector = nullptr;
90 if (CR.has("ProjectorId")) {
91 ok &= CR.getRequiredID("ProjectorId", id);
92 m_pProjector = CProjector2DManager::getSingleton().get(id);
93 if (!m_pProjector) {
94 ASTRA_ERROR("ProjectorId is not a valid id");
95 return false;
96 }
97 }
98
99 ok &= CR.getRequiredID("ProjectionDataId", id);
100 m_pSinogram = dynamic_cast<CFloat32ProjectionData2D*>(CData2DManager::getSingleton().get(id));
101
102 ok &= CR.getRequiredID("VolumeDataId", id);
103 m_pVolume = dynamic_cast<CFloat32VolumeData2D*>(CData2DManager::getSingleton().get(id));
104
105 if (!ok)
106 return false;
107
108 initializeFromProjector();
109
110 // Deprecated options
111 ok &= CR.getOptionInt("DetectorSuperSampling", m_iDetectorSuperSampling, m_iDetectorSuperSampling);
112 if (CR.hasOption("GPUIndex"))
113 ok &= CR.getOptionInt("GPUIndex", m_iGPUIndex, -1);
114 else
115 ok &= CR.getOptionInt("GPUindex", m_iGPUIndex, -1);
116
117 if (!ok)
118 return false;
119
120 // return success
121 return check();
122}
123
124//----------------------------------------------------------------------------------------
125// Initialize - C++

Callers

nothing calls this directly

Calls 5

getRequiredIDMethod · 0.80
getMethod · 0.80
hasMethod · 0.45
getOptionIntMethod · 0.45
hasOptionMethod · 0.45

Tested by

no test coverage detected