scalableminds / webknossos-wrap

Efficient 3D volume storage format for webKnossos and analyses
MIT License
8 stars 3 forks source link

Add support for fast write of multi-channel row-major data #41

Closed valentin-pinkau closed 4 years ago

valentin-pinkau commented 5 years ago

Currently, writing data in row-major order is slow, when there are multiple channels. Since the data is converted with np.asfortranarray in this case. In order to get rid of this slow path, the Mat::copy_from method has to cope with row-major multi-channel data.

The input data is expected to have channels first. In the case of row-major order, this means that channels are not contiguous in memory. It probably makes sense to put the channel dimension last on the fly in the Mat::copy_from method.