diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2019-05-10 15:23:04 +0100 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2019-05-10 15:23:04 +0100 |
commit | 170d1c659b35ba36eb734511470ead444502fe20 (patch) | |
tree | 0460d54da0e802f023d6182a537c5b84751bbcdc | |
parent | 2612b73ca1d4581364720b4646805cdcc430f3cb (diff) | |
download | framework-170d1c659b35ba36eb734511470ead444502fe20.tar.gz framework-170d1c659b35ba36eb734511470ead444502fe20.tar.bz2 framework-170d1c659b35ba36eb734511470ead444502fe20.tar.xz framework-170d1c659b35ba36eb734511470ead444502fe20.zip |
cleanup
-rwxr-xr-x | Wrappers/Python/ccpi/framework/TestData.py | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/Wrappers/Python/ccpi/framework/TestData.py b/Wrappers/Python/ccpi/framework/TestData.py index 83b2ee1..752bc13 100755 --- a/Wrappers/Python/ccpi/framework/TestData.py +++ b/Wrappers/Python/ccpi/framework/TestData.py @@ -33,44 +33,30 @@ class TestData(object): sdata[round(M/8):round(7*M/8),round(3*M/8):round(5*M/8)] = 1
ig = ImageGeometry(voxel_num_x = N, voxel_num_y = M, dimension_labels=[ImageGeometry.HORIZONTAL_X, ImageGeometry.HORIZONTAL_Y])
data = ig.allocate()
- #data.geometry = ig
data.fill(sdata)
else:
tmp = Image.open(os.path.join(self.data_dir, which))
print (tmp)
bands = tmp.getbands()
if len(bands) > 1:
- # convert to greyscale
- #tmp = tmp.convert('L')
ig = ImageGeometry(voxel_num_x=size[0], voxel_num_y=size[1], channels=len(bands),
dimension_labels=[ImageGeometry.HORIZONTAL_X, ImageGeometry.HORIZONTAL_Y, ImageGeometry.CHANNEL])
-
data = ig.allocate()
- #data.geometry = ig
- #newsize = (size[0], size[1], len(bands))
else:
ig = ImageGeometry(voxel_num_x = size[0], voxel_num_y = size[1], dimension_labels=[ImageGeometry.HORIZONTAL_X, ImageGeometry.HORIZONTAL_Y])
data = ig.allocate()
- #data.geometry = ig
- #newsize = size
-
data.fill(numpy.array(tmp.resize((size[1],size[0]))))
-
if scale is not None:
dmax = data.as_array().max()
dmin = data.as_array().min()
-
# scale 0,1
data = (data -dmin) / (dmax - dmin)
-
if scale != (0,1):
#data = (data-dmin)/(dmax-dmin) * (scale[1]-scale[0]) +scale[0])
data *= (scale[1]-scale[0])
data += scale[0]
-
print ("data.geometry", data.geometry)
return data
-
def camera(**kwargs):
|