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

Method initialize

src/CudaDartMaskAlgorithm3D.cpp:60–91  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

58//---------------------------------------------------------------------------------------
59// Initialize - Config
60bool CCudaDartMaskAlgorithm3D::initialize(const Config& _cfg)
61{
62 ConfigReader<CAlgorithm> CR("CudaDartMaskAlgorithm3D", this, _cfg);
63
64 bool ok = true;
65 int id = -1;
66
67 ok &= CR.getRequiredID("SegmentationDataId", id);
68 m_pSegmentation = dynamic_cast<CFloat32VolumeData3D*>(CData3DManager::getSingleton().get(id));
69
70 ok &= CR.getRequiredID("MaskDataId", id);
71 m_pMask = dynamic_cast<CFloat32VolumeData3D*>(CData3DManager::getSingleton().get(id));
72
73 if (CR.hasOption("GPUIndex"))
74 ok &= CR.getOptionInt("GPUIndex", m_iGPUIndex, -1);
75 else
76 ok &= CR.getOptionInt("GPUindex", m_iGPUIndex, -1);
77
78 ok &= CR.getOptionUInt("Connectivity", m_iConn, 26);
79 ok &= CR.getOptionUInt("Threshold", m_iThreshold, 1);
80 ok &= CR.getOptionUInt("Radius", m_iRadius, 1);
81
82 if (!ok)
83 return false;
84
85 _check();
86
87 if (!m_bIsInitialized)
88 return false;
89
90 return true;
91}
92
93//---------------------------------------------------------------------------------------
94// Initialize - C++

Callers

nothing calls this directly

Calls 5

getRequiredIDMethod · 0.80
getMethod · 0.80
hasOptionMethod · 0.45
getOptionIntMethod · 0.45
getOptionUIntMethod · 0.45

Tested by

no test coverage detected