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


C++ ImageList::size方法代码示例

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


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

示例1: HandleGetMetadata

/*!
 \brief Gets meta data for an image
 \details Reads exif tags from a picture or FFMPEG video tags
 \param id Image id
 \return QStringList Error message or "OK", seperator,
list of <tag name><seperator><tag value>.
Clients must use the embedded seperator to extract the data.
*/
QStringList ImageHandler::HandleGetMetadata(QString id)
{
    // Find image in DB
    ImageDbWriter db;
    ImageList images;
    db.ReadDbFilesById(images, id);

    // Either single id not found or multiple comma-delimited ids received
    if (images.size() != 1)
    {
        LOG(VB_FILE, LOG_NOTICE,
            QString("Image: Image %1 not found in Db").arg(id));
        qDeleteAll(images);
        return QStringList("ERROR") << "Unknown File";
    }

    // Read all metadata tags
    ImageMetaData::TagMap tags;
    QStringList result;

    if (ImageMetaData::GetMetaData(images[0], tags))
    {
        // Each property is described by a pair of <tagvalue> : <taglabel>
        // Combine label/value using a (hopefully unique) delimiter
        // to return 1 string per property.
        const QString seperator = ":|-|:";
        result << "OK" << seperator;

        foreach (const ImageMetaData::TagPair value, tags)
        {
            result.append(QString("%1%2%3")
                          .arg(value.second).arg(seperator).arg(value.first));
        }
    }
开发者ID:jshattoc,项目名称:mythtv,代码行数:42,代码来源:imagehandlers.cpp

示例2: createBaseTexture

  void SplattingManager::createBaseTexture(Image& image, size_t width, size_t height,
    ImageList textures, float repeatX, float repeatZ)
  {
    if (textures.size() > mImpl->numTextures)
      OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Given more textures than texture channels available.", "ET::SplattingManager::createBaseTexture");

    // first resize the textures according to the desired output size and the repeat values
    ushort scaleWidth = (ushort) (width / repeatX);
    ushort scaleHeight = (ushort) (height / repeatZ);
    for (ImageList::iterator it = textures.begin(); it != textures.end(); ++it)
      it->resize(scaleWidth, scaleHeight);

    // create the buffer to hold our generated base texture
#if OGRE_VERSION_MINOR > 4
    uchar* data = OGRE_ALLOC_T(uchar, width*height*3, MEMCATEGORY_GENERAL);
#else
    uchar* data = new uchar[width*height*3];
#endif
    size_t pos = 0;
    for (size_t y = 0; y < height; ++y)
    {
      for (size_t x = 0; x < width; ++x)
      {
        ColourValue val (0,0,0);
        int texX = (int) (x % scaleWidth);
        int texY = (int) (y % scaleHeight);
        for (size_t t = 0; t < textures.size(); ++t)
        {
          // get interpolated part of this texture at the current pixel
          float weight = mImpl->interpolateWeight(x, y, width, height, t);
          // get colour value of the texture image
          ColourValue col = textures[t].getColourAt(texX, texY, 0);
          // add to the pixel colour level
          val += weight*col;
        }

        // write colour to our buffer
        data[pos+0] = uchar(255*val.r);
        data[pos+1] = uchar(255*val.g);
        data[pos+2] = uchar(255*val.b);
        pos += 3;
      }
    }

    image.loadDynamicImage(data, width, height, 1, PF_BYTE_RGB, true);
  }
开发者ID:hjqqq,项目名称:Forever,代码行数:46,代码来源:ETSplattingManager.cpp

示例3: applyTransform

// ------------------------------------------------------------------------
void applyTransform(const ImageList &inputImages,
	   	const SeriesTransform &transform,
	   	ImageList &transformedImages)
{
	// loop through the images
	for(unsigned int i = 0; i < inputImages.size(); i++)
	{
		ImageType::Pointer inputImage = inputImages[i];


	}

}
开发者ID:zhuangfangwang,项目名称:PhDProject,代码行数:14,代码来源:functions.cpp

示例4: main

int main( int argc, char* argv[] )
{
  // Parse Command-Line Arguments
  mitkCommandLineParser parser;
  parser.setArgumentPrefix("--","-");

  parser.setTitle("Tumor Progression Mapping");
  parser.setCategory("Preprocessing Tools");
  parser.setContributor("MBI");
  parser.setDescription("Convert a set of co-registered and resampled follow-up images into a 2D png overview (and optionally in a 4D NRRD Volume).\nNaming convecntion of files is IDENTIFIER_YYYY-MM-DD_MODALITY.nrrd");

  parser.setArgumentPrefix("--","-");
  parser.addArgument("input", "i", mitkCommandLineParser::InputDirectory, "Input folder containing all follow ups");
  parser.addArgument("output", "o", mitkCommandLineParser::OutputFile,"Output file (PNG)");
  parser.addArgument("blanked", "b", mitkCommandLineParser::Bool, "Only Display Morphology");
  parser.addArgument("morphology", "m", mitkCommandLineParser::String, "Morphology postfix.", "_T2.nrrd");
  parser.addArgument("segmentation", "s", mitkCommandLineParser::String,  "Segmentation postfix. Default: _GTV.nrrd", "_GTV.nrrd");
  parser.addArgument("4dVolume", "v", mitkCommandLineParser::OutputFile, "Filepath to merged 4d NRRD Volume.");
  parser.addArgument("skip", "k", mitkCommandLineParser::Int, "Number of slices to be skipped from top and from button (Default 0)");
  parser.addArgument("interval", "n", mitkCommandLineParser::Int, "1 - for all slices, 2 - every second, 3 - every third ...");
  parser.addArgument("opacity", "c", mitkCommandLineParser::Float, "Opacity of overlay [0,1] invisible -> visible");

  map<string, us::Any> parsedArgs = parser.parseArguments(argc, argv);

  if ( parsedArgs.size()==0 )
    return EXIT_SUCCESS;

  // Show a help message
  if (parsedArgs.count("help") || parsedArgs.count("h"))
  {
    std::cout << parser.helpText();
    return EXIT_SUCCESS;
  }

  std::string outputFile;
  std::string inputFolder;

  if (parsedArgs.count("input") || parsedArgs.count("i") )
  {
    inputFolder =  us::any_cast<string> (parsedArgs["input"]) + "/";
  }

  if (parsedArgs.count("output") || parsedArgs.count("o") )
  {
    outputFile =  us::any_cast<string> (parsedArgs["output"]);
  }

  int skip = 0;
  int interval = 1;
  float opacity = .3;


  if (parsedArgs.count("skip") || parsedArgs.count("k") )
  {
    skip = us::any_cast<int>(parsedArgs["skip"]);
  }

  if (parsedArgs.count("interval") || parsedArgs.count("n") )
  {
    interval = us::any_cast<int>(parsedArgs["interval"]);
  }

  if (parsedArgs.count("opacity") || parsedArgs.count("c") )
  {
    opacity = us::any_cast<float>(parsedArgs["opacity"]);
  }

  FileList morphFiles;
  FileList segFiles;

  std::string refPattern;
  std::string segPattern;

  if (parsedArgs.count("morphology") || parsedArgs.count("m") )
  {
    refPattern = us::any_cast<std::string>(parsedArgs["morphology"]);
  }
  else
    return EXIT_FAILURE;

  if (parsedArgs.count("segmentation") || parsedArgs.count("s") )
  {

    segPattern = us::any_cast<std::string>(parsedArgs["segmentation"]);

  }

  bool blank = false;
  if (parsedArgs.count("blanked") || parsedArgs.count("b"))
  {
    blank = true;
  }
  /// END Parsing CL Options
  typedef itk::Image<RGBPixelType, 2> OutputImageType;
  typedef itk::Image<RGBPixelType, 3> InputImageType;

  mitkProgressionVisualization progressVis;

  morphFiles = CreateFileList(inputFolder,refPattern);
  segFiles = CreateFileList(inputFolder,segPattern);
//.........这里部分代码省略.........
开发者ID:151706061,项目名称:MITK,代码行数:101,代码来源:TumorProgressionMapping.cpp


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