• 大小: 115KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-10
  • 语言: 其他
  • 标签: itk  cuda  

资源简介

在itk中调用cuda,实现加速,加速的效率真的不错哈

资源截图

代码片段和文件信息

/*=========================================================================

Program:   Insight Segmentation & Registration Toolkit
Module:    $RCSfile: DerivativeImageFilter.cxxv $
Language:  C++
Date:      $Date: 2005/08/31 13:55:21 $
Version:   $Revision: 1.23 $

Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

This software is distributed WITHOUT ANY WARRANTY; without even 
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif

#ifdef __BORLANDC__
#define ITK_LEAN_AND_MEAN
#endif

//  Software Guide : BeginCommandLineArgs
//    INPUTS:  {BrainProtonDensitySlice.png}
//    OUTPUTS: {DerivativeImageFilterFloatOutput.mhd}
//    OUTPUTS: {DerivativeImageFilterOutput.png}
//    1 0
//  Software Guide : EndCommandLineArgs

//  Software Guide : BeginLatex
//
//  The \doxygen{DerivativeImageFilter} is used for computing the partial
//  derivative of an image the derivative of an image along a particular axial
//  direction.
//
//  \index{itk::DerivativeImageFilter}
//
//  Software Guide : EndLatex 

#include 
#include 
#include “itkImage.h“
#include “itkImageFileReader.h“
#include “itkImageFileWriter.h“
#include “itkImageRegionIterator.h“
#include “itkImageRegionConstIteratorWithIndex.h“
#include “itkRescaleIntensityImageFilter.h“

typedef float pixeltype; // unsigned char
typedef itk::Image ItkImageType;
typedef ItkImageType::Pointer ItkImagePointer;

//  Software Guide : BeginLatex
//
//  The header file corresponding to this filter should be included first.
//
//  \index{itk::DerivativeImageFilter!header}
//
//  Software Guide : EndLatex 


// Software Guide : BeginCodeSnippet
#include “itkDerivativeImageFilter.h“
// Software Guide : EndCodeSnippet

//
// MODE_SELFTEST : run filter on various size datasets and calculate timing
// MODE_INPUT    : run filters on the input image/volume
//
#define  MODE_SELFTEST //MODE_INPUT //


using namespace itk;

int main( int argc char * argv[] )
{

putenv(“ITK_CUDA_TIME=1“);

#ifdef MODE_INPUT

/*
if( argc < 6 )
{
std::cerr << “Usage: “ << std::endl;
std::cerr << argv[0] << “  inputImageFile   outputImageFile  normalizedOutputImageFile “;
std::cerr << “ derivativeOrder direction“ << std::endl;
return EXIT_FAILURE;
}
*/

putenv(“ITK_CUDA_TIME=1“);
//putenv(“ITK_CUDA=1“);

argv[1] = “C:/Work/proj/InsightToolkit-3.2.0/Examples/Data/BrainProtonDensitySlice.png“;
argv[2] = “DerivativeImageFilterFloatOutput.mhd“;
argv[3] = “DerivativeImageFilterOutput.png“;
argv[4] = “1“;
argv[5] = “1“; // direction


//  Software Guide : BeginLatex
//
//  Next the pixel

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2532  2009-05-29 17:40  CUDA_ITK_RELEASE\CUDA_ITK_TEST\CMakeLists.txt

     文件      11027  2009-05-29 17:40  CUDA_ITK_RELEASE\CUDA_ITK_TEST\test_DerivativeImageFilter.cpp

     文件       8520  2009-05-29 17:40  CUDA_ITK_RELEASE\CUDA_ITK_TEST\test_DiscreteGaussianImageFilter.cpp

     文件       7839  2009-05-30 17:25  CUDA_ITK_RELEASE\CUDA_ITK_TEST\test_HessianRecursiveGaussianImageFilter.cpp

     文件      13123  2009-06-05 15:38  CUDA_ITK_RELEASE\CUDA_ITK_TEST\test_MeanMedianImageFilter.cpp

     文件        928  2009-05-29 17:40  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\CMakeLists.txt

     文件       6179  2009-05-29 17:40  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\ibiaAtlasImageCreatorFilter.h

     文件       5349  2009-04-24 17:15  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\ibiaAtlasImageCreatorFilter.h.bak

     文件       4713  2009-06-15 16:28  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\ibiaAtlasImageCreatorFilter.txx

     文件       4628  2009-04-24 17:16  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\ibiaAtlasImageCreatorFilter.txx.bak

     文件      10396  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkAnisotropicDiffusionFunction.h

     文件       7239  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkAnisotropicDiffusionImageFilter.h

     文件       5022  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkAnisotropicDiffusionImageFilter.txx

     文件       5470  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkDerivativeImageFilter.h

     文件       6648  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkDerivativeImageFilter.txx

     文件       9115  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkDiscreteGaussianImageFilter.h

     文件      13229  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkDiscreteGaussianImageFilter.txx

     文件       3709  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkGradientAnisotropicDiffusionImageFilter.h

     文件       5396  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkGradientNDAnisotropicDiffusionFunction.h

     文件       7914  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkHessianRecursiveGaussianImageFilter.h

     文件      10958  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkHessianRecursiveGaussianImageFilter.txx

     文件       5200  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkMeanImageFilter.h

     文件       6256  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkMeanImageFilter.txx

     文件       6793  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkMedianImageFilter.txx

     文件       7777  2009-05-29 17:40  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkNeighborhoodOperatorImageFilter.h

     文件       6025  2009-05-29 17:40  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkNeighborhoodOperatorImageFilter.txx

     文件       5092  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\BasicFilters\itkScalarAnisotropicDiffusionFunction.txx

     文件        337  2009-05-29 17:40  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\CMakeLists.txt

     文件       5753  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\Common\CMakeLists.txt

     文件      10564  2009-05-08 17:52  CUDA_ITK_RELEASE\InsightToolkit-3.12.0\Code\Common\itkDataobject.cxx

............此处省略28个文件信息

评论

共有 条评论