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


C++ Pointer::GetPointer方法代码示例

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


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

示例1: main

int main()
{
  FloatVectorImageType::Pointer image = FloatVectorImageType::New();
  Testing::GetBlankImage(image.GetPointer(), 4);

  Mask::Pointer mask = Mask::New();
  Testing::GetFullyValidMask(mask.GetPointer());

  UnsignedCharScalarImageType::Pointer manualPriorityImage = UnsignedCharScalarImageType::New();
  Testing::GetBlankImage(manualPriorityImage.GetPointer());

  unsigned int patchRadius = 5;
  typedef PriorityConfidence ConfidencePriorityType;
  ConfidencePriorityType priorityConfidence(mask, patchRadius);
  
  PriorityManual<itk::Index<2>, UnsignedCharScalarImageType, ConfidencePriorityType>
      priority(manualPriorityImage, &priorityConfidence);

  itk::Index<2> filledPixel = {{0,0}};
  priority.Update(filledPixel);
  priority.SetManualPriorityImage(manualPriorityImage);

  itk::Index<2> queryPixel = {{0,0}};
  priority.ComputePriority(queryPixel);

  return EXIT_SUCCESS;
}
开发者ID:SXYJerry,项目名称:PatchBasedInpainting,代码行数:27,代码来源:TestPriorityManual.cpp

示例2: main

int main()
{
  FloatVectorImageType::Pointer image = FloatVectorImageType::New();
  Testing::GetBlankImage(image.GetPointer(), 4);

  Mask::Pointer mask = Mask::New();
  Testing::GetFullyValidMask(mask.GetPointer());

  unsigned int patchRadius = 5;
  PriorityCriminisi<itk::Index<2>, FloatVectorImageType> priority(image.GetPointer(), mask.GetPointer(), patchRadius);

  itk::Index<2> filledPixel;
  filledPixel.Fill(0);
  priority.Update(filledPixel);

  itk::Index<2> queryPixel = {{0,0}};
  priority.ComputePriority(queryPixel);

  return EXIT_SUCCESS;
}
开发者ID:nocnokneo,项目名称:PatchBasedInpainting,代码行数:20,代码来源:TestPriorityCriminisi.cpp

示例3: main

int main(int argc, char *argv[])
{
  if(argc < 3)
  {
    throw std::runtime_error("Required arguments: inputFileName outputPrefix");
  }

  std::string inputFileName = argv[1];
  std::string outputPrefix = argv[2];

  std::cout << "Input: " << inputFileName << std::endl;
  std::cout << "Output prefix: " << outputPrefix << std::endl;

  typedef itk::ImageFileReader<FloatVectorImageType> ReaderType;
  ReaderType::Pointer reader = ReaderType::New();
  reader->SetFileName(inputFileName);
  reader->Update();

  ITKHelpers::WriteVectorImageAsRGB(reader->GetOutput(), outputPrefix + "/Image.mha");

  WriteImagePixelsToRGBSpace(reader->GetOutput(), outputPrefix + "/ImageColors.vtp");

  WriteClusteredPixelsInRGBSpace(reader->GetOutput(), 20, outputPrefix + "/ImageColorsClustered.vtp");

  FloatVectorImageType::Pointer blurred = FloatVectorImageType::New();
  //float blurVariance = 2.0f; // almost no visible blurring
  //float blurVariance = 10.0f; // slight blurring of concrete
  //float blurVariance = 30.0f;

  // TODO: Update this call to the new API
  //Helpers::AnisotropicBlurAllChannels<FloatVectorImageType>(reader->GetOutput(), blurred, blurVariance);

  ITKHelpers::WriteVectorImageAsRGB(blurred.GetPointer(), outputPrefix + "/BlurredImage.mha");

  WriteImagePixelsToRGBSpace(blurred, outputPrefix + "/BlurredImageColors.vtp");

  WriteClusteredPixelsInRGBSpace(blurred, 20, outputPrefix + "/BlurredImageColorsClustered.vtp");

  return EXIT_SUCCESS;
}
开发者ID:SXYJerry,项目名称:PatchBasedInpainting,代码行数:40,代码来源:DemoClusterColors.cpp

示例4: TestHasBracketOperator

bool TestHasBracketOperator()
{
  {
  typedef itk::CovariantVector<int, 3> IntVectorType;

  static_assert(Helpers::HasBracketOperator<IntVectorType>::value,
              "TestHasBracketOperator for CovariantVector<int, 3> failed!");
  }

  {
  typedef itk::CovariantVector<unsigned char, 3> UCharVectorType;

  static_assert(Helpers::HasBracketOperator<UCharVectorType>::value,
              "TestHasBracketOperator for CovariantVector<unsigned char, 3> failed!");
  }

  {
  typedef itk::CovariantVector<float, 3> FloatVectorType;

  static_assert(Helpers::HasBracketOperator<FloatVectorType>::value,
              "TestHasBracketOperator for CovariantVector<float, 3> failed!");
  }

  {
  typedef itk::Image<itk::CovariantVector<float, 3>, 2> FloatVectorImageType;

  static_assert(Helpers::HasBracketOperator<FloatVectorImageType::PixelType>::value,
              "TestHasBracketOperator for CovariantVector<float, 3> failed!");
  }

  {
  typedef itk::Image<itk::CovariantVector<float, 3>, 2> FloatVectorImageType;
  FloatVectorImageType::Pointer image = FloatVectorImageType::New();

  TestHasBracketOperator_Template(image.GetPointer());
  }

  {
  typedef itk::Image<itk::CovariantVector<float, 3>, 2> FloatVectorImageType;
  itk::SmartPointer<FloatVectorImageType> image = FloatVectorImageType::New();

  TestHasBracketOperator_Template(image.GetPointer());
  TestHasBracketOperator_ConstTemplate(image.GetPointer());
  }

  {
  typedef itk::Image<itk::CovariantVector<float, 3>, 2> FloatVectorImageType;

  TestHasBracketOperator_Template2<FloatVectorImageType>();
  }

  {
  typedef itk::VariableLengthVector<int> VectorType;

  static_assert(Helpers::HasBracketOperator<VectorType>::value,
              "TestHasBracketOperator for VariableLengthVector failed!");
  }

  {
  typedef std::vector<int> VectorType;

  static_assert(Helpers::HasBracketOperator<VectorType>::value,
              "TestHasBracketOperator for std::vector failed!");
  }

  // This (intentionally) fails
//  {
//  static_assert(Helpers::HasBracketOperator<float>::value,
//              "TestHasBracketOperator for float failed!");
//  }

  return true;
}
开发者ID:daviddoria,项目名称:ITKHelpers,代码行数:73,代码来源:TestITKHelpers.cpp


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