私は主にデジタル顕微鏡 (DM) スクリプトを使用して電子顕微鏡画像処理に取り組んでおり、最近では、Python の幅広い汎用性、豊富なオープン ライブラリ、およびクロスプラットフォーム機能のために Python を学び始めています。
DMのi変数に似た2D(画像)または3D(スペクトル画像)配列にインデックスを付けるためのPython(numpy)に同様のツールがあるかどうかは誰にもわかりませんか?
i 変数は、DM スクリプトに関するこのチュートリアルの 11 ページで簡単に紹介されています 。 pdf
これらは、画像のような 2D または 3D オブジェクトにインデックスを付ける簡単な方法であり、マスク関数の生成などの画像処理に非常に便利です。
たとえば、次の DM スクリプト
image t1 := RealImage ("test1", 4, 5, 5)
image t2 := RealImage ("test2", 4, 5, 5)
image t3 := RealImage ("test3", 4, 5, 5)
t1 = irow   
// the value in each pixel equals to the row index
t2 = iradius  
// the value in each pixel equals to the radius 
// (i.e., distance to the center pixel)
t3 = itheta  
// the value in each pixel quals to the angle (radian)
// to the center pixel (i.e., angle in polar representation) 
t1.showimage(); t2.showimage(); t3.showimage()
次の画像が得られます(ここではスプレッドシートで表されているか、マトリックス形式と言います):
t1 = 
0   0   0   0   0
1   1   1   1   1
2   2   2   2   2
3   3   3   3   3
4   4   4   4   4
t2=
3.5355339   2.9154758   2.5495098   2.5495098   2.9154758
2.9154758   2.1213202   1.5811388   1.5811388   2.1213202
2.5495098   1.5811388   0.70710677  0.70710677  1.5811388
2.5495098   1.5811388   0.70710677  0.70710677  1.5811388
2.9154758   2.1213202   1.5811388   1.5811388   2.1213202
t3=
-2.3561945  -2.1112158  -1.7681919  -1.3734008  -1.0303768
-2.6011732  -2.3561945  -1.8925469  -1.2490457  -0.78539819
-2.9441972  -2.8198421  -2.3561945  -0.78539819 -0.32175055
2.9441972   2.8198421   2.3561945   0.78539819  0.32175055
2.6011732   2.3561945   1.8925469   1.2490457   0.78539819