diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2018-03-21 17:26:54 +0000 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2018-03-21 17:26:54 +0000 |
commit | e453b6b6c4dd4869fdcc6f2b76efe96b1178d864 (patch) | |
tree | 5a900cae6ed0697e7b8c98792a95a02bdf915d19 /Wrappers/Python | |
parent | 737a7aa27e0f55718cbcef4909ff9d64457a7ef1 (diff) | |
download | framework-e453b6b6c4dd4869fdcc6f2b76efe96b1178d864.tar.gz framework-e453b6b6c4dd4869fdcc6f2b76efe96b1178d864.tar.bz2 framework-e453b6b6c4dd4869fdcc6f2b76efe96b1178d864.tar.xz framework-e453b6b6c4dd4869fdcc6f2b76efe96b1178d864.zip |
fix and begin to change to lower_case
Diffstat (limited to 'Wrappers/Python')
-rw-r--r-- | Wrappers/Python/ccpi/io/reader.py | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/Wrappers/Python/ccpi/io/reader.py b/Wrappers/Python/ccpi/io/reader.py index ca5b380..c66b1e8 100644 --- a/Wrappers/Python/ccpi/io/reader.py +++ b/Wrappers/Python/ccpi/io/reader.py @@ -83,28 +83,28 @@ class NexusReader(object): print("Error reading nexus file")
raise
- def loadProjection(self, dimensions=None):
+ def load_projection(self, dimensions=None):
'''
Loads the projection data from the nexus file.
returns: numpy array with projection data
'''
return self.load(dimensions, 0)
- def loadFlat(self, dimensions=None):
+ def load_flat(self, dimensions=None):
'''
Loads the flat field data from the nexus file.
returns: numpy array with flat field data
'''
return self.load(dimensions, 1)
- def loadDark(self, dimensions=None):
+ def load_dark(self, dimensions=None):
'''
Loads the Dark field data from the nexus file.
returns: numpy array with dark field data
'''
return self.load(dimensions, 2)
- def getProjectionAngles(self):
+ def get_projection_angles(self):
'''
This function returns the projection angles
'''
@@ -122,7 +122,7 @@ class NexusReader(object): raise
- def getSinogramDimensions(self):
+ def get_sinogram_dimensions(self):
'''
Return the dimensions of the dataset
'''
@@ -142,7 +142,7 @@ class NexusReader(object): print("Error reading nexus file")
raise
- def getProjectionDimensions(self):
+ def get_projection_dimensions(self):
'''
Return the dimensions of the dataset
'''
@@ -161,13 +161,23 @@ class NexusReader(object): print("Error reading nexus file")
raise
- def getAcquisitionData(self, dimensions=None):
+ def get_acquisition_data(self, dimensions=None):
'''
This method load the acquisition data and given dimension and returns an AcquisitionData Object
'''
- data = self.loadProjection(dimensions)
- geometry = AcquisitionGeometry('parallel', '3D', self.getProjectionAngles())
- return AcquisitionData(data, geometry=geometry)
+ data = self.load_projection(dimensions)
+ dims = self.get_projection_dimensions()
+ geometry = AcquisitionGeometry('parallel', '3D',
+ self.get_projection_angles(),
+ pixel_num_h = dims[2],
+ pixel_size_h = 1 ,
+ pixel_num_v = dims[1],
+ pixel_size_v = 1,
+ dist_source_center = None,
+ dist_center_detector = None,
+ channels = 1)
+ return AcquisitionData(data, geometry=geometry,
+ dimension_labels=['angle','vertical','horizontal'])
class XTEKReader(object):
@@ -263,7 +273,7 @@ class XTEKReader(object): raise RuntimeError("Can't find angles file")
return angles
- def loadProjection(self, dimensions=None):
+ def load_projection(self, dimensions=None):
'''
This method reads the projection images from the directory and returns a numpy array
'''
|