CellProfiler / python-bioformats

Read and write life sciences file formats
Other
131 stars 45 forks source link

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

Open markemus opened 4 years ago

markemus commented 4 years ago

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'
folterj commented 3 years ago

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.