Read/ write AcquisitionData and ImageData

NeXus

The CCPi Framework provides classes to read and write AcquisitionData and ImageData as NeXuS files.

# imports
from ccpi.io import NEXUSDataWriter, NEXUSDataReader

# initialise NEXUS Writer
writer = NEXUSDataWriter()
writer.set_up(file_name='tmp_nexus.nxs',
            data_container=my_data)
# write data
writer.write_file()

# read data
# initialize NEXUS reader
reader = NEXUSDataReader()
reader.set_up(nexus_file='tmp_nexus.nxs')
# load data
ad1 = reader.load_data()
# get AcquisiionGeometry
ag1 = reader.get_geometry()
class ccpi.io.NEXUSDataReader(**kwargs)[source]
__init__(**kwargs)[source]

Constructor

Input:

nexus_file full path to NEXUS file
__weakref__

list of weak references to the object (if defined)

get_geometry()[source]

Return either ImageGeometry or AcquisitionGeometry depepnding on file content

load_data()[source]

Parse NEXUS file and returns either ImageData or Acquisition Data depending on file content

class ccpi.io.NEXUSDataWriter(**kwargs)[source]
__init__(**kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

__weakref__

list of weak references to the object (if defined)


Nikon

class ccpi.io.NikonDataReader(**kwargs)[source]
__init__(**kwargs)[source]

Constructor

Input:

xtek_file full path to .xtexct file

roi region-of-interest to load. If roi = -1 (default),
full projections will be loaded. Otherwise roi is given by [(row0, row1), (column0, column1)], where row0, column0 are coordinates of top left corner and row1, column1 are coordinates of bottom right corner.
binning number of pixels to bin (combine) along 0 (column)
and 1 (row) dimension. If binning = [1, 1] (default), projections in original resolution are loaded. Note, if binning[0] != binning[1], then loaded projections will have anisotropic pixels, which are currently not supported by the Framework
normalize normalize loaded projections by detector
white level (I_0). Default value is False, i.e. no normalization.

flip default = False, flip projections in the left-right direction

__weakref__

list of weak references to the object (if defined)

get_geometry()[source]

Return AcquisitionGeometry object

load_projections()[source]

Load projections and return AcquisitionData container


Return Home