当前位置: 首页>>代码示例>>C++>>正文


C++ DataAccessor::toPixel方法代码示例

本文整理汇总了C++中DataAccessor::toPixel方法的典型用法代码示例。如果您正苦于以下问题:C++ DataAccessor::toPixel方法的具体用法?C++ DataAccessor::toPixel怎么用?C++ DataAccessor::toPixel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataAccessor的用法示例。


在下文中一共展示了DataAccessor::toPixel方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: bilinear_height

double bilinear_height(DataAccessor pSrcAcc, double I, double J)
   {

	   double z1=0,z2=0,z3=0,z4=0;
       pSrcAcc->toPixel(int(J),int(I));
	   VERIFY(pSrcAcc.isValid());
	   z1 = pSrcAcc->getColumnAsDouble();

       pSrcAcc->toPixel(int(J)+1,int(I));
	   VERIFY(pSrcAcc.isValid());
	   z2 = pSrcAcc->getColumnAsDouble();

       pSrcAcc->toPixel(int(J),int(I)+1);
	   VERIFY(pSrcAcc.isValid());
	   z3 = pSrcAcc->getColumnAsDouble();

       pSrcAcc->toPixel(int(J)+1,int(I)+1);
	   VERIFY(pSrcAcc.isValid());
	   z4 = pSrcAcc->getColumnAsDouble();

       double a=0,b=0,c=0,d=0;    

	   d = z1;
	   a = (z2-z1);
	   b = (z3-z1);
	   c = (z4+z1-z2-z3);
	   
	   double H = a*(J-int(J))+b*(I-int(I))+c*(I-int(I))*(J-int(J))+d; 

	   return H;
   }
开发者ID:GSoC-2012-Nascetti,项目名称:SAR_PlugIn,代码行数:31,代码来源:Orthorectification.cpp

示例2: execute


//.........这里部分代码省略.........
      }
      if (isAborted())
      {
         std::string msg = getName() + " has been aborted.";
         pStep->finalize(Message::Abort, msg);
         if (pProgress != NULL)
         {
            pProgress->updateProgress(msg, 0, ABORT);
         }
         
         free(OrigData);
         free(NewData);
         free(ConvoData);
         
         return false;
      }
      
      deltaValue = DeconvolutionFunc(OrigData, pOriginalImage, NewData, ConvoData, sigmaVal, gamaVal, 
                                     windowSize, pDesc->getRowCount(), pDesc->getColumnCount(), nFilterType, maxGrayValue, minGrayValue);


      pTempData = OrigData;
      OrigData = NewData;
      NewData = pTempData;

	  double errorRate = deltaValue/(maxGrayValue-minGrayValue);
	  if (errorRate < CONVERGENCE_THRESHOLD)
	  {
		  break;
	  }
   }
   
   free(NewData);
   free(ConvoData);


   //Output result
   unsigned int nCount = 0;
   for (int i = 0; i < pDesc->getRowCount(); i++)
   {
       for (int j = 0; j < pDesc->getColumnCount(); j++)		   
	   {		   
		   if (!pDestAcc.isValid())
           {       
		       std::string msg = "Unable to access the cube data.";        
			   pStep->finalize(Message::Failure, msg);
                       
			   if (pProgress != NULL)                      
			   {         
			       pProgress->updateProgress(msg, 0, ERRORS);       
			   }   
			   free(OrigData);                  
			   return false;              
		   }
			   
		   pDestAcc->toPixel(i, j);	
		   switchOnEncoding(ResultType, restoreImageValue, pDestAcc->getColumn(), (OrigData+nCount));
		   nCount++;

	   }
   }
   
   free(OrigData);  


   if (!isBatch())
   {
      Service<DesktopServices> pDesktop;

      SpatialDataWindow* pWindow = static_cast<SpatialDataWindow*>(pDesktop->createWindow(pResultCube->getName(),
         SPATIAL_DATA_WINDOW));

      SpatialDataView* pView = (pWindow == NULL) ? NULL : pWindow->getSpatialDataView();
      if (pView == NULL)
      {
         std::string msg = "Unable to create view.";
         pStep->finalize(Message::Failure, msg);
         if (pProgress != NULL) 
         {
            pProgress->updateProgress(msg, 0, ERRORS);
         }
         return false;
      }

      pView->setPrimaryRasterElement(pResultCube.get());
      pView->createLayer(RASTER, pResultCube.get());
   }

   if (pProgress != NULL)
   {
      pProgress->updateProgress("Deconvolution enhancement is complete.", 100, NORMAL);
   }

   pOutArgList->setPlugInArgValue("Deconvolution enhancement Result", pResultCube.release());

   pStep->finalize();


   return true;
}
开发者ID:felipebetancur,项目名称:Astronomy-Image-Processing,代码行数:101,代码来源:Deconvolution.cpp

示例3: getReporter

void ConvolutionFilterShell::ConvolutionFilterThread::convolve(const T*)
{
   int numResultsCols = mInput.mpIterCheck->getNumSelectedColumns();
   if (mInput.mpResult == NULL)
   {
      return;
   }

   const RasterDataDescriptor* pResultDescriptor = static_cast<const RasterDataDescriptor*>(
      mInput.mpResult->getDataDescriptor());

   // account for AOIs which extend outside the dataset
   int maxRowNum = static_cast<int>(mInput.mpDescriptor->getRowCount()) - 1;
   mRowRange.mFirst = std::max(0, mRowRange.mFirst);
   mRowRange.mLast = std::min(mRowRange.mLast, maxRowNum);

   unsigned int bandCount = mInput.mBands.size();
   for (unsigned int bandNum = 0; bandNum < bandCount; ++bandNum)
   {
      FactoryResource<DataRequest> pResultRequest;
      pResultRequest->setRows(pResultDescriptor->getActiveRow(mRowRange.mFirst),
         pResultDescriptor->getActiveRow(mRowRange.mLast));
      pResultRequest->setColumns(pResultDescriptor->getActiveColumn(0),
         pResultDescriptor->getActiveColumn(numResultsCols - 1));
      pResultRequest->setBands(pResultDescriptor->getActiveBand(bandNum),
         pResultDescriptor->getActiveBand(bandNum));
      pResultRequest->setWritable(true);
      DataAccessor resultAccessor = mInput.mpResult->getDataAccessor(pResultRequest.release());
      if (!resultAccessor.isValid())
      {
         return;
      }

      int oldPercentDone = -1;
      int rowOffset = static_cast<int>(mInput.mpIterCheck->getOffset().mY);
      int startRow = mRowRange.mFirst + rowOffset;
      int stopRow = mRowRange.mLast + rowOffset;

      int columnOffset = static_cast<int>(mInput.mpIterCheck->getOffset().mX);
      int startColumn = columnOffset;
      int stopColumn = numResultsCols + columnOffset - 1;

      int yshift = (mInput.mKernel.Nrows() - 1) / 2;
      int xshift = (mInput.mKernel.Ncols() - 1) / 2;

      FactoryResource<DataRequest> pRequest;
      pRequest->setRows(mInput.mpDescriptor->getActiveRow(std::max(0, startRow - yshift)),
         mInput.mpDescriptor->getActiveRow(std::min(maxRowNum, stopRow + mInput.mKernel.Nrows() - yshift)));
      pRequest->setColumns(mInput.mpDescriptor->getActiveColumn(startColumn),
         mInput.mpDescriptor->getActiveColumn(stopColumn));
      pRequest->setBands(mInput.mpDescriptor->getActiveBand(mInput.mBands[bandNum]),
         mInput.mpDescriptor->getActiveBand(mInput.mBands[bandNum]));
      DataAccessor accessor = mInput.mpRaster->getDataAccessor(pRequest.release());
      if (!accessor.isValid())
      {
         return;
      }

      Service<ModelServices> model;
      ModelServices* pModel = model.get();
      int numRows = stopRow - startRow + 1;
      for (int row_index = startRow; row_index <= stopRow; ++row_index)
      {
         int percentDone = 100 * ((bandNum * numRows) + (row_index - startRow)) / (numRows * bandCount); 
         if (percentDone > oldPercentDone)
         {
            oldPercentDone = percentDone;
            getReporter().reportProgress(getThreadIndex(), percentDone);
         }
         if (mInput.mpAbortFlag != NULL && *mInput.mpAbortFlag)
         {
            break;
         }

         for (int col_index = startColumn; col_index <= stopColumn; ++col_index)
         {
            double accum = 0.0;
            if (mInput.mpIterCheck->getPixel(col_index, row_index))
            {
               for (int kernelrow = 0; kernelrow < mInput.mKernel.Nrows(); kernelrow++)
               {
                  int neighbor_row = row_index - yshift + kernelrow;
                  int real_row = std::min(std::max(0, neighbor_row),
                     static_cast<int>(mInput.mpDescriptor->getRowCount()) - 1);
                  for (int kernelcol = 0; kernelcol < mInput.mKernel.Ncols(); kernelcol++)
                  {
                     int neighbor_col = col_index - xshift + kernelcol;
                     int real_col = std::min(std::max(0, neighbor_col),
                        static_cast<int>(mInput.mpDescriptor->getColumnCount()) - 1);
                     accessor->toPixel(real_row, real_col);
                     if (accessor.isValid() == false)
                     {
                        return;
                     }

                     double val = 0.0;
                     pModel->getDataValue<T>(reinterpret_cast<T*>(accessor->getColumn()), COMPLEX_MAGNITUDE, 0, val);
                     accum += mInput.mKernel(kernelrow+1, kernelcol+1) * val / mInput.mKernel.Storage();
                  }
               }
//.........这里部分代码省略.........
开发者ID:Tom-VdE,项目名称:opticks,代码行数:101,代码来源:ConvolutionFilterShell.cpp

示例4:

   double edgeDetection7(DataAccessor pSrcAcc, int row, int col, int rowSize, int colSize)
   {
      int prevCol = std::max(col - 1, 0);
      int prevRow = std::max(row - 1, 0);
      int nextCol = std::min(col + 1, colSize - 1);
      int nextRow = std::min(row + 1, rowSize - 1);

	  int prevCol1 = std::max(col-2,0);
	  int prevRow1= std::max(row-2,0);
	  int nextCol1= std::min(col+2,colSize-1);
	  int nextRow1= std::min(row+2,rowSize-1);

	  pSrcAcc->toPixel(prevRow1, prevCol1);
      int row1col1 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(prevRow1, prevCol);
      int row1col2 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(prevRow1, col);
      int row1col3 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(prevRow1, nextCol);
      int row1col4 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(prevRow1, nextCol1);
      int row1col5 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(prevRow, prevCol1);
      int row2col1 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(prevRow, prevCol);
      int row2col2 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(prevRow, col);
      int row2col3 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(prevRow, nextCol);
      int row2col4 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(prevRow, nextCol1);
      int row2col5 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(row, prevCol1);
      int row3col1 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(row, prevCol);
      int row3col2 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(row, col);
      int row3col3 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(row, nextCol);
      int row3col4 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(row, nextCol1);
      int row3col5 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(nextRow, prevCol1);
      int row4col1 = pSrcAcc->getColumnAsInteger();

	  pSrcAcc->toPixel(nextRow, prevCol);
      int row4col2 = pSrcAcc->getColumnAsInteger();

      pSrcAcc->toPixel(nextRow, col);
      int row4col3 = pSrcAcc->getColumnAsInteger();

      pSrcAcc->toPixel(nextRow, nextCol);
      int row4col4 = pSrcAcc->getColumnAsInteger();

      pSrcAcc->toPixel(nextRow, nextCol1);
      int row4col5 = pSrcAcc->getColumnAsInteger();

      pSrcAcc->toPixel(nextRow1, prevCol1);
      int row5col1 = pSrcAcc->getColumnAsInteger();

      pSrcAcc->toPixel(nextRow1, prevCol);
      int row5col2 = pSrcAcc->getColumnAsInteger();

      pSrcAcc->toPixel(nextRow1, col);
      int row5col3 = pSrcAcc->getColumnAsInteger();

      pSrcAcc->toPixel(nextRow1, nextCol);
      int row5col4 = pSrcAcc->getColumnAsInteger();

      pSrcAcc->toPixel(nextRow1, nextCol1);
      int row5col5 = pSrcAcc->getColumnAsInteger();

	   int g = row1col1 + row1col2 + row1col3 + row1col4 + row1col5 + row2col1 + row2col2 + row2col3 + row2col4
		         + row2col5 + row3col1 + row3col2 + 24*row3col3 + row3col4 + row3col5 + row4col1 + row4col2 + row4col3
				 + row4col4 + row4col5 + row5col1 + row5col2 + row5col3 + row5col4 + row5col5;


	    double value = g/159.0;

		return value;

      
   };
开发者ID:pMav5,项目名称:Ship-Detection-Applet-for-Opticks,代码行数:98,代码来源:highpass.cpp

示例5: process


//.........这里部分代码省略.........
    pResultRequest->setWritable(true);
    DataAccessor pDestAcc = pResultCube->getDataAccessor(pResultRequest.release());

    double NodeLat, NodeLon, H_IJ=0;
	//int DSM_I, DSM_J;

    for (unsigned int row = 0; row < N_Row; ++row)
    {
	  if (pProgress != NULL)
	  {
      pProgress->updateProgress("Calculating result", row * 100 / N_Row, NORMAL);
	  }

      if (!pDestAcc.isValid())
      {
         std::string msg = "Unable to access the cube data.";
         pProgress->updateProgress(msg, 0, ERRORS);
		 pStep->finalize(Message::Failure, msg);
         return false;
      }

      for (unsigned int col = 0; col < N_Col; ++col)
      {

		  NodeLat = OrthoGrid.Lat_Min+row*OrthoGrid.Lat_Step;
		  NodeLon = OrthoGrid.Lon_Min+col*OrthoGrid.Lon_Step;

		  // RETRIEVE HEIGHT VALUE FROM DSM 

		  if (DSM_resampling == 0) 
		  {
		  int DSM_I = int((NodeLon - DSMGrid.Lon_Min)/DSMGrid.Lon_Step);
		  int DSM_J = pDescDSM->getRowCount() - int((NodeLat - DSMGrid.Lat_Min)/DSMGrid.Lat_Step);		  
          pDSMAcc->toPixel(DSM_J,DSM_I);
	      VERIFY(pDSMAcc.isValid());
          H_IJ = (pDSMAcc->getColumnAsDouble());
		  }
		  else
		  {
		  double DSM_I = ((NodeLon - DSMGrid.Lon_Min)/DSMGrid.Lon_Step);
		  double DSM_J = pDescDSM->getRowCount() - ((NodeLat - DSMGrid.Lat_Min)/DSMGrid.Lat_Step);
		  H_IJ = bilinear_height(pDSMAcc,DSM_I,DSM_J);
		  }

		  P_COORD NodeImage = Model->SAR_GroundToImage(NodeLon,NodeLat,H_IJ+Geoid_Offset);

		  if ((NodeImage.I>1 && NodeImage.I< Model->Metadata.Width-1) && (NodeImage.J>1 && NodeImage.J< Model->Metadata.Height-1))
		  {
			switchOnEncoding(pResultDesc->getDataType(), copypixel3, pDestAcc->getColumn(), pSrcAcc, int(NodeImage.I), int(NodeImage.J),boxsize, H_IJ);		
		  }		  
		  pDestAcc->nextColumn();
      }

      pDestAcc->nextRow();
    }

   Service<DesktopServices> pDesktop;

   Service<ModelServices> pMod;

   GcpList* GcpL = static_cast<GcpList*>(pMod->createElement("corner coordinate","GcpList",pResultCube.get()));
   
   // Update GCPs Information: to account for Opticks reading gcp lat&lon values the opposite way around, 
   // here it is necessary to switch the value to assign lat to gcp.mCoordinate.mX  and lon to gcp.mCoordinate.mY 

   GcpPoint Punto;
开发者ID:GSoC-2012-Nascetti,项目名称:SAR_PlugIn,代码行数:67,代码来源:Orthorectification.cpp

示例6: execute

bool TextureSegmentation::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
   StepResource pStep("SAR image segmentation", "app", "CC430C1A-9D8C-4bb5-9254-FCF7EECAFA3C");
   if (pInArgList == NULL || pOutArgList == NULL)
   {
      return false;
   }
   Progress* pProgress = pInArgList->getPlugInArgValue<Progress>(Executable::ProgressArg());
   RasterElement* pCube = pInArgList->getPlugInArgValue<RasterElement>(Executable::DataElementArg());
   if (pCube == NULL)
   {
      std::string msg = "A raster cube must be specified.";
      pStep->finalize(Message::Failure, msg);
      if (pProgress != NULL) 
      {
         pProgress->updateProgress(msg, 0, ERRORS);
      }
      return false;
   }
   RasterDataDescriptor* pDesc = static_cast<RasterDataDescriptor*>(pCube->getDataDescriptor());
   VERIFY(pDesc != NULL);
   EncodingType ResultType = INT1UBYTE;


   FactoryResource<DataRequest> pRequest;
   pRequest->setInterleaveFormat(BSQ);
   DataAccessor pSrcAcc = pCube->getDataAccessor(pRequest.release());

   ModelResource<RasterElement> pResultCube(RasterUtilities::createRasterElement(pCube->getName() +
      "_Segmentation_Result", pDesc->getRowCount(), pDesc->getColumnCount(), ResultType));
   if (pResultCube.get() == NULL)
   {
      std::string msg = "A raster cube could not be created.";
      pStep->finalize(Message::Failure, msg);
      if (pProgress != NULL) 
      {
         pProgress->updateProgress(msg, 0, ERRORS);
      }
      return false;
   }
   FactoryResource<DataRequest> pResultRequest;
   pResultRequest->setWritable(true);
   DataAccessor pDestAcc = pResultCube->getDataAccessor(pResultRequest.release());

   if (isAborted())
   {
       std::string msg = getName() + " has been aborted.";
       pStep->finalize(Message::Abort, msg);
       if (pProgress != NULL)
       {
           pProgress->updateProgress(msg, 0, ABORT);
       }
               
	   return false;        
   }

   if (NULL != pBuffer)
   {
	   free(pBuffer);
   }
   pBuffer = (float *)malloc(sizeof(float)*pDesc->getRowCount()*pDesc->getColumnCount());
  
   MakeSegmentation(pSrcAcc, pBuffer, pBuffer, pDesc->getRowCount(), pDesc->getColumnCount(), pDesc->getDataType());

   //Output the value 
   unsigned int nCount = 0;
   for (unsigned int j = 0; j < pDesc->getColumnCount(); j++)
   {
       for (unsigned int i = 0; i < pDesc->getRowCount(); i++)		   
	   {		   
		   if (!pDestAcc.isValid())
           {       
			   std::string msg = "Unable to access the cube data.";        
			   pStep->finalize(Message::Failure, msg);
                       
			   if (pProgress != NULL)                      
			   {         
				   pProgress->updateProgress(msg, 0, ERRORS);       
			   }                     
			   return false;              
		   }
			   
		   pDestAcc->toPixel(i, j);		   
		   switchOnEncoding(ResultType, restoreSegmentationValue, pDestAcc->getColumn(), (pBuffer+nCount));
		   nCount++;
	   }
   }

   if (!isBatch())
   {
      Service<DesktopServices> pDesktop;

      SpatialDataWindow* pWindow = static_cast<SpatialDataWindow*>(pDesktop->createWindow(pResultCube->getName(),
         SPATIAL_DATA_WINDOW));

      SpatialDataView* pView = (pWindow == NULL) ? NULL : pWindow->getSpatialDataView();
      if (pView == NULL)
      {
         std::string msg = "Unable to create view.";
         pStep->finalize(Message::Failure, msg);
//.........这里部分代码省略.........
开发者ID:adakite,项目名称:Opticks-SAR,代码行数:101,代码来源:TextureSegmentation.cpp

示例7: execute


//.........这里部分代码省略.........
	   colLoops = pDesc->getColumnCount()/colBlocks;
   }
   else
   {
	   colLoops = pDesc->getColumnCount()/colBlocks + 1;
   }

   for (unsigned int i = 0; i < rowLoops; i++)
   {
	   if ( rowIndex + rowBlocks > pDesc->getRowCount())
	   {
		   rowIndex = pDesc->getRowCount() - rowBlocks;
	   }

	   colIndex = 0;

	   for (unsigned int j = 0; j < colLoops; j++)
	   {
		   if ( colIndex + colBlocks > pDesc->getColumnCount())
	       {
		       colIndex = pDesc->getColumnCount() - colBlocks;
	       }

		   if (pProgress != NULL)
           {
               pProgress->updateProgress("Remove result", (i*colLoops+j) / (rowLoops*colLoops), NORMAL);
           }
           if (isAborted())
           {
               std::string msg = getName() + " has been aborted.";
               pStep->finalize(Message::Abort, msg);
               if (pProgress != NULL)
               {
                   pProgress->updateProgress(msg, 0, ABORT);
               }
               return false;
           }
      
           //Process the data in current block
		   ProcessData(pSrcAcc, pBuffer, rowIndex, colIndex, rowBlocks, colBlocks, ScaleKValue, pDesc->getDataType());

		   //Output the value 
           for (unsigned int m = 0; m < rowBlocks; m++)
		   {
			   for (unsigned int n = 0; n < colBlocks; n++)
			   {
				   if (!pDestAcc.isValid())
                   {
                       std::string msg = "Unable to access the cube data.";
                       pStep->finalize(Message::Failure, msg);
                       if (pProgress != NULL) 
                       {
                           pProgress->updateProgress(msg, 0, ERRORS);
                       }
                       return false;
                   }

				   pDestAcc->toPixel(rowIndex+m, colIndex+n);
				   
				   switchOnEncoding(ResultType, speckleNoiseRemove, pDestAcc->getColumn(), (pBuffer+m*colBlocks+n));
			   }
		   }
		   colIndex += colBlocks;
	   }
	   rowIndex += rowBlocks;
   }

   if (!isBatch())
   {
      Service<DesktopServices> pDesktop;

      SpatialDataWindow* pWindow = static_cast<SpatialDataWindow*>(pDesktop->createWindow(pResultCube->getName(),
         SPATIAL_DATA_WINDOW));

      SpatialDataView* pView = (pWindow == NULL) ? NULL : pWindow->getSpatialDataView();
      if (pView == NULL)
      {
         std::string msg = "Unable to create view.";
         pStep->finalize(Message::Failure, msg);
         if (pProgress != NULL) 
         {
            pProgress->updateProgress(msg, 0, ERRORS);
         }
         return false;
      }

      pView->setPrimaryRasterElement(pResultCube.get());
      pView->createLayer(RASTER, pResultCube.get());
   }

   if (pProgress != NULL)
   {
      pProgress->updateProgress("Noise removal is compete.", 100, NORMAL);
   }

   pOutArgList->setPlugInArgValue("Noise removal Result", pResultCube.release());

   pStep->finalize();
   return true;
}
开发者ID:felipebetancur,项目名称:Astronomy-Image-Processing,代码行数:101,代码来源:WaveletKSigmaFilter.cpp

示例8: processAll


//.........这里部分代码省略.........

            DataAccessor daCurrentAccessor = pResults->getDataAccessor(currentRequest.release());

            lowestRequest->setWritable(true);
            failedDataRequestErrorMessage =
               SpectralUtilities::getFailedDataRequestErrorMessage(lowestRequest.get(), pLowestSAMValueMatrix);
            DataAccessor daLowestSAMValue = pLowestSAMValueMatrix->getDataAccessor(lowestRequest.release());
            if (!daLowestSAMValue.isValid())
            {
               string msg = "Unable to access data.";
               if (!failedDataRequestErrorMessage.empty())
               {
                  msg += "\n" + failedDataRequestErrorMessage;
               }

               progress.report(msg, 0, ERRORS, true);
               return false;
            }

            float* pPseudoValue = NULL;
            float* pCurrentValue = NULL;
            float* pLowestValue = NULL; 

            for (unsigned  int row_ctr = 0; row_ctr < numRows; row_ctr++)
            {
               for (unsigned  int col_ctr = 0; col_ctr < numColumns; col_ctr++)
               {
                  if (!daPseudoAccessor.isValid() || !daCurrentAccessor.isValid())
                  {
                     Service<ModelServices>()->destroyElement(pResults);
                     progress.report("Unable to access data.", 0, ERRORS, true);
                     return false;
                  }
                  daPseudoAccessor->toPixel(row_ctr, col_ctr);
                  daCurrentAccessor->toPixel(row_ctr, col_ctr);

                  pPseudoValue = reinterpret_cast<float*>(daPseudoAccessor->getColumn());
                  pCurrentValue = reinterpret_cast<float*>(daCurrentAccessor->getColumn());

                  daLowestSAMValue->toPixel(row_ctr, col_ctr);
                  pLowestValue = reinterpret_cast<float*>(daLowestSAMValue->getColumn());

                  if (*pCurrentValue <= mInputs.mThreshold)
                  {
                     if (*pCurrentValue < *pLowestValue)
                     {
                        *pPseudoValue = sig_index+1;
                        *pLowestValue = *pCurrentValue;
                     }
                  }
               }
            }
         }
         else
         {
            ColorType color;
            if (sig_index <= static_cast<int>(layerColors.size()))
            {
               color = layerColors[sig_index];
            }

            double dMaxValue = pResults->getStatistics()->getMax();

            // Displays results for current signature
            displayThresholdResults(pResults, color, LOWER, mInputs.mThreshold, dMaxValue, layerOffset);
         }
开发者ID:yuguess,项目名称:GSoC,代码行数:67,代码来源:Sam.cpp

示例9: execute


//.........这里部分代码省略.........
      }
      if (!pAcc.isValid())
      {
         std::string msg = "Unable to access the cube data.";
         pStep->finalize(Message::Failure, msg);
         if (pProgress != NULL)
         {
            pProgress->updateProgress(msg, 0, ERRORS);
         }

         return false;
      }

      if (pProgress != NULL)
      {
         pProgress->updateProgress("Calculating statistics", row * 100 / pDesc->getRowCount(), NORMAL);
      }
	  		
	  

      for (int col = 0; col < colSize; ++col)
      {
		  //p[col]=pAcc2->getColumnAsInteger();
		  
		  westCol=max(col-DEPTH1,zero);
		  northRow=max(row-DEPTH2,zero);
		  eastCol=min(colSize-1,col+DEPTH1);
		  southRow=min(rowSize-1,row+DEPTH2);
		  prevCol=max(col-DEPTH3,zero);
		  prevRow=max(row-DEPTH4,zero);
		  nextCol=min(col+DEPTH3,colSize-1);
		  nextRow=min(row+DEPTH4,rowSize-1);

			pAcc2->toPixel(northRow,westCol);
			
			for(int row1=northRow; row1 < southRow+1; ++row1)
			{
								
				for (int col1=westCol; col1 < eastCol+1; ++col1)
				{

					if((row1>=prevRow && row1<=nextRow) && (col1>=prevCol && col1<=nextCol))
					{
						continue;
					}

					else
					{	   
					 updateStatistics3(pAcc2->getColumnAsDouble(), total, total_sum, count);
					}


					pAcc2->nextColumn();

				}

				pAcc2->nextRow();
			}

			mean = total / count;
			std = sqrt(total_sum / count - mean * mean);
			int ELVI = (mean/std)*(mean/std);
			int v = (ELVI+1)/((ELVI*mean/(std*std))-1);

			pAcc2->toPixel(row,col);
			pDestAcc->toPixel(row,col);
开发者ID:pMav5,项目名称:Ship-Detection-Applet-for-Opticks,代码行数:67,代码来源:kdistribution.cpp

示例10: toPixel

 void toPixel(int x, int y) {
     dataAccessor->toPixel(y, x);
     if (!dataAccessor.isValid()) { qDebug("DataAccessor invalid after toPixel"); /* throw exception */ }
 }
开发者ID:SvenDeSmet,项目名称:ESTL-OX,代码行数:4,代码来源:QDialogConvolutionFFT.cpp


注:本文中的DataAccessor::toPixel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。