ANTS安装(Ubuntu20.04)

1.检查gcc和cmake,若无则要安装

sudo apt-get install cmake-curses-gui

2.安装ITK,官网下载安装包

3.安装ZLIB

sudo apt-get install zlib1g-dev

4.安装ANTS

workingDir=${PWD}
git clone https://github.com/ANTsX/ANTs.git
mkdir build install
cd build
cmake \
    -DCMAKE_INSTALL_PREFIX=${workingDir}/install \
    ../ANTs 2>&1 | tee cmake.log
make -j 4 2>&1 | tee build.log
cd ANTS-build
make install 2>&1 | tee install.log

Compiling ANTs on Linux and Mac OS · ANTsX/ANTs Wiki · GitHub
医学图像配准软件 ANTs(Advanced Normalization Tools)的安装和使用说明 - 灰信网(软件开发博客聚合)

5.验证

antsRegistrationSyN.sh

6.使用

antsRegistrationSyN.sh -d 3 -f mri.nii.gz -m pet.nii.gz -t 'r' -o output

大约2-3分钟

脚本批量处理

#!/usr/bin/bash

mri_path=/home/hannah/data/PETMR/HENAN/brain_mri/
pet_path=/home/hannah/data/PETMR/HENAN/raw_pet_nii
out_path=/home/hannah/data/PETMR/HENAN/pet/
declare -i num=0
#brain=/mri/brain.mgz
#mri=/mri/T1.mgz

for pet_file in $pet_path/*

  do
    num=num+1
    #let num=${num}+1
    mri_file=${mri_path}"brain_"$num".nii.gz"
    out_file=${out_path}$num
    #echo ${pet_file}, ${mri_file}, ${out_file}
    antsRegistrationSyN.sh -d 3 -f ${mri_file} -m ${pet_file} -t 'r' -o ${out_file}
    
  done
  
echo $num

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值