ImzMLWriter¶
pyimzml.ImzMLWriter module¶
- class pyimzml.ImzMLWriter.ImzMLWriter(output_filename, mz_dtype=<class 'numpy.float64'>, intensity_dtype=<class 'numpy.float32'>, mode='auto', spec_type='centroid', scan_direction='top_down', line_scan_direction='line_left_right', scan_pattern='one_way', scan_type='horizontal_line', mz_compression=<pyimzml.compression.NoCompression object>, intensity_compression=<pyimzml.compression.NoCompression object>, polarity=None)[source]¶
Create an imzML+ibd file.
- Parameters
output_filename – is used to make the base name by removing the extension (if any). two files will be made by adding “.ibd” and “.imzML” to the base name
intensity_dtype – The numpy data type to use for saving intensity values
mz_dtype – The numpy data type to use for saving mz array values
mode –
“continuous” mode will save the first mz array only
”processed” mode save every mz array separately
”auto” mode writes only mz arrays that have not already been written
intensity_compression – How to compress the intensity data before saving must be an instance of
NoCompression
orZlibCompression
mz_compression – How to compress the mz array data before saving
- addSpectrum(mzs, intensities, coords, userParams=[])[source]¶
Add a mass spectrum to the file.
- Parameters
mz – mz array
intensities – intensity array
coords –
2-tuple of x and y position OR
3-tuple of x, y, and z position
note some applications want coords to be 1-indexed
pyimzml.compression module¶
This module holds adapters for compressing an ImzML file’s binary data, currently only usable with ImzMLWriter.