1

私は Windows 8 を使用しており、研究のために画像分析を行っています。「calculate_distances.py」と呼ばれるこの python スクリプト (私は書いていません) を実行する必要があります。また、CellTool ( http://pantheon.yale.edu/~zp2/Celltool/ ) と Numpy も使用しています。これらは正常にインストールされています。

calculate_distances スクリプトを実行しようとすると、次のエラーが発生します。

Traceback (most recent call last):
file "calculate_distances.py" line 4, in <module>
import celltool.simple_interface as si
ImportError: No module named celltool.simple_interface

これが私の calculate_distances.py スクリプトです:

#!/Library/Frameworks/Python.framework/Versions/2.5/bin/python
# Import various celltool modules

import celltool.simple_interface as si
import celltool.contour.contour_class as contour_class
from celltool.utility.path import path
import celltool.utility.datafile as datafile
import numpy

# Designate your working directory - ie, replace '/parent_directory/' with the path that contains your contour files
#parent_dir=path('/parent_directory/')
parent_dir=path('./')

# Identify and load  all of the contour files
contour_files=parent_dir.files('*.contour')
contours=si.load_contours(contour_files)
all_distances=numpy.arange(len(contours[0].points))

# Calculate the normal displacement of the cell boundary at every contour point.
n=1
while n<len(contours):
contour_class.Contour.global_reorder_points(contours[n],contours[n-1])
displacement_vectors = contours[n-1].points - contours[n].points
normals = contours[n-1].inward_normals()
distances  = (normals * displacement_vectors).sum(axis=1)
all_distances=numpy.vstack((all_distances,distances))
n=n+1

# Save a csv file with the normal displacement of the boundary at each contour point (columns) at each time point (rows)
datafile.write_data_file(all_distances,parent_dir/'distances.csv')

初めてのプログラマーなので、エラーの意味がわかりません。最初に C++/fortran コンパイラをインストールする必要があると思ったので、Simple Fortran をインストールしましたが、それでも動作しません。(GNU fortran をインストールした後) Mac システムではすべて正常に動作しますが、何らかの理由で Wi​​ndows では動作しません。CellTool が正しい場所にインストールされていないためですか? それともスクリプトの何かですか?

何か案は?どうもありがとうございました!!

4

1 に答える 1