-
Notifications
You must be signed in to change notification settings - Fork 0
/
InformationStructure.py
71 lines (55 loc) · 1.97 KB
/
InformationStructure.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /usr/bin/python
import sys
import platform
import os
class InformationStructure():
#init main window
def __init__(self, fullName, parent=None):
# full name
self.FullName = fullName
# location
self.DirName = os.path.dirname( self.FullName )
# long name
# filename + extension
self.LongName = fullName[len(self.DirName):]
# split long name into short name and extension
(shortname, extension) = os.path.splitext(self.LongName)
# short name
# filename
self.ShortName = shortname
# extension
self.Extension = extension
# list all the useful information
self.Attributes = ["Version",
"ExperimentTitle",
"ExperimentDescription",
"TimeInterval",
"Objective",
"VoxelSizeX",
"VoxelSizeY",
"VoxelSizeZ",
"DimensionX",
"DimensionY",
"DimensionCO",
"DimensionPL",
"DimensionRO",
"DimensionZT",
"DimensionYT",
"DimensionXT",
"DimensionTM",
"DimensionZS",
"DimensionCH",
"ChannelColor00",
"ChannelColor01",
"ChannelDepth",
"FileType"]
for name in self.Attributes:
setattr(self, name, 0)
def AddInformation(self, line):
words = line.split()
if( len(words) > 1):
setattr(self, words[0], words[1])
def GetAttribute(self, name):
return getattr(self, name)
def GetAttributes(self):
return self.Attributes