def __init__(self, filename): """ Constructor """ DataWriter.__init__(self) # list of references to individual channels (.bxc files) self.writers = [] # path to the .du-file and .vti-file(s) self.path = os.path.dirname(filename) bxdfile = os.path.basename(filename) if bxdfile[-4:].lower() != ".bxd": newdirname = bxdfile bxdfile = bxdfile + ".bxd" else: lst = bxdfile.split(".") newdirname = ".".join(lst[:-1]) self.filedir = os.path.join(self.path, newdirname) if not os.path.exists(self.filedir): os.mkdir(self.filedir) elif not os.path.isdir(self.filedir): Logging.error( "Not a directory", "The selected path, %s exists and is not directory. Cannot write files" % (self.filedir)) self.filename = os.path.join(self.filedir, bxdfile)
def __init__(self, filename): """ Constructor """ DataWriter.__init__(self) # list of references to individual channels (.bxc files) self.writers = [] # path to the .du-file and .vti-file(s) self.path = os.path.dirname(filename) bxdfile = os.path.basename(filename) if bxdfile[-4:].lower() != ".bxd": newdirname = bxdfile bxdfile = bxdfile + ".bxd" else: lst = bxdfile.split(".") newdirname = ".".join(lst[:-1]) self.filedir = os.path.join(self.path, newdirname) if not os.path.exists(self.filedir): os.mkdir(self.filedir) elif not os.path.isdir(self.filedir): Logging.error("Not a directory", "The selected path, %s exists and is not directory. Cannot write files" %(self.filedir)) self.filename = os.path.join(self.filedir, bxdfile)
def __init__(self, filename): """ Constructor """ DataWriter.__init__(self) # list of references to individual datasets (= timepoints) stored in # vti-files self.dataSets = [] # filename of the .bxc-file self.polyDataFiles = [] self.polyDataToWrite = [] self.filename = filename # path to the .bxc-file and .vti-file(s) self.path = "" # List of images and their paths self.imagesToWrite = [] # Number of datasets added to this datasource self.counter = 0 self.polycounter = 0 self.dataUnitSettings = {} self.parser = None