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

Method initialize

src/CudaRoiSelectAlgorithm.cpp:60–86  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

58//---------------------------------------------------------------------------------------
59// Initialize - Config
60bool CCudaRoiSelectAlgorithm::initialize(const Config& _cfg)
61{
62 ConfigReader<CAlgorithm> CR("CudaDartRoiSelectAlgorithm", this, _cfg);
63
64 bool ok = true;
65 int id = -1;
66
67 ok &= CR.getRequiredID("DataId", id);
68 m_pData = dynamic_cast<CFloat32VolumeData2D*>(CData2DManager::getSingleton().get(id));
69
70 if (CR.hasOption("GPUIndex"))
71 ok &= CR.getOptionInt("GPUIndex", m_iGPUIndex, -1);
72 else
73 ok &= CR.getOptionInt("GPUindex", m_iGPUIndex, -1);
74
75 ok &= CR.getOptionNumerical("Radius", m_fRadius, 0.0f);
76
77 if (!ok)
78 return false;
79
80 _check();
81
82 if (!m_bIsInitialized)
83 return false;
84
85 return true;
86}
87
88//---------------------------------------------------------------------------------------
89// Initialize - C++

Callers

nothing calls this directly

Calls 5

getRequiredIDMethod · 0.80
getMethod · 0.80
hasOptionMethod · 0.45
getOptionIntMethod · 0.45
getOptionNumericalMethod · 0.45

Tested by

no test coverage detected