#include #include #include #include #include #include using std::vector; using std::setw; void growObject(Detection &object, Cube &cube) { /** * growObject(Detection, Cube) * A function to grow an object (given by the Detection) * out to some lower threshold. * The Cube is necessary to see both the Param list, containing * the growth threshold, and the actual array of pixel fluxes. * Each pixel has each of its neighbours examined, and if one of * them is not in the object but above the growth threshold, it * is added to the object. */ vector isInObj(cube.getSize(),false); float thresh1; float thresh2; long chanpos; for(int i=0;i growthStats = cube.getStats(); growthStats.setThresholdSNR(cube.pars().getGrowthCut()); growthStats.setUseFDR(false); for(int pix=0; pix=0)&& (newy=0)&& (newz=0)){ pixnew.setX(newx); pixnew.setY(newy); pixnew.setZ(newz); float flux; if(cube.isRecon()) flux = cube.getReconValue(newx,newy,newz); else flux = cube.getPixValue(newx,newy,newz); pixnew.setF(flux); long chanpos = newx + newy * cube.getDimX(); long pos = newx + newy * cube.getDimX() + newz * cube.getDimX() * cube.getDimY(); if( (!isInObj[pos]) && growthStats.isDetection(flux) ){ isInObj[pos] = true; object.addPixel(pixnew); } // end of if } // end of if clause regarding newx, newy, newz } // end of if clause regarding xnbr, ynbr, znbr } // end of znbr loop } // end of ynbr loop } // end of xnbr loop } // end of pix loop object.calcParams(); isInObj.clear(); }