--------------------------------------------------------------------------------------- Initialize - Config
| 85 | //--------------------------------------------------------------------------------------- |
| 86 | // Initialize - Config |
| 87 | bool CCudaForwardProjectionAlgorithm3D::initialize(const Config& _cfg) |
| 88 | { |
| 89 | ConfigReader<CAlgorithm> CR("CudaForwardProjectionAlgorithm3D", this, _cfg); |
| 90 | |
| 91 | // projector |
| 92 | m_pProjector = 0; |
| 93 | int id = -1; |
| 94 | if (CR.has("ProjectorId")) { |
| 95 | CR.getID("ProjectorId", id); |
| 96 | m_pProjector = CProjector3DManager::getSingleton().get(id); |
| 97 | if (!m_pProjector) { |
| 98 | ASTRA_WARN("Optional parameter ProjectorId is not a valid id"); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | bool ok = true; |
| 103 | |
| 104 | // sinogram data |
| 105 | ok &= CR.getRequiredID("ProjectionDataId", id); |
| 106 | m_pProjections = dynamic_cast<CFloat32ProjectionData3D*>(CData3DManager::getSingleton().get(id)); |
| 107 | |
| 108 | // reconstruction data |
| 109 | ok &= CR.getRequiredID("VolumeDataId", id); |
| 110 | m_pVolume = dynamic_cast<CFloat32VolumeData3D*>(CData3DManager::getSingleton().get(id)); |
| 111 | |
| 112 | if (!ok) |
| 113 | return false; |
| 114 | |
| 115 | initializeFromProjector(); |
| 116 | |
| 117 | // Deprecated options |
| 118 | ok &= CR.getOptionInt("DetectorSuperSampling", m_iDetectorSuperSampling, m_iDetectorSuperSampling); |
| 119 | if (CR.hasOption("GPUIndex")) |
| 120 | ok &= CR.getOptionIntArray("GPUIndex", m_GPUIndices, true); |
| 121 | else if (CR.hasOption("GPUindex")) |
| 122 | ok &= CR.getOptionIntArray("GPUindex", m_GPUIndices, true); |
| 123 | if (!ok) |
| 124 | return false; |
| 125 | |
| 126 | // success |
| 127 | m_bIsInitialized = check(); |
| 128 | |
| 129 | if (!m_bIsInitialized) |
| 130 | return false; |
| 131 | |
| 132 | return true; |
| 133 | } |
| 134 | |
| 135 | |
| 136 | bool CCudaForwardProjectionAlgorithm3D::initialize(CProjector3D* _pProjector, |
nothing calls this directly
no test coverage detected