webknossos-libs
webknossos-libs copied to clipboard
Add set_z method to BufferedSliceWriter for lazy initialization
Detailed Description
At the moment, the BufferedSliceWriter has to be instantiated with a z offset which cannot be changed afterwards. Changing the z offset after instantiation should be possible, though. I'd differentiate the following cases:
- Changing the offset before any write was done. This should be easy since nothing has been written yet.
- Changing the offset after a flush was done. This should also be relatively easy, since the data was already flushed.
- Changing the offset in a state where unflushed data exists. In this case, we could force a flush and then reset the offset.
Use Cases & Context
My use case would be covered by only tackling (1). In my case, I want to create a buffered slice writer and then set the z shortly before the first write is done. This would help to simplify some code in VX (see this comment).