python-bioformats icon indicating copy to clipboard operation
python-bioformats copied to clipboard

AttributeError: 'OMETiffWriter' object has no attribute 'class_name'

Open markemus opened this issue 4 years ago • 1 comments

There was a previous issue on this but it was closed without answer. I'm trying to instantiate the bioformats.OMETiffWriter class but it crashes on instantiation:

writer = bf.OMETiffWriter()
AttributeError: 'OMETiffWriter' object has no attribute 'class_name'

markemus avatar Aug 04 '20 23:08 markemus

The same issue is apparently still present. This also seems to be the only way to save tiled images.

OMETiffWriter points to a creator function:

OMETiffWriter = _formatwriter.make_ome_tiff_writer_class()

which in turn defines a class with the same name:

def make_ome_tiff_writer_class():
    ...
    class OMETiffWriter(IFormatWriter):
        ...
    return OMETiffWriter

Should this function have returned an instance instead of a reference to the class? Trying to instantiate this reference fails, presumably as the context IFormatWriter etc only existed within that function.

folterj avatar Jul 29 '21 14:07 folterj