molstar
Version:
A comprehensive macromolecular library.
54 lines (53 loc) • 1.82 kB
TypeScript
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* Taken/adapted from DensityServer (https://github.com/dsehnal/DensityServer)
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
/// <reference types="node" />
import { FileHandle } from '../../../mol-io/common/file-handle';
import { TypedArrayValueType } from '../../../mol-io/common/typed-array';
export interface Spacegroup {
number: number;
size: number[];
angles: number[];
/** Determine if the data should be treated as periodic or not. (e.g. X-ray = periodic, EM = not periodic) */
isPeriodic: boolean;
}
export interface ValuesInfo {
mean: number;
sigma: number;
min: number;
max: number;
}
export interface Sampling {
byteOffset: number;
/** How many values along each axis were collapsed into 1 */
rate: number;
valuesInfo: ValuesInfo[];
/** Number of samples along each axis, in axisOrder */
sampleCount: number[];
}
export interface Header {
/** Format version number */
formatVersion: string;
/** Axis order from the slowest to fastest moving, same as in CCP4 */
axisOrder: number[];
/** Origin in fractional coordinates, in axisOrder */
origin: number[];
/** Dimensions in fractional coordinates, in axisOrder */
dimensions: number[];
spacegroup: Spacegroup;
channels: string[];
/** Determines the data type of the values */
valueType: TypedArrayValueType;
/** The value are stored in blockSize^3 cubes */
blockSize: number;
sampling: Sampling[];
}
export declare function encodeHeader(header: Header): Buffer;
export declare function readHeader(file: FileHandle): Promise<{
header: Header;
dataOffset: number;
}>;