Skip to content

Commit

Permalink
Small fixed for position metadata and order redimensioning
Browse files Browse the repository at this point in the history
  • Loading branch information
folterj committed Sep 27, 2024
1 parent dda12b2 commit 517ed3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions OmeSliCC/OmeSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ def _get_ome_metadata(self):

position = []
for plane in ensure_list(pixels.get('Plane', [])):
position = [(float(plane.get('PositionX')), plane.get('PositionXUnit')),
(float(plane.get('PositionY')), plane.get('PositionYUnit')),
(float(plane.get('PositionZ')), plane.get('PositionZUnit'))]
c, z, t = plane.get('TheC'), plane.get('TheZ'), plane.get('TheT')
position = []
if 'PositionX' in plane:
position.append((float(plane.get('PositionX')), plane.get('PositionXUnit')))
if 'PositionY' in plane:
position.append((float(plane.get('PositionY')), plane.get('PositionYUnit')))
if 'PositionZ' in plane:
position.append((float(plane.get('PositionZ')), plane.get('PositionZUnit')))
#c, z, t = plane.get('TheC'), plane.get('TheZ'), plane.get('TheT')

self.position = position
self.source_mag = 0
Expand Down
2 changes: 1 addition & 1 deletion OmeSliCC/image_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def redimension_data(data, old_order, new_order, **indices):
index = order.index(o)
dim_value = indices.get(o, 0)
new_data = np.take(new_data, indices=dim_value, axis=index)
order = order.replace(o, '')
order = order[:index] + order[index + 1:]
# add
for o in new_order:
if o not in order:
Expand Down

0 comments on commit 517ed3f

Please sign in to comment.