boilercine.models

Contents

boilercine.models#

Models for CINE file metadata.

Module Contents#

Classes#

Time64

Time64 struct.

ImFilter

Image filter.

Rect

Crop rectangle.

TC

Time code according to the standard SMPTE 12M-1999.

WBGain2

White balance, gain correction.

CineFileHeader

CINE file header.

BitmapInfoHeader

Bitmap info header.

Setup

Setup header.

Header

Top-level header for CINE file metadata.

FlatHeader

Flattened header for CINE file metadata.

FlatHeaderStudySpecific

Functions#

struct_to_dict

Convert a C-style structure to a dictionary from its _fields_.

capfirst

Capitalize the first letter of a string.

Data#

BYTES_TYPE_FIELDS

CHAR_ARRAY_FIELDS

LIST_TYPE_FIELDS

SETUP_IGNORED_FIELDS

Ignore these fields.

SETUP_FIELDS_MAPPING_ORIGINAL_TO_UPDATED

Use the updated fields here instead of the original ones.

SETUP_FIELDS_TO_REMOVE

CINE_HEADER_INVALID_FIELDS_THIS_STUDY

These fields are invalid for the camera and PCC software used in this study.

SETUP_INVALID_FIELDS_THIS_STUDY

These setup fields are invalid for the camera and PCC software used in this study.

FIELDS_TO_REMOVE_THIS_STUDY

API#

boilercine.models.BYTES_TYPE_FIELDS#

None

boilercine.models.CHAR_ARRAY_FIELDS#

None

boilercine.models.LIST_TYPE_FIELDS#

None

boilercine.models.SETUP_IGNORED_FIELDS#

None

Ignore these fields.

See: ottomatic-io/pycine

boilercine.models.SETUP_FIELDS_MAPPING_ORIGINAL_TO_UPDATED#

None

Use the updated fields here instead of the original ones.

See: ottomatic-io/pycine

boilercine.models.SETUP_FIELDS_TO_REMOVE#

None

boilercine.models.CINE_HEADER_INVALID_FIELDS_THIS_STUDY#

None

These fields are invalid for the camera and PCC software used in this study.

boilercine.models.SETUP_INVALID_FIELDS_THIS_STUDY#

None

These setup fields are invalid for the camera and PCC software used in this study.

boilercine.models.FIELDS_TO_REMOVE_THIS_STUDY#

None

boilercine.models.struct_to_dict(
structure,
)#

Convert a C-style structure to a dictionary from its _fields_.

boilercine.models.capfirst(
string: str,
) str#

Capitalize the first letter of a string.

class boilercine.models.Time64#

Time64 struct.

See: ottomatic-io/pycine

fractions: int#

None

seconds: int#

None

class boilercine.models.ImFilter#

Image filter.

dim: int#

None

shifts: int#

None

bias: int#

None

Coef: list[int]#

None

class boilercine.models.Rect#

Crop rectangle.

left: int#

None

top: int#

None

right: int#

None

bottom: int#

None

class boilercine.models.TC#

Time code according to the standard SMPTE 12M-1999.

framesU: int#

None

framesT: int#

None

dropFrameFlag: int#

None

colorFrameFlag: int#

None

secondsU: int#

None

secondsT: int#

None

flag1: int#

None

minutesU: int#

None

minutesT: int#

None

flag2: int#

None

hoursU: int#

None

hoursT: int#

None

flag3: int#

None

flag4: int#

None

userBitData: int#

None

class boilercine.models.WBGain2#

White balance, gain correction.

R: float#

None

B: float#

None

class boilercine.models.CineFileHeader#

CINE file header.

See: ottomatic-io/pycine

Type: int#

None

Headersize: int#

None

Compression: int#

None

Version: int#

None

FirstMovieImage: int#

None

TotalImageCount: int#

None

FirstImageNo: int#

None

ImageCount: int#

None

OffImageHeader: int#

None

OffSetup: int#

None

OffImageOffsets: int#

None

TriggerTime: boilercine.models.Time64#

None

class boilercine.models.BitmapInfoHeader#

Bitmap info header.

See: ottomatic-io/pycine

biSize: int#

None

biWidth: int#

None

biHeight: int#

None

biPlanes: int#

None

biBitCount: int#

None

biCompression: int#

None

biSizeImage: int#

None

biXPelsPerMeter: int#

None

biYPelsPerMeter: int#

None

biClrUsed: int#

None

biClrImportant: int#

None

class boilercine.models.Setup#

Setup header.

See: ottomatic-io/pycine

FrameRate16: int#

None

Shutter16: int#

None

PostTrigger16: int#

None

FrameDelay16: int#

None

AspectRatio: int#

None

Res7: int#

None

Res8: int#

None

Res9: int#

None

Res10: int#

None

Res11: int#

None

TrigFrame: int#

None

Res12: int#

None

DescriptionOld: bytes#

None

Mark: int#

None

Length: int#

None

Res13: int#

None

SigOption: int#

None

BinChannels: int#

None

SamplesPerImage: int#

None

BinName: bytes#

None

AnaOption: int#

None

AnaChannels: int#

None

Res6: int#

None

AnaBoard: int#

None

ChOption: list[int]#

None

AnaGain: list[float]#

None

AnaUnit: bytes#

None

AnaName: bytes#

None

lFirstImage: int#

None

dwImageCount: int#

None

nQFactor: int#

None

wCineFileType: int#

None

szCinePath: bytes#

None

Res14: int#

None

Res15: int#

None

Res16: int#

None

Res17: int#

None

Res18: float#

None

Res19: float#

None

Res20: int#

None

Res1: int#

None

Res2: int#

None

Res3: int#

None

ImWidth: int#

None

ImHeight: int#

None

EDRShutter16: int#

None

Serial: int#

None

Saturation: int#

None

Res5: int#

None

AutoExposure: int#

None

bFlipH: bool#

None

bFlipV: bool#

None

Grid: int#

None

FrameRate: int#

None

Shutter: int#

None

EDRShutter: int#

None

PostTrigger: int#

None

FrameDelay: int#

None

bEnableColor: bool#

None

CameraVersion: int#

None

FirmwareVersion: int#

None

SoftwareVersion: int#

None

RecordingTimeZone: int#

None

CFA: int#

None

Bright: int#

None

Contrast: int#

None

Gamma: int#

None

Res21: int#

None

AutoExpLevel: int#

None

AutoExpSpeed: int#

None

AutoExpRect: boilercine.models.Rect#

None

WBGain: list[boilercine.models.WBGain2]#

None

Rotate: int#

None

WBView: boilercine.models.WBGain2#

None

RealBPP: int#

None

Conv8Min: int#

None

Conv8Max: int#

None

FilterCode: int#

None

FilterParam: int#

None

UF: boilercine.models.ImFilter#

None

BlackCalSVer: int#

None

WhiteCalSVer: int#

None

GrayCalSVer: int#

None

bStampTime: bool#

None

SoundDest: int#

None

FRPSteps: int#

None

FRPImgNr: list[int]#

None

FRPRate: list[int]#

None

FRPExp: list[int]#

None

MCCnt: int#

None

MCPercent: list[float]#

None

CICalib: int#

None

CalibWidth: int#

None

CalibHeight: int#

None

CalibRate: int#

None

CalibExp: int#

None

CalibEDR: int#

None

CalibTemp: int#

None

HeadSerial: list[int]#

None

RangeCode: int#

None

RangeSize: int#

None

Decimation: int#

None

MasterSerial: int#

None

Sensor: int#

None

ShutterNs: int#

None

EDRShutterNs: int#

None

FrameDelayNs: int#

None

ImPosXAcq: int#

None

ImPosYAcq: int#

None

ImWidthAcq: int#

None

ImHeightAcq: int#

None

Description: bytes#

None

RisingEdge: bool#

None

FilterTime: int#

None

LongReady: bool#

None

ShutterOff: bool#

None

Res4: list[int]#

None

bMetaWB: bool#

None

Hue: int#

None

BlackLevel: int#

None

WhiteLevel: int#

None

LensDescription: bytes#

None

LensAperture: float#

None

LensFocusDistance: float#

None

LensFocalLength: float#

None

fOffset: float#

None

fGain: float#

None

fSaturation: float#

None

fHue: float#

None

fGamma: float#

None

fGammaR: float#

None

fGammaB: float#

None

fFlare: float#

None

fPedestalR: float#

None

fPedestalG: float#

None

fPedestalB: float#

None

fChroma: float#

None

ToneLabel: bytes#

None

TonePoints: int#

None

fTone: list[float]#

None

UserMatrixLabel: bytes#

None

EnableMatrices: bool#

None

cmUser: list[float]#

None

EnableCrop: bool#

None

CropRect: boilercine.models.Rect#

None

EnableResample: bool#

None

ResampleWidth: int#

None

ResampleHeight: int#

None

fGain16_8: float#

None

FRPShape: list[int]#

None

TrigTC: boilercine.models.TC#

None

fPbRate: float#

None

fTcRate: float#

None

CineName: bytes#

None

fGainR: float#

None

fGainG: float#

None

fGainB: float#

None

cmCalib: list[float]#

None

fWBTemp: float#

None

fWBCc: float#

None

CalibrationInfo: bytes#

None

OpticalFilter: bytes#

None

GpsInfo: bytes#

None

Uuid: bytes#

None

CreatedBy: bytes#

None

RecBPP: int#

None

LowestFormatBPP: int#

None

LowestFormatQ: int#

None

fToe: float#

None

LogMode: int#

None

CameraModel: bytes#

None

WBType: int#

None

fDecimation: float#

None

MagSerial: int#

None

CSSerial: int#

None

dFrameRate: float#

None

SensorMode: int#

None

__post_init__()#

Convert low-level structures to dataclasses.

class boilercine.models.Header#

Top-level header for CINE file metadata.

See: ottomatic-io/pycine.

cinefileheader: boilercine.models.CineFileHeader#

None

bitmapinfoheader: boilercine.models.BitmapInfoHeader#

None

setup: boilercine.models.Setup#

None

pImage: list[int]#

None

List of pointers to each image in the video for low-level indexing.

timestamp: boilercine.types.ArrFloat#

None

Array of timestamps for each image in the video.

utc: boilercine.types.ArrDT#

None

Array of the UTC time for each image in the video.

exposuretime: boilercine.types.ArrFloat#

None

Array of exposure times for each image in the video.

timezone: dataclasses.InitVar[datetime.tzinfo]#

None

The timezone in which the video was created.

__post_init__(
timezone: datetime.tzinfo,
)#

Convert low-level structures to dataclasses.

classmethod from_file(
cine_file: pathlib.Path,
timezone: datetime.tzinfo,
) Self#

Extract the header from a CINE file.

class boilercine.models.FlatHeader#

Flattened header for CINE file metadata.

Type: int#

None

Headersize: int#

None

Compression: int#

None

Version: int#

None

FirstMovieImage: int#

None

TotalImageCount: int#

None

FirstImageNo: int#

None

ImageCount: int#

None

OffImageHeader: int#

None

OffSetup: int#

None

OffImageOffsets: int#

None

TriggerTime: str#

None

BiSize: int#

None

BiWidth: int#

None

BiHeight: int#

None

BiPlanes: int#

None

BiBitCount: int#

None

BiCompression: int#

None

BiSizeImage: int#

None

BiXPelsPerMeter: int#

None

BiYPelsPerMeter: int#

None

BiClrUsed: int#

None

BiClrImportant: int#

None

TrigFrame: int#

None

Mark: int#

None

Length: int#

None

SigOption: int#

None

BinChannels: int#

None

SamplesPerImage: int#

None

BinName: bytes#

None

AnaOption: int#

None

AnaChannels: int#

None

AnaBoard: int#

None

ChOption: list[int]#

None

AnaGain: list[float]#

None

AnaUnit: bytes#

None

AnaName: bytes#

None

LFirstImage: int#

None

DwImageCount: int#

None

NQFactor: int#

None

WCineFileType: int#

None

SzCinePath: bytes#

None

ImWidth: int#

None

ImHeight: int#

None

Serial: int#

None

AutoExposure: int#

None

BFlipH: bool#

None

BFlipV: bool#

None

FrameRate: int#

None

Grid: int#

None

PostTrigger: int#

None

BEnableColor: bool#

None

CameraVersion: int#

None

FirmwareVersion: int#

None

SoftwareVersion: int#

None

RecordingTimeZone: int#

None

CFA: int#

None

AutoExpLevel: int#

None

AutoExpSpeed: int#

None

AutoExpRectLeft: int#

None

AutoExpRectTop: int#

None

AutoExpRectRight: int#

None

AutoExpRectBottom: int#

None

WBGain0R: float#

None

WBGain0B: float#

None

WBGain1R: float#

None

WBGain1B: float#

None

WBGain2R: float#

None

WBGain2B: float#

None

WBGain3R: float#

None

WBGain3B: float#

None

Rotate: int#

None

WBViewR: float#

None

WBViewB: float#

None

RealBPP: int#

None

FilterCode: int#

None

FilterParam: int#

None

UFDim: int#

None

UFShifts: int#

None

UFBias: int#

None

UFCoef: list[int]#

None

BlackCalSVer: int#

None

WhiteCalSVer: int#

None

GrayCalSVer: int#

None

BStampTime: bool#

None

SoundDest: int#

None

FRPSteps: int#

None

FRPImgNr: list[int]#

None

FRPRate: list[int]#

None

FRPExp: list[int]#

None

MCCnt: int#

None

MCPercent: list[float]#

None

CICalib: int#

None

CalibWidth: int#

None

CalibHeight: int#

None

CalibRate: int#

None

CalibExp: int#

None

CalibEDR: int#

None

CalibTemp: int#

None

HeadSerial: list[int]#

None

RangeCode: int#

None

RangeSize: int#

None

Decimation: int#

None

MasterSerial: int#

None

Sensor: int#

None

ShutterNs: int#

None

EDRShutterNs: int#

None

FrameDelayNs: int#

None

ImPosXAcq: int#

None

ImPosYAcq: int#

None

ImWidthAcq: int#

None

ImHeightAcq: int#

None

Description: bytes#

None

RisingEdge: bool#

None

FilterTime: int#

None

LongReady: bool#

None

ShutterOff: bool#

None

BMetaWB: bool#

None

BlackLevel: int#

None

WhiteLevel: int#

None

LensDescription: bytes#

None

LensAperture: float#

None

LensFocusDistance: float#

None

LensFocalLength: float#

None

FOffset: float#

None

FGain: float#

None

FSaturation: float#

None

FHue: float#

None

FGamma: float#

None

FGammaR: float#

None

FGammaB: float#

None

FFlare: float#

None

FPedestalR: float#

None

FPedestalG: float#

None

FPedestalB: float#

None

FChroma: float#

None

ToneLabel: bytes#

None

TonePoints: int#

None

FTone: list[float]#

None

UserMatrixLabel: bytes#

None

EnableMatrices: bool#

None

CmUser: list[float]#

None

EnableCrop: bool#

None

CropRectLeft: int#

None

CropRectTop: int#

None

CropRectRight: int#

None

CropRectBottom: int#

None

EnableResample: bool#

None

ResampleWidth: int#

None

ResampleHeight: int#

None

FGain16_8: float#

None

FRPShape: list[int]#

None

TrigTCFramesU: int#

None

TrigTCFramesT: int#

None

TrigTCDropFrameFlag: int#

None

TrigTCColorFrameFlag: int#

None

TrigTCSecondsU: int#

None

TrigTCSecondsT: int#

None

TrigTCFlag1: int#

None

TrigTCMinutesU: int#

None

TrigTCMinutesT: int#

None

TrigTCFlag2: int#

None

TrigTCHoursU: int#

None

TrigTCHoursT: int#

None

TrigTCFlag3: int#

None

TrigTCFlag4: int#

None

TrigTCUserBitData: int#

None

FPbRate: float#

None

FTcRate: float#

None

CineName: bytes#

None

FGainR: float#

None

FGainG: float#

None

FGainB: float#

None

CmCalib: list[float]#

None

FWBTemp: float#

None

FWBCc: float#

None

CalibrationInfo: bytes#

None

OpticalFilter: bytes#

None

GpsInfo: bytes#

None

Uuid: bytes#

None

CreatedBy: bytes#

None

RecBPP: int#

None

LowestFormatBPP: int#

None

LowestFormatQ: int#

None

FToe: float#

None

LogMode: int#

None

CameraModel: bytes#

None

WBType: int#

None

FDecimation: float#

None

MagSerial: int#

None

CSSerial: int#

None

DFrameRate: float#

None

SensorMode: int#

None

classmethod from_header(
header: boilercine.models.Header,
timezone: datetime.tzinfo,
) Self#

Flatten a header.

class boilercine.models.FlatHeaderStudySpecific#
ExposureTime: int#

None

Type: int#

None

Headersize: int#

None

Compression: int#

None

Version: int#

None

FirstMovieImage: int#

None

TotalImageCount: int#

None

FirstImageNo: int#

None

ImageCount: int#

None

OffImageOffsets: int#

None

TriggerTime: str#

None

BiSize: int#

None

BiWidth: int#

None

BiHeight: int#

None

BiPlanes: int#

None

BiBitCount: int#

None

BiCompression: int#

None

BiSizeImage: int#

None

BiXPelsPerMeter: int#

None

BiYPelsPerMeter: int#

None

BiClrUsed: int#

None

BiClrImportant: int#

None

TrigFrame: int#

None

Mark: int#

None

Length: int#

None

SigOption: int#

None

BinChannels: int#

None

SamplesPerImage: int#

None

AnaOption: int#

None

AnaChannels: int#

None

AnaBoard: int#

None

ChOption: list[int]#

None

AnaGain: list[float]#

None

LFirstImage: int#

None

DwImageCount: int#

None

NQFactor: int#

None

WCineFileType: int#

None

ImWidth: int#

None

ImHeight: int#

None

Serial: int#

None

AutoExposure: int#

None

BFlipH: bool#

None

BFlipV: bool#

None

FrameRate: int#

None

Grid: int#

None

PostTrigger: int#

None

BEnableColor: bool#

None

CameraVersion: int#

None

FirmwareVersion: int#

None

SoftwareVersion: int#

None

RecordingTimeZone: int#

None

CFA: int#

None

AutoExpLevel: int#

None

AutoExpSpeed: int#

None

AutoExpRectLeft: int#

None

AutoExpRectTop: int#

None

AutoExpRectRight: int#

None

AutoExpRectBottom: int#

None

WBGain0R: float#

None

WBGain0B: float#

None

WBGain1R: float#

None

WBGain1B: float#

None

WBGain2R: float#

None

WBGain2B: float#

None

WBGain3R: float#

None

WBGain3B: float#

None

Rotate: int#

None

WBViewR: float#

None

WBViewB: float#

None

RealBPP: int#

None

FilterCode: int#

None

FilterParam: int#

None

UFDim: int#

None

UFShifts: int#

None

UFBias: int#

None

UFCoef: list[int]#

None

BlackCalSVer: int#

None

WhiteCalSVer: int#

None

GrayCalSVer: int#

None

BStampTime: bool#

None

SoundDest: int#

None

FRPSteps: int#

None

FRPImgNr: list[int]#

None

FRPRate: list[int]#

None

FRPExp: list[int]#

None

MCCnt: int#

None

MCPercent: list[float]#

None

CICalib: int#

None

CalibWidth: int#

None

CalibHeight: int#

None

CalibRate: int#

None

CalibExp: int#

None

CalibEDR: int#

None

CalibTemp: int#

None

HeadSerial: list[int]#

None

RangeCode: int#

None

RangeSize: int#

None

Decimation: int#

None

MasterSerial: int#

None

Sensor: int#

None

ShutterNs: int#

None

EDRShutterNs: int#

None

FrameDelayNs: int#

None

ImPosXAcq: int#

None

ImPosYAcq: int#

None

ImWidthAcq: int#

None

ImHeightAcq: int#

None

RisingEdge: bool#

None

FilterTime: int#

None

LongReady: bool#

None

ShutterOff: bool#

None

BMetaWB: bool#

None

BlackLevel: int#

None

WhiteLevel: int#

None

FOffset: float#

None

FGain: float#

None

FSaturation: float#

None

FHue: float#

None

FGamma: float#

None

FGammaR: float#

None

FGammaB: float#

None

FFlare: float#

None

FPedestalR: float#

None

FPedestalG: float#

None

FPedestalB: float#

None

FChroma: float#

None

TonePoints: int#

None

FTone: list[float]#

None

EnableMatrices: bool#

None

CmUser: list[float]#

None

EnableCrop: bool#

None

CropRectLeft: int#

None

CropRectTop: int#

None

CropRectRight: int#

None

CropRectBottom: int#

None

EnableResample: bool#

None

ResampleWidth: int#

None

ResampleHeight: int#

None

FGain16_8: float#

None

FRPShape: list[int]#

None

classmethod from_flat_header(
flat: boilercine.models.FlatHeader,
exposure_time: int,
) Self#

Remove fields specific to this study.