Exemplo n.º 1
0
    def first_object(self):
        """
        First image in a sequence

        @return: file_object
        """
        return FilenameObject(self.first())
Exemplo n.º 2
0
    def current_object(self):
        """
        Current image in sequence

        @return: file_object

        """
        return FilenameObject(self.current())
Exemplo n.º 3
0
    def jump_object(self, num):
        """
        Jump to and read image

        @return: file_object

        """
        return FilenameObject(self.jump(num))
Exemplo n.º 4
0
    def previous_object(self):
        """
        Return the previous image

        @return: file_object

        """
        return FilenameObject(self.previous())
Exemplo n.º 5
0
    def next_object(self):
        """
        Return the next image

        @return: file_object

        """
        return FilenameObject(self.next())
Exemplo n.º 6
0
    def last_object(self):
        """
        Last image in a sequence

        @return: file_object

        """
        return FilenameObject(self.last())
Exemplo n.º 7
0
 def __init__(self, filename):
     """ create from a filename (String)"""
     self.obj = FilenameObject(filename)
Exemplo n.º 8
0
                    filename = ":".join(col_split[:-1])

    try:
        imo = fabioimage()
        byts = imo._open(filename).read(18)
        filetype = do_magic(byts)
        if filetype == "marccd" and filename.find("mccd") == -1:
            # Cannot see a way around this. Need to find something
            # to distinguish mccd from regular tif...
            filetype = "tif"
    except IOError, error:
        logger.error("%s: File probably does not exist", error)
        raise error
    except:
        try:
            file_obj = FilenameObject(filename=filename)
            if file_obj == None:
                raise Exception("Unable to deconstruct filename")
            if (file_obj.format is not None) and\
                len(file_obj.format) != 1 and \
                type(file_obj.format) != type(["list"]):
                # one of OXD/ ADSC - should have got in previous
                raise Exception("openimage failed on magic bytes & name guess")
            filetype = file_obj.format
            #UNUSED filenumber = file_obj.num
        except Exception, error:
            logger.error(error)
            import traceback
            traceback.print_exc()
            raise Exception("Fabio could not identify " + filename)
    klass_name = "".join(filetype) + 'image'