本家様 https://github.com/aniketkt/TomoTwin

本家様より

TomoTwin is a simple digital twin for synchrotron tomography that provides an API to generate realistic grayscale 
tomography datasets from ground-truth (labeled) volumes as training data for denoising and segmentation models. 
The grayscale data mimics imaging artifacts such as noise and in-line phase contrast with a dependence on the instrument 
parameters such as detector configuration and beam energy.

とある.
以下DeepL様翻訳(https://www.deepl.com/ja/translator)

TomoTwinは放射光トモグラフィーのためのシンプルなデジタルツインで、ノイズ除去およびセグメンテーションモデルの
トレーニングデータとして、グラウンドトゥルース(ラベル付き)ボリュームからリアルな
グレースケールトモグラフィーデータセットを生成するためのAPIを提供します。
グレースケール・データは、ノイズやインライン位相コントラストなどの画像アーチファクトを模倣し、
検出器構成やビームエネルギーなどの装置パラメータに依存しています。

インストール

gitで提供されていて、そこに「install.sh」ファイルがある. 中身は

conda create --name tomoenv python=3.7
 
conda activate tomoenv
conda install -c conda-forge tomopy
 
pip install .

とあるのでtopazcrYOLOのように pyenv/anaconda3(or miniconda3) で作ったconda環境で作ればいいみたい

(pyenv/anaconda3環境が用意されていないなら)
git clone https://github.com/yyuu/pyenv.git /apps/pyenv
export PYENV_ROOT=/apps/pyenv
export PATH=$PYENV_ROOT/bin:$PATH
pyenv install anaconda3-2022.10
pyenv global  anaconda3-2022.10
export PATH=$PYENV_ROOT/versions/anaconda3-2022.10/bin/:$PATH
 
(既にpyenv/anaconda3環境があるなら)
export PYENV_ROOT=/apps/pyenv
export PATH=$PYENV_ROOT/bin:$PATH
export PATH=$PYENV_ROOT/versions/anaconda3-2022.10/bin/:$PATH

と環境を整えて

[root@centos7 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
 
[root@centos7 ~]# cd /apps
[root@centos7 apps]# git clone https://github.com/aniketkt/TomoTwin
[root@centos7 apps]# cd TomoTwin
 
[root@centos7 TomoTwin]# conda create --name tomoenv python=3.7 -y
[root@centos7 TomoTwin]# source activate tomoenv
 
(tomoenv) [root@centos7 TomoTwin]# 
(tomoenv) [root@centos7 TomoTwin]# conda install -c conda-forge tomopy
 
(tomoenv) [root@centos7 TomoTwin]# which pip
/apps/pyenv/versions/anaconda3-2022.10/envs/tomoenv/bin/pip
 
(tomoenv) [root@centos7 TomoTwin]# pip install .
 
(tomoenv) [root@centos7 TomoTwin]# conda deactivate
[root@centos7 TomoTwin]#
 
[root@centos7 TomoTwin]# chmod +x tomo_twin/gt_generators.py
[root@centos7 TomoTwin]# chmod +x tomo_twin/recon.py

CentOS7でのpyenv/anaconda3環境はちょいとAnacondaのようにconda,conda-envを修正しないとsource activateで出来ないみたい

memo

なんかこんな感じがするが、、

--- TomoTwin/tomo_twin/pg_filter.py.orig        2023-02-09 02:01:28.332859533 +0900
+++ TomoTwin/tomo_twin/pg_filter.py     2023-02-09 02:01:34.676913143 +0900
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 """
 This code is adapted from Tomopy's phase-retrieval module. The code inverts the Paganin filter to synthesize phase-contrast with a high-pass filter.

EnvironmentModules

[root@centos7 ~]# vi /apps/modulefiles/TomoTwin
#%Module
 
set          root /apps/pyenv/versions/anaconda3-2022.10/envs/tomoenv 
prepend-path PATH $root/bin:/apps/TomoTwin/tomo_twin
 
[root@centos7 ~]#

トップ   編集 添付 複製 名前変更     ヘルプ   最終更新のRSS
Last-modified: 2023-02-09 (木) 02:03:59 (121d)