def load(self, fpath):
        """Load a microscopy file.
        
        :param fpath: path to microscopy file
        """
        def is_microscopy_item(fpath):
            """Return True if the fpath is likely to be microscopy data.

            :param fpath: file path to image
            :returns: :class:`bool`
            """
            l = fpath.split('.')
            ext = l[-1]
            pre_ext = l[-2]
            if ( (ext == 'tif' or ext == 'tiff')
                and pre_ext != 'ome' ):
                return False
            return True

        if not self.convert.already_converted(fpath):
            path_to_manifest = self.convert(fpath)
        else:
            path_to_manifest = os.path.join(self.backend.directory,
                                            os.path.basename(fpath),
                                            'manifest.json')

        
        collection = None
        if is_microscopy_item(fpath):
            collection = MicroscopyCollection()
        else:
            collection = ImageCollection()
        collection.parse_manifest(path_to_manifest)
        self.append(collection)

        return collection
def load ( self , fpath ) : def is_microscopy_item ( fpath ) : l = fpath . split ( '.' ) ext = l [ - 1 ] pre_ext = l [ - 2 ] if ( ( ext == 'tif' or ext == 'tiff' ) and pre_ext != 'ome' ) : return False return True if not self . convert . already_converted ( fpath ) : path_to_manifest = self . convert ( fpath ) else : path_to_manifest = os . path . join ( self . backend . directory , os . path . basename ( fpath ) , 'manifest.json' ) collection = None if is_microscopy_item ( fpath ) : collection = MicroscopyCollection ( ) else : collection = ImageCollection ( ) collection . parse_manifest ( path_to_manifest ) self . append ( collection ) return collection
Load a microscopy file.
        
        :param fpath: path to microscopy file