-ReconstructorSupervisor::ReconstructorSupervisor (ProjectionFileView* pProjView,
- int iImageNX, int iImageNY, const char* pszFilterName, double dFilterParam, const char* pszFilterMethod,
- int iZeropad, const char* pszFilterGenerationName, const char* pszInterpName, int iInterpParam,
- const char* pszBackprojectName, const char* const pszLabel)
- : m_pDialogProgress(NULL), m_bFail(false), m_iNumThreads(0), m_iImageNX(iImageNX),
- m_iImageNY(iImageNY), m_strLabel(pszLabel), m_pTimer(NULL), m_bCancelled(false), m_bCancelling(false),
- BackgroundSupervisor()
-{
- m_iNumThreads = theApp->getNumberCPU();
- // ++m_iNumThreads;
- m_iTotalViews = pProjView->GetDocument()->getProjections().nView();
- int iBaseViews = m_iTotalViews / m_iNumThreads;
- int iExtraViews = m_iTotalViews % m_iNumThreads;
-
- m_vecpChildImageFile.reserve (m_iNumThreads);
- m_vecpThread.reserve (m_iNumThreads);
-
- for (unsigned int iProc = 0; iProc < m_iNumThreads; iProc++) {
- m_vecpChildImageFile[iProc] = new ImageFile (iImageNX, iImageNY);
-
- int iStartView = iProc * iBaseViews;
- int iNumViews = iBaseViews;
- if (iProc < iExtraViews)
- ++iNumViews;
- m_vecpThread[iProc] = new ReconstructorWorker (this, pProjView, m_vecpChildImageFile[iProc], iProc, iStartView, iNumViews,
- pszFilterName, dFilterParam, pszFilterMethod, iZeropad, pszFilterGenerationName, pszInterpName, iInterpParam, pszBackprojectName);
- if (m_vecpThread[iProc]->Create () != wxTHREAD_NO_ERROR) {
- m_bFail = true;
- break;
- }
- }
- m_pProjView = pProjView;
- m_pProjDoc = pProjView->GetDocument();
-}