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

Method initialize

src/CudaDartMaskAlgorithm.cpp:59–90  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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