Closed tlambert03 closed 2 years ago
This PR adds an rois property to nd2 files that parses the RoiMetadata_v1 metdata portion of an nd2 file into nice data structures (nd2.structures.ROI). it returns a dict of ROI objects keyed on the ROI id. A quick example for 1 ROI:
rois
RoiMetadata_v1
nd2.structures.ROI
>>> import nd2 >>> f = nd2.ND2File('tests/data/rois.nd2') >>> f.rois { 1: ROI( id=1, info=RoiInfo( shapeType=<RoiShapeType.Rectangle: 3>, interpType=<InterpType.BackgroundROI: 2>, cookie=1, color=255, label='rect bgrd', stimulationGroup=0, scope=1, appData=0, multiFrame=False, locked=False, compCount=1, bpc=16, autodetected=False, gradientStimulation=False, gradientStimulationBitDepth=0, gradientStimulationLo=0.0, gradientStimulationHi=0.0 ), guid='{0CC87494-DF49-47FE-A5DB-72C89670AB88}', animParams=[ AnimParam( timeMs=0.0, enabled=1, centerX=-0.8171912832929782, centerY=-0.8656174334140436, centerZ=0.0, rotationZ=3.0, boxShape=BoxShape( sizeX=0.21549636803874095, sizeY=0.14285714285714285, sizeZ=0.0 ), extrudedShape=ExtrudedShape(sizeZ=0, basePoints=[]) ) ] ) }
here, is the full output of .rois for the rois.nd2 test file (which includes every variant of ROI that I could create in NIS-elements)
.rois
rois.nd2
This PR adds an
rois
property to nd2 files that parses theRoiMetadata_v1
metdata portion of an nd2 file into nice data structures (nd2.structures.ROI
). it returns a dict of ROI objects keyed on the ROI id. A quick example for 1 ROI:here, is the full output of
.rois
for therois.nd2
test file (which includes every variant of ROI that I could create in NIS-elements)