#ifndef __RCPPANTSR_H
#define __RCPPANTSR_H
#include "itkMacro.h"
#include "itkImage.h"
#include "itkVectorImage.h"
#include "itkVector.h"
#include "itkImageRegionIteratorWithIndex.h"
#include "vnl/vnl_vector_ref.h"
#include "itkTransform.h"
#include "itkAffineTransform.h"
#include <RcppCommon.h>
// From advice @ http://dirk.eddelbuettel.com/code/rcpp/Rcpp-extending.pdf
inline SEXP exception_to_r_condition( const itk::ExceptionObject & ex )
{
//std::string ex_class = demangle( typeid(ex).name() ) ;
std::string ex_msg = ex.what() ;
std::string ex_class = "ITK";
Rcpp::Shield<SEXP> cppstack( rcpp_get_stack_trace() );
Rcpp::Shield<SEXP> call( get_last_call() );
Rcpp::Shield<SEXP> classes( get_exception_classes(ex_class) );
Rcpp::Shield<SEXP> condition( make_condition( ex_msg, call, cppstack, classes) );
rcpp_set_stack_trace( R_NilValue ) ;
return condition ;
}
inline void forward_exception_to_r( const itk::ExceptionObject & ex )
{
SEXP stop_sym = Rf_install( "stop" ) ;
Rcpp::Shield<SEXP> condition( exception_to_r_condition(ex) );
Rcpp::Shield<SEXP> expr( Rf_lang2( stop_sym , condition ) ) ;
Rf_eval( expr, R_GlobalEnv ) ;
}
namespace Rcpp {
// These are used to get header info only for both itk::Image and itk::VectorImage
template <> inline itk::ImageBase<2>::Pointer as( SEXP itkImageR );
template <> inline itk::ImageBase<3>::Pointer as( SEXP itkImageR );
template <> inline itk::ImageBase<4>::Pointer as( SEXP itkImageR );
// itk::Image to antsImage
#include <RcppANTsR/RcppANTsR_ImageBaseDef.h>
#include <RcppANTsR/RcppANTsR_ImageDef.h>
#include <RcppANTsR/RcppANTsR_VectorImageDef.h>
#include <RcppANTsR/RcppANTsR_ImageIteratorDef.h>
#include <RcppANTsR/RcppANTsR_TransformDef.h>
/*
template <> inline SEXP wrap( const itk::Image<double,2>::Pointer &image );
template <> inline SEXP wrap( const itk::Image<double,3>::Pointer &image );
template <> inline SEXP wrap( const itk::Image<double,4>::Pointer &image );
template <> inline SEXP wrap( const itk::Image<float,2>::Pointer &image );
template <> inline SEXP wrap( const itk::Image<float,3>::Pointer &image );
template <> inline SEXP wrap( const itk::Image<float,4>::Pointer &image );
template <> inline SEXP wrap( const itk::Image<unsigned int,2>::Pointer &image );
template <> inline SEXP wrap( const itk::Image<unsigned int,3>::Pointer &image );
template <> inline SEXP wrap( const itk::Image<unsigned int,4>::Pointer &image );
template <> inline SEXP wrap( const itk::Image<unsigned char,2>::Pointer &image );
template <> inline SEXP wrap( const itk::Image<unsigned char,3>::Pointer &image );
template <> inline SEXP wrap( const itk::Image<unsigned char,4>::Pointer &image );
// antsImage to itk::Image
template <> inline itk::Image<double,2>::Pointer as( SEXP itkImageR );
template <> inline itk::Image<double,3>::Pointer as( SEXP itkImageR );
template <> inline itk::Image<double,4>::Pointer as( SEXP itkImageR );
template <> inline itk::Image<float,2>::Pointer as( SEXP itkImageR );
template <> inline itk::Image<float,3>::Pointer as( SEXP itkImageR );
template <> inline itk::Image<float,4>::Pointer as( SEXP itkImageR );
template <> inline itk::Image<unsigned int,2>::Pointer as( SEXP itkImageR );
template <> inline itk::Image<unsigned int,3>::Pointer as( SEXP itkImageR );
template <> inline itk::Image<unsigned int,4>::Pointer as( SEXP itkImageR );
template <> inline itk::Image<unsigned char,2>::Pointer as( SEXP itkImageR );
template <> inline itk::Image<unsigned char,3>::Pointer as( SEXP itkImageR );
template <> inline itk::Image<unsigned char,4>::Pointer as( SEXP itkImageR );
*/
// itk::VectorImage to antsImage
template <> inline SEXP wrap( const itk::VectorImage<double,2>::Pointer &image );
template <> inline SEXP wrap( const itk::VectorImage<double,3>::Pointer &image );
template <> inline SEXP wrap( const itk::VectorImage<double,4>::Pointer &image );
template <> inline SEXP wrap( const itk::VectorImage<float,2>::Pointer &image );
template <> inline SEXP wrap( const itk::VectorImage<float,3>::Pointer &image );
template <> inline SEXP wrap( const itk::VectorImage<float,4>::Pointer &image );
template <> inline SEXP wrap( const itk::VectorImage<unsigned int,2>::Pointer &image );
template <> inline SEXP wrap( const itk::VectorImage<unsigned int,3>::Pointer &image );
template <> inline SEXP wrap( const itk::VectorImage<unsigned int,4>::Pointer &image );
template <> inline SEXP wrap( const itk::VectorImage<unsigned char,2>::Pointer &image );
template <> inline SEXP wrap( const itk::VectorImage<unsigned char,3>::Pointer &image );
template <> inline SEXP wrap( const itk::VectorImage<unsigned char,4>::Pointer &image );
// antsImage to itk::VectorImage
template <> inline itk::VectorImage<double,2>::Pointer as( SEXP itkImageR );
template <> inline itk::VectorImage<double,3>::Pointer as( SEXP itkImageR );
template <> inline itk::VectorImage<double,4>::Pointer as( SEXP itkImageR );
template <> inline itk::VectorImage<float,2>::Pointer as( SEXP itkImageR );
template <> inline itk::VectorImage<float,3>::Pointer as( SEXP itkImageR );
template <> inline itk::VectorImage<float,4>::Pointer as( SEXP itkImageR );
template <> inline itk::VectorImage<unsigned char,2>::Pointer as( SEXP itkImageR );
template <> inline itk::VectorImage<unsigned char,3>::Pointer as( SEXP itkImageR );
template <> inline itk::VectorImage<unsigned char,4>::Pointer as( SEXP itkImageR );
template <> inline itk::VectorImage<unsigned int,2>::Pointer as( SEXP itkImageR );
template <> inline itk::VectorImage<unsigned int,3>::Pointer as( SEXP itkImageR );
template <> inline itk::VectorImage<unsigned int,4>::Pointer as( SEXP itkImageR );
// itkIterator to antsrImageIterator
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<double,2> > & iterator );
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<double,3> > & iterator );
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<double,4> > & iterator );
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<float,2> > & iterator );
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<float,3> > & iterator );
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<float,4> > & iterator );
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<unsigned int,2> > & iterator );
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<unsigned int,3> > & iterator );
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<unsigned int,4> > & iterator );
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<unsigned char,2> > & iterator );
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<unsigned char,3> > & iterator );
template <> inline SEXP wrap( const itk::ImageRegionIteratorWithIndex< itk::Image<unsigned char,4> > & iterator );
// antsrImageIterator to itkIterator
template <> inline itk::ImageRegionIteratorWithIndex< itk::Image<double,2> > as( SEXP itkImageIteratorR );
template <> inline itk::ImageRegionIteratorWithIndex< itk::Image<double,3> > as( SEXP itkImageIteratorR );
template <> inline itk::ImageRegionIteratorWithIndex< itk::Image<double,4> > as( SEXP itkImageIteratorR );
template <> inline itk::ImageRegionIteratorWithIndex< itk::Image<float,2> > as( SEXP itkImageIteratorR );
template <> inline itk::ImageRegionIteratorWithIndex< itk::Image<float,3> > as( SEXP itkImageIteratorR );
template <> inline itk::ImageRegionIteratorWithIndex< itk::Image<float,4> > as( SEXP itkImageIteratorR );
template <> inline itk::ImageRegionIteratorWithIndex< itk::Image<unsigned int,2> > as( SEXP itkImageIteratorR );
template <> inline itk::ImageRegionIteratorWithIndex< itk::Image<unsigned int,3> > as( SEXP itkImageIteratorR );
template <> inline itk::ImageRegionIteratorWithIndex< i
没有合适的资源?快使用搜索试试~ 我知道了~
ANTSR 用于安装lesymap
需积分: 5 1 下载量 148 浏览量
2022-11-16
20:34:59
上传
评论
收藏 39.04MB GZ 举报
温馨提示
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共55个文件
h:12个
rds:12个
html:10个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
ANTSR 用于安装lesymap
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![csv](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![py](https://img-home.csdnimg.cn/images/20210720083646.png)
![py](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![csv](https://img-home.csdnimg.cn/images/20210720083646.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 55 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
儿科医生100
- 粉丝: 2
- 资源: 3
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)