webknossos-libs icon indicating copy to clipboard operation
webknossos-libs copied to clipboard

Add set_z method to BufferedSliceWriter for lazy initialization

Open philippotto opened this issue 2 years ago • 0 comments

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:

  1. Changing the offset before any write was done. This should be easy since nothing has been written yet.
  2. Changing the offset after a flush was done. This should also be relatively easy, since the data was already flushed.
  3. 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).

philippotto avatar Nov 28 '23 12:11 philippotto