-
Notifications
You must be signed in to change notification settings - Fork 4
convertingMyData
Ander Arbelaiz edited this page Jul 1, 2014
·
3 revisions
The convertMyData.py script helps you to convert a set of images into an atlas. It does not search recursively for the file(s), so the input folder must contain the file(s) to be converted on the first level.
The script requires the following python packages:
- PIL
- NumPy
- ndimage, misc from SciPy library
To convert your file(s) some modifications are required in the script. The loadMyDatafunction must be redefined to support your own data type.
def loadMyData(filename):
myImageSize = (32, 32)
im = Image.new("L", myImageSize)
putpix = im.im.putpixel
for y in range(myImageSize[1]):
for x in range(myImageSize[0]):
val = 0 #... here get the value from your file (make sure that 0 <= val <= 255 )
putpix((x,y), val)
return imThe script takes two input arguments. The <InputFolder> with the file(s) to be converted and the <OutputFileName> where the atlas will be stored.
python convertMyData.py <InputFolder> <OutputFileName>