Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #2135 (closed)

Opened 9 years ago

Closed 9 years ago

EM metadata dictionaries for EM software

Reported by: wmoore Owned by: wmoore
Priority: minor Milestone: OMERO-Beta4.2
Component: General Version: n.a.
Keywords: n.a. Cc:
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: 2010-04-02 (6)

Description (last modified by wmoore)

Try to identify the metadata attributes used by various EM software, to look for common attributes for OME data model, and how to convert between them.

When EMAN2 reads a SPIDER image, it reads various Spider attributes but maintains them as clearly coming from SPIDER (same as MRC). Keeps these even if duplicated in EMAN2. E.g. 'SPIDER.nslice' and 'nz':

>>> from EMAN2 import *
>>> d = EMData()
>>> d.read_image("circ001.spi")
>>> display(d)
>>> dic = d.get_attr_dict()
>>> dic
{'changecount': 2, 'SPIDER.time': '05:1162:', 'minimum': 0.0, 'SPIDER.imgnum': 0, 'mean_nonzero': 1.0,
 'SPIDER.date': 'A-212-RP', 'SPIDER.angvalid': 0, 'SPIDER.reclen': 300, 'SPIDER.headrec': 4, 'apix_z': 1.0, 
'apix_y': 1.0, 'apix_x': 1.0, 'HostEndian': 'little', 'nx': 75, 'ny': 75, 'nz': 1, 'SPIDER.irec': 79.0,
 'sigma_nonzero': 0.0, 'is_complex_ri': 1, 'SPIDER.istack': 0, 'is_complex_x': 0, 'SPIDER.nslice': 1,
 'ImageEndian': 'big', 'SPIDER.type': 1, 'SPIDER.title': '1', 'SPIDER.dz': 0.0, 'SPIDER.dx': 0.0, 
'SPIDER.dy': 0.0, 'maximum': 1.0, 'SPIDER.headlen': 1200, 'datatype': 7, 'square_sum': 793.0, 'SPIDER.Kangle': 0,
 'is_complex': 0, 'sigma': 0.34802955389022827,
 'mean': 0.14097778499126434}

Can also use Spider to read SPIDER images and Headers in Python...

>>> from Spider.Spiderarray import * 
>>> dir(Spider.Spiderarray)
['Image', 'SpiderHeaderClass', '_HAS_NUMPY_', '__builtins__', '__doc__', '__file__', '__name__', 'array2image', 'array2spider', 'getSpiderHeader', 'image2array', 'makeSpiderHeader', 'numpy', 'spider2array', 'struct', 'sys']
>>> array = spider2array("circ001.dat")
>>> array
array([[ 0.,  0.,  0., ...,  0.,  0.,  0.],
       [ 0.,  0.,  0., ...,  0.,  0.,  0.],
       [ 0.,  0.,  0., ...,  0.,  0.,  0.],
       ..., 
       [ 0.,  0.,  0., ...,  0.,  0.,  0.],
       [ 0.,  0.,  0., ...,  0.,  0.,  0.],
       [ 0.,  0.,  0., ...,  0.,  0.,  0.]], dtype=float32)
>>> h = getSpiderHeader("circ001.dat")
>>> h
[1, 1.0, 75.0, 79.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.14097778499126434, 0.34802955389022827, 0.0, 75.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1200.0, 300.0, 0.0, -1.0, 0.0, 0.0]
>>> for i in range(len(h)):
...     print i, h[i]
... 
#  see http://www.wadsworth.org/spider_doc/spider/docs/image_doc.html
0 1			#
1 1.0		# NSLICE
2 75.0		# NROW
3 79.0		# IREC
4 0.0		# UNUSED
5 1.0
6 1.0
7 1.0		# FMAX
8 0.0		# FMIN
9 0.140977784991		# AV
10 0.34802955389		# SIG
11 0.0
12 75.0
13 4.0
14 0.0
15 0.0
16 0.0
17 0.0
18 0.0
19 0.0
20 0.0
21 0.0
22 1200.0
23 300.0
24 0.0
25 -1.0
26 0.0
27 0.0


Change History (9)

comment:1 Changed 9 years ago by wmoore

  • Description modified (diff)

comment:2 Changed 9 years ago by wmoore

  • Status changed from new to assigned

comment:3 Changed 9 years ago by wmoore

  • Description modified (diff)

comment:4 Changed 9 years ago by wmoore

  • Description modified (diff)

comment:5 Changed 9 years ago by wmoore

  • Description modified (diff)

comment:6 Changed 9 years ago by wmoore

  • Description modified (diff)

comment:7 Changed 9 years ago by wmoore

  • Description modified (diff)

comment:8 Changed 9 years ago by wmoore

  • Description modified (diff)

comment:9 Changed 9 years ago by wmoore

  • Remaining Time changed from 1 to 0
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.79257 sec.)

We're Hiring!